For on-demand indexes, since vector values are retrieved from object storage, fetch operations may have increased latency. If you only need metadata or IDs, consider using the query operation with `includeValues` set to `false` instead.
For guidance and examples, see [Fetch data](/guides/manage-data-fetch-data).

```python Python theme={null}
# pip install "pinecone[grpc]"
from pinecone.grpc import PineconeGRPC as Pinecone

pc = Pinecone(api_key="YOUR_API_KEY")
index = pc.Index("pinecone-index")

index.fetch(ids=["id-1", "id-2"], namespace="example-namespace")
```

```javascript JavaScript theme={null}
// npm install @pinecone-database/pinecone
import { Pinecone } from '@pinecone-database/pinecone'

const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' })
const index = pc.index('pinecone-index')

const fetchResult = await index.namespace('example-namespace').fetch(['id-1', 'id-2']);
```

```java Java theme={null}
import io.pinecone.clients.Index;
import io.pinecone.clients.Pinecone;
import io.pinecone.proto.FetchResponse;

import java.util.Arrays;
import java.util.List;

public class FetchExample {
    public static void main(String[] args) {
        Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
        Index index = pc.getIndexConnection("pinecone-index");
        List<String> ids = Arrays.asList("id-1", "id-2");
        FetchResponse fetchResponse = index.fetch(ids, "example-namespace");
        System.out.println(fetchResponse);
    }
}
```

```shell curl theme={null}
PINECONE_API_KEY="YOUR_API_KEY"
INDEX_HOST="INDEX_HOST"

curl -X GET "https://$INDEX_HOST/vectors/fetch?ids=id-1&ids=id-2&namespace=example-namespace" \
  -H "Api-Key: $PINECONE_API_KEY" \
  -H "X-Pinecone-Api-Version: 2024-04"
```

`GET /vectors/fetch`

:::code-group
```bash title="cURL"
curl --request GET \
  --url https://{index_host}/vectors/fetch \
  --header 'Authorization: Bearer <token>'
```

```json title="200"
{
  "vectors": {
    "id-1": {
      "id": "id-1",
      "values": [
        1,
        1.5
      ]
    },
    "id-2": {
      "id": "id-2",
      "values": [
        2,
        1
      ]
    }
  },
  "namespace": "example-namespace",
  "usage": {
    "readUnits": 1
  }
}
```
:::

## Authorizations

- `Authorization` (header, string, required) — Bearer authentication header of the form `Bearer <token>`.

## Query Parameters

- `ids` (query, string\[], required) — The vector IDs to fetch. Does not accept values containing spaces.
- `namespace` (query, string)

## Response

- `200` — A successful response.
- `default` — An unexpected error response.

## Related pages

- [Search with a vector](./database-2026-07-data-plane-query.md)
- [Search with text](./database-2026-07-data-plane-search-records.md)
- [Upsert records](./database-2026-07-data-plane-upsert.md)
- [Upsert text](./database-2026-07-data-plane-upsert-records.md)
- [Fetch records](./database-2026-07-data-plane-fetch.md)
- [Fetch records by metadata](./database-2026-07-data-plane-fetch-by-metadata.md)
- [Update a record](./database-2026-07-data-plane-update.md)
- [Delete records](./database-2026-07-data-plane-delete.md)
- [List record IDs](./database-2026-07-data-plane-list.md)
- [Search with a vector](./database-2026-04-data-plane-query.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
