Skip to main content
This page shows you how to fetch the data in an index namespace. The kind of index determines which operation you use. An index with a document schema uses the Documents API, and a vector index uses the Vectors API. If you aren’t sure which kind of index you have, see Adopt the Documents API.
You can fetch data using the Pinecone console.
Fetches consume read units (RUs). See Understanding cost for how fetch cost is calculated.

Fetch documents

In an index with a document schema, fetch documents by ID or by metadata filter. A request specifies exactly one of ids or filter, and can name up to 1,000 IDs. include_fields selects which fields come back, and omitting it returns all of them.

Fetch documents by ID

To fetch specific documents, pass their IDs:
The response keys each document by its ID:

Fetch documents by metadata

To fetch every document matching a metadata filter expression, pass a filter instead of ids:
A filtered fetch returns one page at a time, holding 100 documents by default and 10,000 at most. When more documents match, the response carries a pagination.next token. Pass it back as pagination_token to get the next page, and stop when the response has no pagination token. In the REST API, limit sets the page size. Unlike a filtered update or delete, a filtered fetch accepts the text-match operators $match_phrase, $match_all, and $match_any on full-text fields, so you can fetch documents by their text without running a search. For the full request and response schema, see Fetch documents.

Fetch records

In a vector index, fetch records by ID or by metadata filter.

Fetch records by ID

To fetch records from a namespace based on their IDs, use the fetch operation with the following parameters:
  • namespace: The namespace containing the records to fetch. To use the default namespace, set this to "__default__".
  • ids: The IDs of the records to fetch. Maximum of 1000.
For on-demand indexes, since vector values are retrieved from object storage, fetch operations may have increased latency. If you only need metadata or IDs, consider using the query operation instead, with include_values left at its default of false. See Decrease latency for more details.
The response looks like this:

Fetch records by metadata

To fetch records from a namespace based on their metadata values, use the fetch_by_metadata operation with the following parameters: For example, the following code fetches 2 records with a genre field set to Action/Adventure from the default namespace:
The response looks like this:
To fetch the next page of results, pass the pagination token from the previous response. For example:
When there are more results available, the response includes a pagination object with a next token. When there are no more results, the response doesn’t include a pagination object.

Vector fetch limits

These limits apply to the Vectors API. For an index with a document schema, see Fetch documents.

Fetch by ID limits

Fetch by metadata limits

To retrieve more than 10,000 matching records, paginate through results using the paginationToken parameter. See Fetch records by metadata.

Data freshness

Pinecone is eventually consistent, so there can be a slight delay before new or changed records are visible to queries. You can view index stats to check data freshness.