# pip install --upgrade pinecone
import os
from pinecone import Pinecone
pc = Pinecone(api_key=os.environ["PINECONE_API_KEY"])
# To get the host for an index, see https://docs.pinecone.io/guides/indexes/target-an-index
index = pc.index(host="INDEX_HOST")
stats = index.describe_index_stats()
print(stats.total_vector_count)
for name, summary in stats.namespaces.items():
print(name, summary.vector_count)
// npm install @pinecone-database/pinecone
import { Pinecone } from '@pinecone-database/pinecone';
// Reads PINECONE_API_KEY from the environment
const pc = new Pinecone();
// To get the host for an index, see https://docs.pinecone.io/guides/indexes/target-an-index
const index = pc.index({ host: 'INDEX_HOST' });
const stats = await index.describeIndexStats();
console.log(stats.totalRecordCount);
for (const [name, summary] of Object.entries(stats.namespaces ?? {})) {
console.log(name, summary.recordCount);
}
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/pinecone-io/go-pinecone/v7/pinecone"
)
func main() {
ctx := context.Background()
pc, err := pinecone.NewClient(pinecone.NewClientParams{
ApiKey: os.Getenv("PINECONE_API_KEY"),
})
if err != nil {
log.Fatalf("Failed to create Client: %v", err)
}
// To get the host for an index, see https://docs.pinecone.io/guides/indexes/target-an-index
idxConnection, err := pc.Index(pinecone.NewIndexConnParams{
Host: "INDEX_HOST",
})
if err != nil {
log.Fatalf("Failed to create IndexConnection: %v", err)
}
stats, err := idxConnection.DescribeIndexStats(ctx)
if err != nil {
log.Fatalf("Failed to describe index stats: %v", err)
}
fmt.Println(stats.TotalVectorCount)
for name, summary := range stats.Namespaces {
fmt.Println(name, summary.VectorCount)
}
}
# To get the unique host for an index,
# see https://docs.pinecone.io/guides/indexes/target-an-index
PINECONE_API_KEY="YOUR_API_KEY"
INDEX_HOST="YOUR_INDEX_HOST"
curl -X POST "https://$INDEX_HOST/describe_index_stats" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "X-Pinecone-Api-Version: 2026-07"
{
"dimension": 1024,
"indexFullness": 0.4,
"namespaces": {
"": {
"vectorCount": 50000
},
"example-namespace-2": {
"vectorCount": 30000
}
},
"totalVectorCount": 80000
}{
"code": 123,
"message": "<string>",
"details": [
{
"typeUrl": "<string>",
"value": "aSDinaTvuI8gbWludGxpZnk="
}
]
}Unauthorized{
"code": 123,
"message": "<string>",
"details": [
{
"typeUrl": "<string>",
"value": "aSDinaTvuI8gbWludGxpZnk="
}
]
}{
"code": 123,
"message": "<string>",
"details": [
{
"typeUrl": "<string>",
"value": "aSDinaTvuI8gbWludGxpZnk="
}
]
}Get index stats
Return statistics about the contents of an index, including the vector count per namespace, the number of dimensions, and the index fullness.
Serverless indexes scale automatically as needed, so index fullness is relevant only for pod-based indexes.
# pip install --upgrade pinecone
import os
from pinecone import Pinecone
pc = Pinecone(api_key=os.environ["PINECONE_API_KEY"])
# To get the host for an index, see https://docs.pinecone.io/guides/indexes/target-an-index
index = pc.index(host="INDEX_HOST")
stats = index.describe_index_stats()
print(stats.total_vector_count)
for name, summary in stats.namespaces.items():
print(name, summary.vector_count)
// npm install @pinecone-database/pinecone
import { Pinecone } from '@pinecone-database/pinecone';
// Reads PINECONE_API_KEY from the environment
const pc = new Pinecone();
// To get the host for an index, see https://docs.pinecone.io/guides/indexes/target-an-index
const index = pc.index({ host: 'INDEX_HOST' });
const stats = await index.describeIndexStats();
console.log(stats.totalRecordCount);
for (const [name, summary] of Object.entries(stats.namespaces ?? {})) {
console.log(name, summary.recordCount);
}
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/pinecone-io/go-pinecone/v7/pinecone"
)
func main() {
ctx := context.Background()
pc, err := pinecone.NewClient(pinecone.NewClientParams{
ApiKey: os.Getenv("PINECONE_API_KEY"),
})
if err != nil {
log.Fatalf("Failed to create Client: %v", err)
}
// To get the host for an index, see https://docs.pinecone.io/guides/indexes/target-an-index
idxConnection, err := pc.Index(pinecone.NewIndexConnParams{
Host: "INDEX_HOST",
})
if err != nil {
log.Fatalf("Failed to create IndexConnection: %v", err)
}
stats, err := idxConnection.DescribeIndexStats(ctx)
if err != nil {
log.Fatalf("Failed to describe index stats: %v", err)
}
fmt.Println(stats.TotalVectorCount)
for name, summary := range stats.Namespaces {
fmt.Println(name, summary.VectorCount)
}
}
# To get the unique host for an index,
# see https://docs.pinecone.io/guides/indexes/target-an-index
PINECONE_API_KEY="YOUR_API_KEY"
INDEX_HOST="YOUR_INDEX_HOST"
curl -X POST "https://$INDEX_HOST/describe_index_stats" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "X-Pinecone-Api-Version: 2026-07"
{
"dimension": 1024,
"indexFullness": 0.4,
"namespaces": {
"": {
"vectorCount": 50000
},
"example-namespace-2": {
"vectorCount": 30000
}
},
"totalVectorCount": 80000
}{
"code": 123,
"message": "<string>",
"details": [
{
"typeUrl": "<string>",
"value": "aSDinaTvuI8gbWludGxpZnk="
}
]
}Unauthorized{
"code": 123,
"message": "<string>",
"details": [
{
"typeUrl": "<string>",
"value": "aSDinaTvuI8gbWludGxpZnk="
}
]
}{
"code": 123,
"message": "<string>",
"details": [
{
"typeUrl": "<string>",
"value": "aSDinaTvuI8gbWludGxpZnk="
}
]
}memoryFullness and storageFullness alongside indexFullness, which summarizes overall capacity usage. For serverless on-demand indexes, all three values are typically 0 because storage and compute scale automatically. For dedicated indexes, these values indicate when the index needs more capacity. See Scale your index.# pip install --upgrade pinecone
import os
from pinecone import Pinecone
pc = Pinecone(api_key=os.environ["PINECONE_API_KEY"])
# To get the host for an index, see https://docs.pinecone.io/guides/indexes/target-an-index
index = pc.index(host="INDEX_HOST")
stats = index.describe_index_stats()
print(stats.total_vector_count)
for name, summary in stats.namespaces.items():
print(name, summary.vector_count)
// npm install @pinecone-database/pinecone
import { Pinecone } from '@pinecone-database/pinecone';
// Reads PINECONE_API_KEY from the environment
const pc = new Pinecone();
// To get the host for an index, see https://docs.pinecone.io/guides/indexes/target-an-index
const index = pc.index({ host: 'INDEX_HOST' });
const stats = await index.describeIndexStats();
console.log(stats.totalRecordCount);
for (const [name, summary] of Object.entries(stats.namespaces ?? {})) {
console.log(name, summary.recordCount);
}
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/pinecone-io/go-pinecone/v7/pinecone"
)
func main() {
ctx := context.Background()
pc, err := pinecone.NewClient(pinecone.NewClientParams{
ApiKey: os.Getenv("PINECONE_API_KEY"),
})
if err != nil {
log.Fatalf("Failed to create Client: %v", err)
}
// To get the host for an index, see https://docs.pinecone.io/guides/indexes/target-an-index
idxConnection, err := pc.Index(pinecone.NewIndexConnParams{
Host: "INDEX_HOST",
})
if err != nil {
log.Fatalf("Failed to create IndexConnection: %v", err)
}
stats, err := idxConnection.DescribeIndexStats(ctx)
if err != nil {
log.Fatalf("Failed to describe index stats: %v", err)
}
fmt.Println(stats.TotalVectorCount)
for name, summary := range stats.Namespaces {
fmt.Println(name, summary.VectorCount)
}
}
# To get the unique host for an index,
# see https://docs.pinecone.io/guides/indexes/target-an-index
PINECONE_API_KEY="YOUR_API_KEY"
INDEX_HOST="YOUR_INDEX_HOST"
curl -X POST "https://$INDEX_HOST/describe_index_stats" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "X-Pinecone-Api-Version: 2026-07"
Authorizations
An API Key is required to call Pinecone APIs. Get yours from the console.
Body
The request for the describe_index_stats operation.
If this parameter is present, the operation only returns statistics for vectors that satisfy the filter. See Understanding metadata.
Serverless and Starter indexes do not support filtering describe_index_stats by metadata, and reject a request carrying a non-empty filter.
Response
A successful response.
The response for the describe_index_stats operation.
The fullness of the index, reported to a granularity of 1% and capped at 1.0. Always 0 for indexes with on-demand read capacity.
Serverless indexes scale automatically as needed, so index fullness is relevant only for pod-based indexes.
The index fullness result may be inaccurate during pod resizing; to get the status of a pod resizing process, use describe_index.
0.4
Was this page helpful?