POST
/
query
PINECONE_API_KEY="YOUR_API_KEY"
INDEX_HOST="INDEX_HOST"

curl "https://$INDEX_HOST/query" \
  -H "Api-Key: $PINECONE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Pinecone-API-Version: 2025-04" \
  -d '{
    "namespace": "example-namespace",
    "vector": [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3],
    "filter": {"genre": {"$eq": "documentary"}},
    "topK": 3,
    "includeValues": true
  }'
{
  "matches":[
    {
      "id": "vec3",
      "score": 0,
      "values": [0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3]
    },
    {
      "id": "vec2",
      "score": 0.0800000429,
      "values": [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2]
    },
    {
      "id": "vec4",
      "score": 0.0799999237,
      "values": [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4]
    }
  ],
  "namespace": "example-namespace",
  "usage": {"read_units": 6}
}
PINECONE_API_KEY="YOUR_API_KEY"
INDEX_HOST="INDEX_HOST"

curl "https://$INDEX_HOST/query" \
  -H "Api-Key: $PINECONE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Pinecone-API-Version: 2025-04" \
  -d '{
    "namespace": "example-namespace",
    "vector": [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3],
    "filter": {"genre": {"$eq": "documentary"}},
    "topK": 3,
    "includeValues": true
  }'
{
  "matches":[
    {
      "id": "vec3",
      "score": 0,
      "values": [0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3]
    },
    {
      "id": "vec2",
      "score": 0.0800000429,
      "values": [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2]
    },
    {
      "id": "vec4",
      "score": 0.0799999237,
      "values": [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4]
    }
  ],
  "namespace": "example-namespace",
  "usage": {"read_units": 6}
}

Authorizations

Api-Key
string
header
required

An API Key is required to call Pinecone APIs. Get yours from the console.

Body

application/json

The request for the query operation.

Response

200
application/json

A successful response.

The response for the query operation. These are the matches found for a particular query vector. The matches are ordered from most similar to least similar.