POST /query
Search a namespace using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores.
For guidance, examples, and limits, see Search.
Servers
- https://{index_host}
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
X-Pinecone-Api-Version |
String | Yes |
Required date-based version header Default value: "2025-10" |
Request body fields
| Name | Type | Required | Description |
|---|---|---|---|
queries[] |
Array | No |
DEPRECATED. Use |
queries[].values[] |
Array | Yes |
The query vector values. This should be the same length as the dimension of the index being queried. |
queries[].namespace |
String | No |
An override the namespace to search. |
queries[].filter |
Object | No |
An override for the metadata filter to apply. This replaces the request-level filter. |
queries[].sparseValues |
Object | No |
Vector sparse data. Represented as a list of indices and a list of corresponded values, which must be with the same length. |
queries[].sparseValues.values[] |
Array | Yes |
The corresponding values of the sparse data, which must be with the same length as the indices. |
queries[].sparseValues.indices[] |
Array | Yes |
The indices of the sparse data. |
queries[].topK |
Integer | No |
An override for the number of results to return for this query vector. |
id |
String | No |
The unique ID of the vector to be used as a query vector. Each request can contain either the |
vector[] |
Array | No |
The query vector. This should be the same length as the dimension of the index being queried. Each |
namespace |
String | No |
The namespace to query. |
includeValues |
Boolean | No |
Indicates whether vector values are included in the response. For on-demand indexes, setting this to Default value: false |
filter |
Object | No |
The filter to apply. You can use vector metadata to limit your search. See Understanding metadata. |
maxCandidates |
Integer | No |
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. |
includeMetadata |
Boolean | No |
Indicates whether metadata is included in the response as well as the ids. Default value: false |
sparseVector |
Object | No |
Vector sparse data. Represented as a list of indices and a list of corresponded values, which must be with the same length. |
sparseVector.values[] |
Array | Yes |
The corresponding values of the sparse data, which must be with the same length as the indices. |
sparseVector.indices[] |
Array | Yes |
The indices of the sparse data. |
scanFactor |
Number | No |
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. |
topK |
Integer | Yes |
The number of results to return for each query. |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.