GET
/
vectors
/
list
# 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/data/target-an-index
index = pc.Index(host="INDEX_HOST")

# Implicit pagination using a generator function
for ids in index.list(prefix="doc1#", namespace="example-namespace"):
    print(ids)

# Manual pagination
results = index.list_paginated(
    prefix="doc1#",
    limit=3,
    namespace="example-namespace",
    pagination_token="eyJza2lwX3Bhc3QiOiIxMDEwMy0="
)

print(results)
# Implicit pagination
['doc1#chunk1', 'doc1#chunk2', 'doc1#chunk3', 'doc1chunk4', ...]

# Manual pagination
{'namespace': 'example-namespace',
 'pagination': {'next': 'eyJza2lwX3Bhc3QiOiJkb2MxI2NodW5rMiIsInByZWZpeCI6ImRvYzEjIn0='},
 'usage': {'read_units': 1},
 'vectors': [{'id': 'doc1#chunk1'}, {'id': 'doc1#chunk2'}, {'id': 'doc1#chunk3'}]}
# 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/data/target-an-index
index = pc.Index(host="INDEX_HOST")

# Implicit pagination using a generator function
for ids in index.list(prefix="doc1#", namespace="example-namespace"):
    print(ids)

# Manual pagination
results = index.list_paginated(
    prefix="doc1#",
    limit=3,
    namespace="example-namespace",
    pagination_token="eyJza2lwX3Bhc3QiOiIxMDEwMy0="
)

print(results)
# Implicit pagination
['doc1#chunk1', 'doc1#chunk2', 'doc1#chunk3', 'doc1chunk4', ...]

# Manual pagination
{'namespace': 'example-namespace',
 'pagination': {'next': 'eyJza2lwX3Bhc3QiOiJkb2MxI2NodW5rMiIsInByZWZpeCI6ImRvYzEjIn0='},
 'usage': {'read_units': 1},
 'vectors': [{'id': 'doc1#chunk1'}, {'id': 'doc1#chunk2'}, {'id': 'doc1#chunk3'}]}

Authorizations

Api-Key
string
header
required

An API Key is required to call Pinecone APIs. Get yours from the console.

Query Parameters

prefix
string

The vector IDs to fetch. Does not accept values containing spaces.

limit
integer
default:
100

Max number of IDs to return per page.

paginationToken
string

Pagination token to continue a previous listing operation.

namespace
string

Response

200
application/json
A successful response.

The response for the list operation.

vectors
object[]
pagination
object
namespace
string

The namespace of the vectors.

usage
object