Skip to main content
POST
/
query
PINECONE_API_KEY="YOUR_API_KEY"
INDEX_HOST="INDEX_HOST"

curl "https://$INDEX_HOST/query" \
  -H "Api-Key: $PINECONE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Pinecone-Api-Version: 2025-10" \
  -d '{
    "namespace": "example-namespace",
    "vector": [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3],
    "filter": {"genre": {"$eq": "documentary"}},
    "topK": 3,
    "includeValues": true
  }'
{
  "matches":[
    {
      "id": "vec3",
      "score": 0,
      "values": [0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3]
    },
    {
      "id": "vec2",
      "score": 0.0800000429,
      "values": [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2]
    },
    {
      "id": "vec4",
      "score": 0.0799999237,
      "values": [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4]
    }
  ],
  "namespace": "example-namespace",
  "usage": {"read_units": 6}
}
PINECONE_API_KEY="YOUR_API_KEY"
INDEX_HOST="INDEX_HOST"

curl "https://$INDEX_HOST/query" \
  -H "Api-Key: $PINECONE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Pinecone-Api-Version: 2025-10" \
  -d '{
    "namespace": "example-namespace",
    "vector": [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3],
    "filter": {"genre": {"$eq": "documentary"}},
    "topK": 3,
    "includeValues": true
  }'
{
  "matches":[
    {
      "id": "vec3",
      "score": 0,
      "values": [0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3]
    },
    {
      "id": "vec2",
      "score": 0.0800000429,
      "values": [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2]
    },
    {
      "id": "vec4",
      "score": 0.0799999237,
      "values": [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4]
    }
  ],
  "namespace": "example-namespace",
  "usage": {"read_units": 6}
}

Authorizations

Api-Key
string
header
required

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

Headers

X-Pinecone-Api-Version
string
default:2025-10
required

Required date-based version header

Body

application/json

The request for the query operation.

topK
integer<int64>
required

The number of results to return for each query.

Required range: 1 <= x <= 10000
Example:

10

namespace
string

The namespace to query.

Example:

"example-namespace"

filter
object

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

Example:
{
"genre": { "$in": ["comedy", "documentary", "drama"] },
"year": { "$eq": 2019 }
}
includeValues
boolean
default:false

Indicates whether vector values are included in the response. For on-demand indexes, setting this to true may increase latency, especially with higher topK values, because vector values are retrieved from object storage. Unless you need vector values, set this to false for better performance.

Example:

true

includeMetadata
boolean
default:false

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

Example:

true

queries
object[]
deprecated

DEPRECATED. Use vector or id instead.

vector
number<float>[]

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.

Example:
[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]
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 request can contain either the vector or id parameter.

Maximum string length: 512
Example:

"example-vector-1"

scanFactor
number<float>

An optimization parameter for IVF dense indexes in dedicated read node indexes. It adjusts how much of the index is scanned to find vector candidates. Range: 0.5 – 4 (default). Keep the default (4.0) for the best search results. If query latency is too high, try lowering this value incrementally (minimum 0.5) to speed up the search at the cost of slightly lower accuracy. This parameter is only supported for dedicated (DRN) dense indexes.

Required range: 0.5 <= x <= 4
Example:

2

maxCandidates
integer<int64>

An optimization parameter that controls the maximum number of candidate dense vectors to rerank. Reranking computes exact distances to improve recall but increases query latency. Range: top_k – 100000. Keep the default for a balance of recall and latency. Increase this value if recall is too low, or decrease it to reduce latency at the cost of accuracy. This parameter is only supported for dedicated (DRN) dense indexes.

Required range: 1 <= x <= 100000
Example:

1000

Response

A successful response.

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
The query results for a single `QueryVector` · 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