Skip to main content
GET
/
namespaces
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")

for namespace in index.list_namespaces():
    print(namespace.name, ":", namespace.record_count)

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.

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")

for namespace in index.list_namespaces():
    print(namespace.name, ":", namespace.record_count)

Authorizations

Api-Key
string
header
required

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

Headers

X-Pinecone-Api-Version
string
default:202601-alpha
required

Required date-based version header

Query Parameters

limit
integer<int32>

Max number namespaces to return per page.

paginationToken
string

Pagination token to continue a previous listing operation.

prefix
string

Prefix of the namespaces to list. Acts as a filter to return only namespaces that start with this prefix.

Response

A successful response

namespaces
object[]

The list of namespaces belonging to this index.

pagination
object
total_count
integer<int32>

The total number of namespaces in the index matching the prefix

Example:

25