Skip to main content
POST
/
api
/
v2
/
tenants
/
{tenant}
/
databases
/
{database}
/
collections
/
{collection_id}
/
query
Query a collection in a variety of ways, including vector search, metadata filtering, and full-text search
curl --request POST \
  --url https://api.trychroma.com/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/query \
  --header 'Content-Type: application/json' \
  --header 'x-chroma-token: <api-key>' \
  --data '
{
  "query_embeddings": [
    [
      123
    ]
  ],
  "where": "<unknown>",
  "where_document": "<unknown>",
  "ids": [
    "<string>"
  ],
  "include": [
    "distances"
  ],
  "n_results": 1
}
'
{
  "ids": [
    [
      "<string>"
    ]
  ],
  "include": [
    "distances"
  ],
  "distances": [
    [
      123
    ]
  ],
  "documents": [
    [
      "<string>"
    ]
  ],
  "embeddings": [
    [
      [
        123
      ]
    ]
  ],
  "metadatas": [
    [
      "<unknown>"
    ]
  ],
  "uris": [
    [
      "<string>"
    ]
  ]
}

Authorizations

x-chroma-token
string
header
required

Path Parameters

tenant
string
required

Tenant ID

database
string
required

Database name containing the collection

collection_id
string
required

Collection ID to query

Query Parameters

limit
integer<int32>

Limit for pagination

Required range: x >= 0
offset
integer<int32>

Offset for pagination

Required range: x >= 0

Body

application/json
query_embeddings
number<float>[][]
required
where
any
where_document
any
ids
string[] | null
include
enum<string>[]
Available options:
distances,
documents,
embeddings,
metadatas,
uris
n_results
integer<int32> | null
Required range: x >= 0

Response

Records matching the query

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