POST
/
query

Authorizations

Api-Key
string
headerrequired

An API Key is required to call Pinecone APIs. Get yours from the console.

Body

application/json

The request for the query operation.

topK
integer
required

The number of results to return for each query.

Required range: 1 < x < 10000
namespace
string

The namespace to query.

filter
object

The filter to apply. You can use vector metadata to limit your search. See Filter with metadata.

includeValues
boolean
default: false

Indicates whether vector values are included in the response.

includeMetadata
boolean
default: false

Indicates whether metadata is included in the response as well as the ids.

queries
object[]
deprecated

DEPRECATED. The query vectors. Each query() request can contain only one of the parameters queries, vector, or id.

vector
number[]

The query vector. This should be the same length as the dimension of the index being queried. Each query() request can contain only one of the parameters id or vector.

sparseVector
object

Vector sparse data. Represented as a list of indices and a list of corresponded values, which must be with the same length.

id
string

The unique ID of the vector to be used as a query vector. Each query() request can contain only one of the parameters queries, vector, or id.

Maximum length: 512

Response

200 - application/json

The response for the query operation. These are the matches found for a particular query vector. The matches are ordered from most similar to least similar.

results
object[]
deprecated

DEPRECATED. The results of each query. The order is the same as QueryRequest.queries.

matches
object[]

The matches for the vectors.

namespace
string

The namespace for the vectors.

usage
object