from pinecone import Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
# To get the unique host for an index,
# see https://docs.pinecone.io/guides/manage-data/target-an-index
index = pc.Index(host="INDEX_HOST")
index.fetch(ids=["vec1", "vec2"], namespace="example-namespace")
Vectors
Fetch records
Look up and return records by ID from a single namespace. The returned records include the vector data and/or metadata.
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 with includeValues set to false instead.
For guidance and examples, see Fetch data.
GET
/
vectors
/
fetch
from pinecone import Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
# To get the unique host for an index,
# see https://docs.pinecone.io/guides/manage-data/target-an-index
index = pc.Index(host="INDEX_HOST")
index.fetch(ids=["vec1", "vec2"], namespace="example-namespace")
from pinecone import Pinecone
pc = Pinecone(api_key="YOUR_API_KEY")
# To get the unique host for an index,
# see https://docs.pinecone.io/guides/manage-data/target-an-index
index = pc.Index(host="INDEX_HOST")
index.fetch(ids=["vec1", "vec2"], namespace="example-namespace")
Authorizations
Headers
Required date-based version header
Query Parameters
The vector IDs to fetch. Does not accept values containing spaces.
The namespace to fetch records from. If not provided, the default namespace is used.
Was this page helpful?
⌘I