This page shows you how to fetch records by ID from a dense or sparse index namespace. The returned records are complete, including all relevant vector values and metadata.
To fetch records, specify the record IDs and the namespace. To use the default namespace, specify the record IDs and "__default__" as the namespace.
Copy
from pinecone.grpc import PineconeGRPC as Pineconepc = Pinecone(api_key="YOUR_API_KEY")# To get the unique host for an index, # see https://docs.pinecone.io/guides/manage-data/target-an-indexindex = pc.Index(host="INDEX_HOST")index.fetch(ids=["id-1", "id-2"], namespace="example-namespace")
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.