# List record keys

URL: https://docs.healthcare.dev/reference/datasets/list-record-keys

```http
GET https://api.healthcare.dev/v1/datasets/{dataset}/keys
```

Keys of the records in a dataset's published version, in key order, for building indexes and sitemaps. Keys are the stored form (for codes: uppercase, no dot, so `E119` is E11.9). Retired and replaced records are left out unless `include_retired=true`; with it, the count matches the release's `records` in `/v1/datasets/{dataset}/releases`. Page with `cursor` (from `links.next`), or jump to a position with `offset`.

Requires an API key: `Authorization: Bearer hdev_live_...`. See [Authentication](/authentication).

## Path parameters

| Name | Type | Required | Description | Example |
| --- | --- | --- | --- | --- |
| `dataset` | string | yes | Dataset id from `/v1/datasets` | `icd10cm` |

## Query parameters

| Name | Type | Required | Description | Example |
| --- | --- | --- | --- | --- |
| `limit` | integer | no | Page size, 1 to 10,000 (default 1000) | `1000` |
| `cursor` | string | no | Opaque cursor from `links.next` |  |
| `offset` | integer \| null | no | Skip this many keys first (ignored with `cursor`) | `0` |
| `include_retired` | "true" \| "false" | no | Also list retired and replaced records (default false) | `true` |

## Examples

**curl**

```sh
curl "https://api.healthcare.dev/v1/datasets/icd10cm/keys?limit=1000" \
  -H "Authorization: Bearer $HDEV_API_KEY"
```

**TypeScript**

```ts
const res = await fetch("https://api.healthcare.dev/v1/datasets/icd10cm/keys?limit=1000", {
  headers: { Authorization: `Bearer ${process.env.HDEV_API_KEY}` },
});
const { data, meta } = await res.json();
```

**Python**

```python
import os
import requests

res = requests.get("https://api.healthcare.dev/v1/datasets/icd10cm/keys?limit=1000", headers={"Authorization": f"Bearer {os.environ['HDEV_API_KEY']}"})
body = res.json()
```

## Response

Keys, in key order

```json
{
  "data": [
    "string"
  ],
  "meta": {
    "source": "cms-icd10",
    "data_version": "2026.1",
    "retrieved_at": "2026-10-24T12:00:00Z",
    "license": "Public domain (CMS). Reference data, not medical advice."
  },
  "links": {
    "self": "/v1/datasets/icd10cm/keys?limit=1000",
    "next": "/v1/datasets/icd10cm/keys?limit=1000&cursor=eyJrIjoiRTExLjkifQ"
  }
}
```

## Errors

Errors are `application/problem+json` ([RFC 9457](https://www.rfc-editor.org/rfc/rfc9457)). Branch on `type`, not on `title`. See [Errors](/errors).

| Status | `type` | When |
| --- | --- | --- |
| 400 | `invalid-request` | A parameter or the body failed validation; `errors` lists each field. |
| 401 | `unauthorized` | Missing, malformed or revoked API key. |
| 404 | `not-found` | No record with that id (retired records are still returned). |
| 429 | `rate-limited / quota-exceeded` | Too many requests per second (retry after `Retry-After`), or the monthly quota is used up. |
| 503 | `dataset-unavailable / unavailable` | The dataset has no published version yet, or the service is degraded. |
