Fetch records by metadata
Look up and return records by metadata from a single namespace. The returned records include the vector data and metadata.
For guidance and examples, see Fetch data.
# To get the unique host for an index,
# see https://docs.pinecone.io/guides/manage-data/target-an-index
PINECONE_API_KEY="YOUR_API_KEY"
INDEX_HOST="INDEX_HOST"
curl -X POST "https://$INDEX_HOST/vectors/fetch_by_metadata" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Pinecone-Api-Version: 2026-07" \
-d '{
"namespace": "__default__",
"filter": {"genre": {"$eq": "Action/Adventure"}},
"limit": 2
}'POST /vectors/fetch_by_metadata
{
"namespace": "example-namespace",
"pagination": {
"next": "Tm90aGluZyB0byBzZWUgaGVyZQo="
},
"usage": {
"egressBytes": 1024,
"readUnits": 5
},
"vectors": {
"id-1": {
"id": "id-1",
"metadata": {
"genre": "documentary",
"year": 2019
},
"values": [
1,
1.5
]
},
"id-2": {
"id": "id-2",
"metadata": {
"genre": "comedy",
"year": 2019
},
"values": [
2,
1
]
}
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"typeUrl": "<string>",
"value": "<string>"
}
]
}{
"code": 123,
"message": "<string>",
"details": [
{
"typeUrl": "<string>",
"value": "<string>"
}
]
}{
"code": 123,
"message": "<string>",
"details": [
{
"typeUrl": "<string>",
"value": "<string>"
}
]
}Authorizations
Section titled “Authorizations”Api-KeystringrequiredAn API Key is required to call Pinecone APIs. Get yours from the console.
Headers
Section titled “Headers”X-Pinecone-Api-VersionstringrequiredRequired date-based version header
namespace?stringThe namespace to fetch records from.
Example: example-namespace
filterobjectrequiredMetadata filter expression to select vectors. See Understanding metadata.
limit?integerThe maximum number of records to return per page. Defaults to 100.
Required range: 1 <= x <= 10000. Example: 12
paginationToken?stringPagination token to continue a previous listing operation.
Example: Tm90aGluZyB0byBzZWUgaGVyZQo=
Response
Section titled “Response”200 — A successful response.
The response for the fetch_by_metadata operation.
vectors?objectThe fetched vectors, in the form of a map between the fetched ids and the fetched vectors
namespace?stringThe namespace that served the fetch: the request's namespace, or the alias's target namespace when the request named a namespace alias.
Example: example-namespace
usage?objectShow child attributes
readUnits?integerThe number of read units consumed by this operation.
Example: 5
egressBytes?integerThe billed egress for this response, in bytes. Measured on the encoded response payload.
Required range: 0 <= x. Example: 1024
pagination?objectShow child attributes
nextstringrequiredExample: Tm90aGluZyB0byBzZWUgaGVyZQo=