# 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.describe_index_stats()
// npm install @pinecone-database/pinecone
import { Pinecone } from '@pinecone-database/pinecone'
const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' })
// To get the unique host for an index,
// see https://docs.pinecone.io/guides/manage-data/target-an-index
const index = pc.index("INDEX_NAME", "INDEX_HOST")
const stats = await index.describeIndexStats();
import io.pinecone.clients.Index;
import io.pinecone.configs.PineconeConfig;
import io.pinecone.configs.PineconeConnection;
import io.pinecone.proto.DescribeIndexStatsResponse;
public class DescribeIndexStatsExample {
public static void main(String[] args) {
PineconeConfig config = new PineconeConfig("YOUR_API_KEY");
// To get the unique host for an index,
// see https://docs.pinecone.io/guides/manage-data/target-an-index
config.setHost("INDEX_HOST");
PineconeConnection connection = new PineconeConnection(config);
Index index = new Index(connection, "INDEX_NAME");
DescribeIndexStatsResponse indexStatsResponse = index.describeIndexStats();
System.out.println(indexStatsResponse);
}
}
package main
import (
"context"
"log"
"github.com/pinecone-io/go-pinecone/v2/pinecone"
)
func main() {
ctx := context.Background()
pc, err := pinecone.NewClient(pinecone.NewClientParams{
ApiKey: "YOUR_API_KEY",
})
if err != nil {
log.Fatalf("Failed to create Client: %v", err)
}
// To get the unique host for an index,
// see https://docs.pinecone.io/guides/manage-data/target-an-index
idxConnection, err := pc.Index(pinecone.NewIndexConnParams{Host: "INDEX_HOST"})
if err != nil {
log.Fatalf("Failed to create IndexConnection for Host: %v", err)
}
stats, err := idxConnection.DescribeIndexStats(ctx)
if err != nil {
log.Fatalf("Failed to describe index \"%v\": %v", idx.Name, err)
} else {
fmt.Printf("%+v", *stats)
}
}
using Pinecone;
var pinecone = new PineconeClient("YOUR_API_KEY");
// To get the unique host for an index,
// see https://docs.pinecone.io/guides/manage-data/target-an-index
var index = pinecone.Index(host: "INDEX_HOST");
var indexStatsResponse = await index.DescribeIndexStatsAsync(new DescribeIndexStatsRequest());
Console.WriteLine(indexStatsResponse);
# To get the unique host for an index,
# see https://docs.pinecone.io/guides/manage-data/target-an-index
PINECONE_API_KEY="YOUR_API_KEY"
INDEX_HOST="INDEX_HOST"
curl -X POST "https://$INDEX_HOST/describe_index_stats" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "X-Pinecone-Api-Version: 2024-07"
{'dimension': 1024,
'index_fullness': 0,
'namespaces': {'example-namespace1': {'vector_count': 4}, 'example-namespace2': {'vector_count': 4}},
'total_vector_count': 8}
Returns:
{
"namespaces": { "example-namespace1": { "recordCount": 4 }, "example-namespace2": { "recordCount": 4 } },
"dimension": 1024,
"indexFullness": 0,
"totalRecordCount": 8
}
// Note: the value of totalRecordCount is the same as total_vector_count.
namespaces {
key: "example-namespace1"
value {
vector_count: 4
}
}
namespaces {
key: "example-namespace2"
value {
vector_count: 4
}
}
dimension: 1024
total_vector_count: 8
{
"dimension": 1024,
"index_fullness": 0,
"total_vector_count": 8,
"namespaces": {
"example-namespace1": {
"vector_count": 4
},
"example-namespace2": {
"vector_count": 4
}
}
}
{
"namespaces": {
"example-namespace1": {
"vectorCount": 4
},
"example-namespace2": {
"vectorCount": 4
}
},
"dimension": 1024,
"indexFullness": 0,
"totalVectorCount": 8
}
{
"namespaces": {
"example-namespace1": {
"vectorCount": 4
},
"example-namespace2": {
"vectorCount": 4
}
},
"dimension": 1024,
"indexFullness": 0,
"totalVectorCount": 8
}
Get index stats
The describe_index_stats operation returns 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 "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.describe_index_stats()
// npm install @pinecone-database/pinecone
import { Pinecone } from '@pinecone-database/pinecone'
const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' })
// To get the unique host for an index,
// see https://docs.pinecone.io/guides/manage-data/target-an-index
const index = pc.index("INDEX_NAME", "INDEX_HOST")
const stats = await index.describeIndexStats();
import io.pinecone.clients.Index;
import io.pinecone.configs.PineconeConfig;
import io.pinecone.configs.PineconeConnection;
import io.pinecone.proto.DescribeIndexStatsResponse;
public class DescribeIndexStatsExample {
public static void main(String[] args) {
PineconeConfig config = new PineconeConfig("YOUR_API_KEY");
// To get the unique host for an index,
// see https://docs.pinecone.io/guides/manage-data/target-an-index
config.setHost("INDEX_HOST");
PineconeConnection connection = new PineconeConnection(config);
Index index = new Index(connection, "INDEX_NAME");
DescribeIndexStatsResponse indexStatsResponse = index.describeIndexStats();
System.out.println(indexStatsResponse);
}
}
package main
import (
"context"
"log"
"github.com/pinecone-io/go-pinecone/v2/pinecone"
)
func main() {
ctx := context.Background()
pc, err := pinecone.NewClient(pinecone.NewClientParams{
ApiKey: "YOUR_API_KEY",
})
if err != nil {
log.Fatalf("Failed to create Client: %v", err)
}
// To get the unique host for an index,
// see https://docs.pinecone.io/guides/manage-data/target-an-index
idxConnection, err := pc.Index(pinecone.NewIndexConnParams{Host: "INDEX_HOST"})
if err != nil {
log.Fatalf("Failed to create IndexConnection for Host: %v", err)
}
stats, err := idxConnection.DescribeIndexStats(ctx)
if err != nil {
log.Fatalf("Failed to describe index \"%v\": %v", idx.Name, err)
} else {
fmt.Printf("%+v", *stats)
}
}
using Pinecone;
var pinecone = new PineconeClient("YOUR_API_KEY");
// To get the unique host for an index,
// see https://docs.pinecone.io/guides/manage-data/target-an-index
var index = pinecone.Index(host: "INDEX_HOST");
var indexStatsResponse = await index.DescribeIndexStatsAsync(new DescribeIndexStatsRequest());
Console.WriteLine(indexStatsResponse);
# To get the unique host for an index,
# see https://docs.pinecone.io/guides/manage-data/target-an-index
PINECONE_API_KEY="YOUR_API_KEY"
INDEX_HOST="INDEX_HOST"
curl -X POST "https://$INDEX_HOST/describe_index_stats" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "X-Pinecone-Api-Version: 2024-07"
{'dimension': 1024,
'index_fullness': 0,
'namespaces': {'example-namespace1': {'vector_count': 4}, 'example-namespace2': {'vector_count': 4}},
'total_vector_count': 8}
Returns:
{
"namespaces": { "example-namespace1": { "recordCount": 4 }, "example-namespace2": { "recordCount": 4 } },
"dimension": 1024,
"indexFullness": 0,
"totalRecordCount": 8
}
// Note: the value of totalRecordCount is the same as total_vector_count.
namespaces {
key: "example-namespace1"
value {
vector_count: 4
}
}
namespaces {
key: "example-namespace2"
value {
vector_count: 4
}
}
dimension: 1024
total_vector_count: 8
{
"dimension": 1024,
"index_fullness": 0,
"total_vector_count": 8,
"namespaces": {
"example-namespace1": {
"vector_count": 4
},
"example-namespace2": {
"vector_count": 4
}
}
}
{
"namespaces": {
"example-namespace1": {
"vectorCount": 4
},
"example-namespace2": {
"vectorCount": 4
}
},
"dimension": 1024,
"indexFullness": 0,
"totalVectorCount": 8
}
{
"namespaces": {
"example-namespace1": {
"vectorCount": 4
},
"example-namespace2": {
"vectorCount": 4
}
},
"dimension": 1024,
"indexFullness": 0,
"totalVectorCount": 8
}
# 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.describe_index_stats()
// npm install @pinecone-database/pinecone
import { Pinecone } from '@pinecone-database/pinecone'
const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' })
// To get the unique host for an index,
// see https://docs.pinecone.io/guides/manage-data/target-an-index
const index = pc.index("INDEX_NAME", "INDEX_HOST")
const stats = await index.describeIndexStats();
import io.pinecone.clients.Index;
import io.pinecone.configs.PineconeConfig;
import io.pinecone.configs.PineconeConnection;
import io.pinecone.proto.DescribeIndexStatsResponse;
public class DescribeIndexStatsExample {
public static void main(String[] args) {
PineconeConfig config = new PineconeConfig("YOUR_API_KEY");
// To get the unique host for an index,
// see https://docs.pinecone.io/guides/manage-data/target-an-index
config.setHost("INDEX_HOST");
PineconeConnection connection = new PineconeConnection(config);
Index index = new Index(connection, "INDEX_NAME");
DescribeIndexStatsResponse indexStatsResponse = index.describeIndexStats();
System.out.println(indexStatsResponse);
}
}
package main
import (
"context"
"log"
"github.com/pinecone-io/go-pinecone/v2/pinecone"
)
func main() {
ctx := context.Background()
pc, err := pinecone.NewClient(pinecone.NewClientParams{
ApiKey: "YOUR_API_KEY",
})
if err != nil {
log.Fatalf("Failed to create Client: %v", err)
}
// To get the unique host for an index,
// see https://docs.pinecone.io/guides/manage-data/target-an-index
idxConnection, err := pc.Index(pinecone.NewIndexConnParams{Host: "INDEX_HOST"})
if err != nil {
log.Fatalf("Failed to create IndexConnection for Host: %v", err)
}
stats, err := idxConnection.DescribeIndexStats(ctx)
if err != nil {
log.Fatalf("Failed to describe index \"%v\": %v", idx.Name, err)
} else {
fmt.Printf("%+v", *stats)
}
}
using Pinecone;
var pinecone = new PineconeClient("YOUR_API_KEY");
// To get the unique host for an index,
// see https://docs.pinecone.io/guides/manage-data/target-an-index
var index = pinecone.Index(host: "INDEX_HOST");
var indexStatsResponse = await index.DescribeIndexStatsAsync(new DescribeIndexStatsRequest());
Console.WriteLine(indexStatsResponse);
# To get the unique host for an index,
# see https://docs.pinecone.io/guides/manage-data/target-an-index
PINECONE_API_KEY="YOUR_API_KEY"
INDEX_HOST="INDEX_HOST"
curl -X POST "https://$INDEX_HOST/describe_index_stats" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "X-Pinecone-Api-Version: 2024-07"
{'dimension': 1024,
'index_fullness': 0,
'namespaces': {'example-namespace1': {'vector_count': 4}, 'example-namespace2': {'vector_count': 4}},
'total_vector_count': 8}
Returns:
{
"namespaces": { "example-namespace1": { "recordCount": 4 }, "example-namespace2": { "recordCount": 4 } },
"dimension": 1024,
"indexFullness": 0,
"totalRecordCount": 8
}
// Note: the value of totalRecordCount is the same as total_vector_count.
namespaces {
key: "example-namespace1"
value {
vector_count: 4
}
}
namespaces {
key: "example-namespace2"
value {
vector_count: 4
}
}
dimension: 1024
total_vector_count: 8
{
"dimension": 1024,
"index_fullness": 0,
"total_vector_count": 8,
"namespaces": {
"example-namespace1": {
"vector_count": 4
},
"example-namespace2": {
"vector_count": 4
}
}
}
{
"namespaces": {
"example-namespace1": {
"vectorCount": 4
},
"example-namespace2": {
"vectorCount": 4
}
},
"dimension": 1024,
"indexFullness": 0,
"totalVectorCount": 8
}
{
"namespaces": {
"example-namespace1": {
"vectorCount": 4
},
"example-namespace2": {
"vectorCount": 4
}
},
"dimension": 1024,
"indexFullness": 0,
"totalVectorCount": 8
}
Authorizations
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 indexes do not support filtering describe_index_stats by metadata.
Response
A successful response.
The response for the describe_index_stats operation.
A mapping for each namespace in the index from the namespace name to a summary of its contents. If a metadata filter expression is present, the summary will reflect only vectors matching that expression.
Show child attributes
Show child attributes
The dimension of the indexed vectors.
1024
The fullness of the index, regardless of whether a metadata filter expression was passed. The granularity of this metric is 10%.
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
The total number of vectors in the index, regardless of whether a metadata filter expression was passed
80000
Was this page helpful?