# pip install "pinecone[grpc]"
from pinecone.grpc import PineconeGRPC as 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=["id-1", "id-2"], namespace="example-namespace")
{'namespace': 'example-namespace',
'usage': {'readUnits': 1},
'vectors': {'id-1': {'id': 'id-1',
'values': [0.568879, 0.632687092, 0.856837332, ...]},
'id-2': {'id': 'id-2',
'values': [0.00891787093, 0.581895, 0.315718859, ...]}}}
Vectors
Fetch vectors
Look up and return vectors by ID from a single namespace. The returned vectors 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
# pip install "pinecone[grpc]"
from pinecone.grpc import PineconeGRPC as 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=["id-1", "id-2"], namespace="example-namespace")
{'namespace': 'example-namespace',
'usage': {'readUnits': 1},
'vectors': {'id-1': {'id': 'id-1',
'values': [0.568879, 0.632687092, 0.856837332, ...]},
'id-2': {'id': 'id-2',
'values': [0.00891787093, 0.581895, 0.315718859, ...]}}}
Documentation Index
Fetch the complete documentation index at: https://docs.pinecone.io/llms.txt
Use this file to discover all available pages before exploring further.
# pip install "pinecone[grpc]"
from pinecone.grpc import PineconeGRPC as 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=["id-1", "id-2"], namespace="example-namespace")
{'namespace': 'example-namespace',
'usage': {'readUnits': 1},
'vectors': {'id-1': {'id': 'id-1',
'values': [0.568879, 0.632687092, 0.856837332, ...]},
'id-2': {'id': 'id-2',
'values': [0.00891787093, 0.581895, 0.315718859, ...]}}}
Authorizations
Query Parameters
The vector IDs to fetch. Does not accept values containing spaces.
Was this page helpful?
⌘I