Skip to main content
POST
/
api
/
v2
/
tenants
/
{tenant}
/
databases
/
{database}
/
collections
/
{collection_id}
/
get
curl --request POST \
--url https://api.trychroma.com/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/get \
--header 'Content-Type: application/json' \
--header 'x-chroma-token: <api-key>' \
--data '
{
"where": "<unknown>",
"where_document": "<unknown>",
"ids": [
"<string>"
],
"include": [
"distances"
],
"limit": 1,
"offset": 1
}
'
{
  "documents": [
    "Document 1",
    "Document 2"
  ],
  "embeddings": [
    [
      0.1,
      0.2,
      0.3
    ],
    [
      0.4,
      0.5,
      0.6
    ]
  ],
  "ids": [
    "record1",
    "record2"
  ],
  "include": [
    "documents",
    "metadatas",
    "embeddings"
  ],
  "metadatas": [
    {
      "key": "value"
    },
    {
      "key2": "value2"
    }
  ],
  "uris": null
}

Authorizations

x-chroma-token
string
header
required

Path Parameters

tenant
string
required

Tenant UUID

database
string
required

Database name

collection_id
string
required

Collection UUID

Body

application/json

Records can be retrieved by their IDs or by a metadata filter. At least one of ids or where must be provided. Use include to specify which fields to return in the response.

where
any
where_document
any
ids
string[] | null
include
enum<string>[]

Use this enum to specify which fields should be returned when retrieving records.

Available options:
distances,
documents,
embeddings,
metadatas,
uris
limit
integer<int32> | null
Required range: x >= 0
offset
integer<int32> | null
Required range: x >= 0

Response

Records retrieved from the collection

All arrays have the same length, with each index representing a single record. Only fields specified in the request's include parameter are populated.

ids
string[]
required
include
enum<string>[]
required

List of fields that were included in this response.

Use this enum to specify which fields should be returned when retrieving records.

Available options:
distances,
documents,
embeddings,
metadatas,
uris
documents
(string | null)[] | null
embeddings
number<float>[][] | null
metadatas
(null | object)[] | null
uris
(string | null)[] | null