# Search drug shortages

URL: https://docs.healthcare.dev/reference/drugs/search-drug-shortages

```http
GET https://api.healthcare.dev/v1/drugs/shortages
```

FDA's drug shortage list (via openFDA), one entry per presentation (package NDC): current and recently resolved shortages, and discontinuations. Search by generic name with `q`, filter by NDC, status or therapeutic category. With `q`, ranked by `match_score`; without it, most recently updated first (`match_score: 1`). `ndc` matches at the product level.

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

## Query parameters

| Name | Type | Required | Description | Example |
| --- | --- | --- | --- | --- |
| `q` | string | no | Generic name, company, presentation or therapeutic category (fuzzy, at least 3 characters) | `atropine` |
| `ndc` | string | no | Product, package (any 10-digit layout) or 11-digit NDC. Matches at the product level: an entry for any package of the product, or linked to the product's label by openFDA. | `76385-129-01` |
| `status` | "current" \| "resolved" \| "to_be_discontinued" | no | Only entries with this status (default: all) | `current` |
| `therapeutic_category` | string | no | FDA therapeutic category (exact, case-insensitive) | `Anesthesia` |
| `limit` | integer | no | Page size (max 100) | `25` |
| `cursor` | string | no | Opaque cursor from `links.next` |  |
| `view` | "compact" \| "full" | no | `compact` returns only the fields an agent usually needs (fewer tokens); `full` (default) returns every field | `compact` |
| `fields` | string | no | Comma-separated record fields to return, e.g. `code,display,billable` | `code,display,billable` |

## Examples

**curl**

```sh
curl "https://api.healthcare.dev/v1/drugs/shortages?q=atropine&limit=25" \
  -H "Authorization: Bearer $HDEV_API_KEY"
```

**TypeScript**

```ts
const res = await fetch("https://api.healthcare.dev/v1/drugs/shortages?q=atropine&limit=25", {
  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/drugs/shortages?q=atropine&limit=25", headers={"Authorization": f"Bearer {os.environ['HDEV_API_KEY']}"})
body = res.json()
```

## Response

Matching shortage list entries

```json
{
  "data": [
    {
      "id": "string",
      "package_ndc": "string",
      "ndc11": "string",
      "generic_name": "string",
      "company_name": "string",
      "presentation": "string",
      "dosage_form": "string",
      "therapeutic_categories": [
        "string"
      ],
      "status": "current",
      "availability": "string",
      "shortage_reason": "string",
      "related_info": "string",
      "related_info_url": "string",
      "resolved_note": "string",
      "contact_info": "string",
      "update_type": "string",
      "initial_posting_date": "2026-10-01",
      "update_date": "2026-10-01",
      "discontinued_date": "2026-10-01",
      "change_date": "2026-10-01",
      "openfda": {
        "product_ndcs": [
          null
        ],
        "package_ndcs": [
          null
        ],
        "brand_names": [
          null
        ],
        "generic_names": [
          null
        ],
        "manufacturer_names": [
          null
        ],
        "rxcuis": [
          null
        ],
        "application_numbers": [
          null
        ],
        "spl_set_ids": [
          null
        ]
      },
      "match_score": 0
    }
  ],
  "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/drugs/shortages?q=atropine&limit=25",
    "next": "/v1/drugs/shortages?q=atropine&limit=25&cursor=eyJrIjoiRTExLjkifQ"
  }
}
```

### Fields

| Field | Type | Always present | Description |
| --- | --- | --- | --- |
| `id` | string | yes | Package NDC plus the kind of entry (`shortage` or `discontinuation`), e.g. `0409-1630-10:shortage` |
| `package_ndc` | string | yes | Package NDC as FDA lists it |
| `ndc11` | string \| null | yes | Package NDC normalized to NDC-11 |
| `generic_name` | string | yes | FDA's shortage name, e.g. `Atropine Sulfate Injection` |
| `company_name` | string | yes |  |
| `presentation` | string | yes | Strength, form and package, as FDA lists it |
| `dosage_form` | string \| null | yes |  |
| `therapeutic_categories` | string[] | yes |  |
| `status` | "current" \| "resolved" \| "to_be_discontinued" | yes | current = in shortage now; resolved = shortage over (kept briefly by FDA); to_be_discontinued = the manufacturer is discontinuing it |
| `availability` | string \| null | yes | FDA's availability note, e.g. `Available`, `Limited Availability`, `Unavailable` |
| `shortage_reason` | string \| null | yes |  |
| `related_info` | string \| null | yes |  |
| `related_info_url` | string \| null (uri) | yes |  |
| `resolved_note` | string \| null | yes |  |
| `contact_info` | string \| null | yes | Manufacturer's customer contact |
| `update_type` | string \| null | yes | `New`, `Revised` or `Reverified` |
| `initial_posting_date` | string \| null (date) | yes |  |
| `update_date` | string \| null (date) | yes |  |
| `discontinued_date` | string \| null (date) | yes |  |
| `change_date` | string \| null (date) | yes |  |
| `openfda` | OpenFdaLinks | yes |  |
| `match_score` | number | yes | How well this result matches the query: 1 exact code or id, 0.9 code prefix, 0.5 to 0.9 every query word in the text (higher is closer), under 0.5 a fuzzy (typo-tolerant) match. Below 0.5, check the result before relying on it. |

## 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. |
