Skip to main content
Pinecone Docs

Search documentation

Type to search this documentation.

On this pageOverview

List collections

Serverless indexes do not support collections.

Python
from pinecone.grpc import PineconeGRPC as Pinecone

pc = Pinecone(api_key='YOUR_API_KEY')

active_collections = pc.list_collections()
JavaScript
// npm install @pinecone-database/pinecone
import { Pinecone } from '@pinecone-database/pinecone'

const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' })

await pc.listCollections();
Java
import io.pinecone.clients.Pinecone;
import org.openapitools.client.model.CollectionModel;

public class ListCollectionsExample {
    public static void main(String[] args) {
        Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
        List<CollectionModel> collectionList = pc.listCollections().getCollections();
        System.out.println(collectionList);
    }
}
Go
package main

import (
    "context"
    "encoding/json"
    "fmt"
    "log"

    "github.com/pinecone-io/go-pinecone/v3/pinecone"
)

func prettifyStruct(obj interface{}) string {
    bytes, _ := json.MarshalIndent(obj, "", "  ")
    return string(bytes)
}

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

    collections, err := pc.ListCollections(ctx)
    if err != nil {
	    log.Fatalf("Failed to list collections: %v", err)
    } else {
        if len(collections) == 0 {
            fmt.Printf("No collections found in project")
        } else {
            for _, collection := range collections {
                fmt.Printf("collection: %v\n", prettifyStruct(collection))
            }
        }
    }
}
C#
using Pinecone;

var pinecone = new PineconeClient("YOUR_API_KEY");

var collectionList = await pinecone.ListCollectionsAsync();

Console.WriteLine(collectionList);
curl
PINECONE_API_KEY="YOUR_API_KEY"

curl -i -X GET "https://api.pinecone.io/collections" \
  -H "Api-Key: $PINECONE_API_KEY" \
  -H "X-Pinecone-Api-Version: 2025-01"
curl
{
    "collections": [
        {
            "name": "example-collection1",
            "status": "Ready",
            "environment": "us-east-1-aws",
            "size": 3081918,
            "vector_count": 99,
            "dimension": 3
        },
        {
            "name": "example-collection1",
            "status": "Ready",
            "environment": "us-east-1-aws",
            "size": 160087040000000,
            "vector_count": 10000000,
            "dimension": 1536
        }
    ]
}

GET /collections

  • 200 — This operation returns a list of all the collections in your current project.
  • 401 — Unauthorized. Possible causes: Invalid API key.
  • 500 — Internal server error.
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu