Official Pinecone clients provide convenient access to the Pinecone REST API.

Python client

See the Pinecone Python client documentation for full installation instructions, usage examples, and reference information.

Install

To install the newest version of the Python client, run the following command:

pip install pinecone-client

If you already have the Python client, run the following command:

pip install pinecone-client --upgrade

To check your client version, run the following command:

pip show pinecone-client  

Initialize

Once installed, you can import the library and then use an API key to initialize a client instance:

from pinecone import Pinecone

pc = Pinecone(api_key="YOUR_API_KEY")

When creating an index, import the ServerlessSpec or PodSpec class as well:

Node.js client

See the Pinecone Node.JS client documentation for full installation instructions, usage examples, and reference information.

Install

To install the newest version of the Node.js client, written in TypeScript, run the following command:

npm install @pinecone-database/pinecone

If you already have the Node.js client, run the following command:

npm install @pinecone-database/pinecone@latest

To check your client version, run the following command:

npm list | grep @pinecone-database/pinecone

Initialize

Once installed, you can import the library and then use an API key to initialize a client instance:

import { Pinecone } from '@pinecone-database/pinecone';

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

Was this page helpful?