Skip to main content
Pinecone Docs

Search documentation

Type to search this documentation.

On this pageOverview

Search with a vector

For guidance, examples, and limits, see Search.

curl
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: 2026-07" \
  -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
  }'

POST /query

  • X-Pinecone-Api-Version (header, string, required) — Required date-based version header
  • namespace (body, string) — The namespace to query.
  • topK (body, integer, required) — The number of results to return for each query.
  • filter (body, object) — The filter to apply. You can use vector metadata to limit your search. See Understanding metadata.
  • includeValues (body, boolean) — 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.
  • includeMetadata (body, boolean) — Indicates whether metadata is included in the response as well as the ids.
  • vector (body, 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. Whether vector and sparseVector may be sent together depends on the index: an index that supports only a single query predicate rejects the combination.
  • sparseVector (body, object) — Vector sparse data. Represented as a list of indices and a list of corresponded values, which must be with the same length.
  • id (body, string) — The unique ID of the vector to be used as a query vector. It is mutually exclusive with both vector forms: a request naming id may not also carry vector or sparseVector.
  • scanFactor (body, number) — 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 sup
  • maxCandidates (body, integer) — 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 dedicat
  • 200 — A successful response.
  • 400 — Bad request. The request body included invalid request parameters.
  • 401 — Unauthorized. Possible causes: missing or invalid API key.
  • 4XX — An unexpected error response.
  • 5XX — An unexpected error response.
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu