For guidance and examples, see [Fetch data](/guides/manage-data-fetch-data).

:::code-group
```shell curl
# 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/vectors/fetch_by_metadata" \
  -H "Api-Key: $PINECONE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Pinecone-Api-Version: 2026-07" \
  -d '{
    "namespace": "__default__",
    "filter": {"genre": {"$eq": "Action/Adventure"}},
    "limit": 2
  }'
```
:::

`POST /vectors/fetch_by_metadata`

:::code-group
```json title="200"
{
  "namespace": "example-namespace",
  "pagination": {
    "next": "Tm90aGluZyB0byBzZWUgaGVyZQo="
  },
  "usage": {
    "egressBytes": 1024,
    "readUnits": 5
  },
  "vectors": {
    "id-1": {
      "id": "id-1",
      "metadata": {
        "genre": "documentary",
        "year": 2019
      },
      "values": [
        1,
        1.5
      ]
    },
    "id-2": {
      "id": "id-2",
      "metadata": {
        "genre": "comedy",
        "year": 2019
      },
      "values": [
        2,
        1
      ]
    }
  }
}
```

```json title="400"
{
  "code": 123,
  "message": "<string>",
  "details": [
    {
      "typeUrl": "<string>",
      "value": "<string>"
    }
  ]
}
```

```json title="4XX"
{
  "code": 123,
  "message": "<string>",
  "details": [
    {
      "typeUrl": "<string>",
      "value": "<string>"
    }
  ]
}
```

```json title="5XX"
{
  "code": 123,
  "message": "<string>",
  "details": [
    {
      "typeUrl": "<string>",
      "value": "<string>"
    }
  ]
}
```
:::

#### Authorizations

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `Api-Key` | `string` | - |  |

An API Key is required to call Pinecone APIs. Get yours from the [console](https://app.pinecone.io/).

#### Headers

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `X-Pinecone-Api-Version` | `string` | `2026-07` | Required date-based version header |

#### Body

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `namespace?` | `string` | - | The namespace to fetch records from. Example: example-namespace |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `filter` | `object` | - |  |

Metadata filter expression to select vectors. See [Understanding metadata](/guides/index-data-indexing-overview#metadata).

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `limit?` | `integer` | `100` | The maximum number of records to return per page. Defaults to 100. Required range: 1 <= x <= 10000. Example: 12 |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `paginationToken?` | `string` | - | Pagination token to continue a previous listing operation. Example: Tm90aGluZyB0byBzZWUgaGVyZQo= |

#### Response

`200` — A successful response.

The response for the `fetch_by_metadata` operation.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `vectors?` | `object` | - | The fetched vectors, in the form of a map between the fetched ids and the fetched vectors |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `namespace?` | `string` | - | The namespace that served the fetch: the request's namespace, or the alias's target namespace when the request named a namespace alias. Example: example-namespace |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `usage?` | `object` | - |  |

:::accordion{title="Show child attributes"}
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `readUnits?` | `integer` | - | The number of read units consumed by this operation. Example: 5 |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `egressBytes?` | `integer` | - | The billed egress for this response, in bytes. Measured on the encoded response payload. Required range: 0 <= x. Example: 1024 |
:::

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `pagination?` | `object` | - |  |

:::accordion{title="Show child attributes"}
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `next` | `string` | - | Example: Tm90aGluZyB0byBzZWUgaGVyZQo= |
:::

## Related pages

- [Search with a vector](./database-data-plane-query.md)
- [Search with text](./database-data-plane-search-records.md)
- [Upsert records](./database-data-plane-upsert.md)
- [Upsert text](./database-data-plane-upsert-records.md)
- [Fetch records](./database-data-plane-fetch.md)
- [Update a record](./database-data-plane-update.md)
- [Delete records](./database-data-plane-delete.md)
- [List record IDs](./database-data-plane-list.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.
