> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trychroma.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get number of records

> Returns the number of records in a collection.



## OpenAPI

````yaml https://api.trychroma.com/openapi.json get /api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/count
openapi: 3.1.0
info:
  title: chroma-frontend
  description: ''
  license:
    name: ''
  version: 1.0.0
servers: []
security: []
paths:
  /api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/count:
    get:
      tags:
        - Record
      summary: Get number of records
      description: Returns the number of records in a collection.
      operationId: collection_count
      parameters:
        - name: tenant
          in: path
          description: Tenant UUID
          required: true
          schema:
            type: string
          example: 1e30d217-3d78-4f8c-b244-79381dc6a254
        - name: database
          in: path
          description: Database name
          required: true
          schema:
            type: string
        - name: collection_id
          in: path
          description: Collection UUID
          required: true
          schema:
            type: string
          example: 1e30d217-3d78-4f8c-b244-79381dc6a254
        - name: read_level
          in: query
          description: Read level for consistency vs performance tradeoffs
          required: false
          schema:
            $ref: '#/components/schemas/ReadLevel'
      responses:
        '200':
          description: Number of records in the collection
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/u32'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Collection not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - label: Count records
          lang: typescript
          source: const count = await collection.count();
        - label: Count records
          lang: python
          source: count = collection.count()
        - label: Count records
          lang: rust
          source: let count = collection.count().await?;
components:
  schemas:
    ReadLevel:
      type: string
      enum:
        - index_and_wal
        - index_only
        - index_and_bounded_wal
    u32:
      type: integer
      format: int32
      minimum: 0
    ErrorResponse:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
        message:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-chroma-token

````