View index information
This page shows you how to get index information.
You can view index information using the Pinecone console.
List all indexes in a project
Use the list_indexes
operation to get a complete description of all indexes in a project:
The list_indexes
operation returns a response like the following:
With the Python SDK, you can use the .names()
helper function to iterate over the index names in the list_indexes()
response, for example:
from pinecone.grpc import PineconeGRPC as Pinecone
from pinecone import ServerlessSpec
pc = Pinecone(api_key="YOUR_API_KEY")
index_name = "example-index3"
if not pc.has_index(index_name):
# Do something, such as create the index
pc.create_index(
name=index_name,
dimension=1536,
metric='cosine',
spec=ServerlessSpec(
cloud="aws",
region="us-east-1"
)
)
Get information about an index
Use the describe_index
endpoint to get a complete description of a specific index:
The describe_index
operation uses a different API (api.pinecone.io
) than data plane operations such as upsert
and query
. In production, you should therefore not rely on describe_index
to programmatically get an index endpoint for data manipulation operations. Instead, you should get an index endpoint once and cache it for reuse or specify the endpoint directly.
Was this page helpful?