# FDA Drug Shortage API (`maximedupre/drug-shortage`) Actor

Search official FDA/openFDA drug shortage records by status, drug or ingredient, company, category, or date. Get structured records with availability, identifiers, dates, source links, and feed details for research and programmatic workflows.

- **URL**: https://apify.com/maximedupre/drug-shortage.md
- **Developed by:** [Maxime Dupré](https://apify.com/maximedupre) (community)
- **Categories:** Business, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.01 / 1,000 drug shortages

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

### 💊 Find FDA drug shortage records by status

Drug Shortage gives hospital pharmacy teams, procurement analysts, healthcare researchers, and developers structured records from the official FDA/openFDA drug shortages feed. Filter by status, drug or ingredient, manufacturer or company, therapeutic category, and source date, then use availability, identifiers, dates, source links, and feed details in your workflow.

- Find matching records with **[FDA Drug Shortage List](https://apify.com/maximedupre/drug-shortage/examples/fda-drug-shortage-list)** by choosing a status and optional filters.
- Build an **[ADHD Medication Shortage List](https://apify.com/maximedupre/drug-shortage/examples/adhd-medication-shortage-list)** by adding an ADHD drug or ingredient term.
- Review **[Current Drug Shortages](https://apify.com/maximedupre/drug-shortage/examples/current-drug-shortages)** with the `current` status and any filters.
- Check a **[Hydrocodone Shortage 2026](https://apify.com/maximedupre/drug-shortage/examples/hydrocodone-shortage-2026)** search with hydrocodone as a drug term.
- Check an **[Oxycodone Shortage 2026](https://apify.com/maximedupre/drug-shortage/examples/oxycodone-shortage-2026)** search with oxycodone as a drug term.

#### 🧾 FDA shortage records you can review

Each matching source record is saved as one dataset row. Rows can include the shortage status, drug names, brands, active substances, routes, therapeutic categories, pharmacologic classes, company and manufacturer details, product presentation, availability, identifiers, dates, source links, contact details, and retrieval provenance.

If the same source record matches more than one submitted drug term, the Actor keeps the first eligible match and does not rewrite that row with later matches. Use `feedInfo` and each row's `provenance` fields to check source freshness, fetch status, and completeness. `runSummary` gives counts by therapeutic category and dosage form, along with feed information.

#### 🧭 Filter and run a shortage search

1. Choose a shortage status.
2. Add optional drug, manufacturer, company, or therapeutic-category filters.
3. Choose `initial-posting` or `update` for the date window, then add an optional start and end date.
4. Start the Actor and open the dataset, total count, feed information, or run summary.

The public FDA/openFDA feed does not need a buyer-supplied API key. Leave optional scope filters empty to return all available matching results until the source is exhausted.

#### ⚙️ Input

**Input fields**

| Field | Type | What it does |
| --- | --- | --- |
| `status` | string (required) | Chooses `current`, `resolved`, `planned-discontinuation`, or `all`. |
| `drugTerms` | array of strings | Adds one or more drug or ingredient terms. Leave empty to return all available records in the selected status until the source is exhausted. |
| `manufacturerTerms` | array of strings | Filters by manufacturer or company names. Leave empty to return all available records in the selected status until the source is exhausted. |
| `therapeuticCategories` | array of strings | Filters by therapeutic categories. Leave empty to return all available records in the selected status until the source is exhausted. |
| `dateField` | string | Chooses `initial-posting` or `update` as the source date used by the date window. |
| `dateFrom` | string (YYYY-MM-DD) | Includes the start date in the window. Leave it empty for no lower date bound. |
| `dateTo` | string (YYYY-MM-DD) | Includes the end date in the window. Leave it empty for no upper date bound. |

There is no result-count limit in this input schema. When a filter is left empty, the run keeps all available matching results until the source is exhausted. Leave both date fields empty to skip date filtering.

**Default input example**

The input below is copied from a successful current-beta default-input run:

```json
{
  "status": "current",
  "drugTerms": [
    "lidocaine"
  ],
  "dateField": "initial-posting"
}
```

#### 🧾 Output

**Run links**

| Field | Type | What it does |
| --- | --- | --- |
| `datasetUrl` | string (URL) | Links to the drug shortage records in the default dataset. |
| `totalResults` | string | Shows the number of drug shortage records in the run. |
| `feedInfo` | string (URL) | Links to freshness, fetch status, and completeness details for the FDA shortage feed. |
| `runSummary` | string (URL) | Links to counts grouped by therapeutic category and dosage form, plus feed information. |

**Dataset rows**

The dataset schema requires `shortageStatus`, `drugName`, and `provenance`. Other fields may be absent when the source does not provide them.

| Field | Type | What it does |
| --- | --- | --- |
| `shortageStatus` | string | Shows the shortage status reported by FDA/openFDA. |
| `availability` | object | Holds source availability details. |
| `availability.status` | string | Shows the source availability status. |
| `availability.details` | string | Adds extra availability details from the source. |
| `drugName` | string | Shows the drug name in the official shortage record. |
| `genericName` | string | Shows the generic drug name when available. |
| `brandNames` | array of strings | Lists brand names linked to the drug. |
| `activeSubstances` | array of strings | Lists active substances linked to the drug. |
| `routes` | array of strings | Lists routes of administration linked to the drug. |
| `therapeuticCategories` | array of strings | Lists therapeutic categories linked to the drug. |
| `pharmacologicClasses` | array of strings | Lists pharmacologic classes linked to the drug. |
| `companyName` | string | Shows the company named in the shortage record. |
| `manufacturerName` | string | Shows the manufacturer named in the shortage record. |
| `dosageForm` | string | Shows the dosage form for the drug. |
| `strength` | string | Shows the drug strength from the source record. |
| `presentation` | string | Shows the product presentation from the source record. |
| `packageDescription` | string | Shows the package description from the source record. |
| `identifiers` | object | Holds package, product, and regulatory identifiers. |
| `identifiers.packageNdc` | string | Shows the package National Drug Code. |
| `identifiers.productNdc` | string | Shows the product National Drug Code. |
| `identifiers.applicationNumber` | string | Shows the FDA application number when available. |
| `identifiers.productId` | string | Shows the source product identifier used to match records. |
| `identifiers.rxcui` | string | Shows the RxNorm Concept Unique Identifier when available. |
| `identifiers.unii` | string | Shows the FDA Unique Ingredient Identifier when available. |
| `identifiers.splId` | string | Shows the Structured Product Label identifier when available. |
| `identifiers.splSetId` | string | Shows the Structured Product Label set ID when available. |
| `dates` | object | Holds dates reported in the shortage record. |
| `dates.initialPostingDate` | string (date) | Shows when the shortage record was first posted. |
| `dates.updateDate` | string (date) | Shows when the shortage record was last updated. |
| `dates.estimatedResupplyDate` | string (date) | Shows the estimated resupply date when available. |
| `dates.resolvedDate` | string (date) | Shows when the shortage was resolved when available. |
| `dates.discontinuedDate` | string (date) | Shows when the product was discontinued when available. |
| `source` | object | Holds official source links and contact details. |
| `source.sourceName` | string | Names the source for the row. |
| `source.recordUrl` | string (URL) | Links to the source record. |
| `source.relatedLinks` | array of objects | Lists other useful links from the source record. |
| `source.relatedLinks[].label` | string | Gives the name of a related source link. |
| `source.relatedLinks[].url` | string (URL) | Gives the URL of a related source link. |
| `source.contact` | object | Holds contact details supplied by the source. |
| `source.contact.name` | string | Gives the source contact name when available. |
| `source.contact.email` | string (email) | Gives the source contact email when available. |
| `source.contact.phone` | string | Gives the source contact phone when available. |
| `source.contact.url` | string (URL) | Links to the source contact when available. |
| `provenance` | object | Holds freshness and completeness details for the source row. |
| `provenance.sourceUpdatedAt` | string (date-time) | Shows when the source feed was last updated. |
| `provenance.retrievedAt` | string (date-time) | Shows when this row was retrieved. |
| `provenance.fetchStatus` | string | Shows the result of fetching the source data. |
| `provenance.isComplete` | boolean | Says whether the source data for the row is complete. |
| `comparison` | object | Holds changes found when this row is compared with an earlier run. |
| `comparison.changeType` | string | Says whether the row is `new`, `changed`, or `unchanged`. |
| `comparison.changedFields` | array of strings | Lists fields that changed since the earlier run. |

**Genuine current-beta row**

This is a full row from the successful current-beta default-input run for `current` records matching `lidocaine`. Optional fields not returned in this row remain documented in the table above.

```json
{
  "shortageStatus": "Current",
  "drugName": "Lidocaine Hydrochloride Injection",
  "genericName": "Lidocaine Hydrochloride Injection",
  "brandNames": [
    "LIDOCAINE HYDROCHLORIDE"
  ],
  "activeSubstances": [
    "LIDOCAINE HYDROCHLORIDE"
  ],
  "routes": [
    "RETROBULBAR",
    "TOPICAL"
  ],
  "therapeuticCategories": [
    "Anesthesia",
    "Pediatric"
  ],
  "pharmacologicClasses": [],
  "companyName": "Hospira, Inc., a Pfizer Company",
  "manufacturerName": "Hospira, Inc.",
  "dosageForm": "Injection",
  "strength": "200 mg/5 mL (4%; 40 mg/mL)",
  "presentation": "Lidocaine Hydrochloride Preservative Free, Injection, 200 mg/5 mL (4%; 40 mg/mL) (NDC 0409-4283-01)",
  "packageDescription": "Lidocaine Hydrochloride Preservative Free, Injection, 200 mg/5 mL (4%; 40 mg/mL) (NDC 0409-4283-01)",
  "availability": {
    "status": "Available"
  },
  "identifiers": {
    "packageNdc": "0409-4283-01",
    "productNdc": "0409-4283",
    "applicationNumber": "ANDA088295",
    "rxcui": "1010844",
    "unii": "V13007Z41A",
    "splId": "3681d241-f269-4d2d-b614-f87fc30aeecb",
    "splSetId": "89a4bd73-89f4-4fd7-2c9f-921e1da8f96b"
  },
  "dates": {
    "initialPostingDate": "2012-02-22",
    "updateDate": "2026-07-23"
  },
  "source": {
    "sourceName": "FDA/openFDA Drug Shortages",
    "recordUrl": "https://api.fda.gov/drug/shortages.json?limit=1000&skip=0&search=status%3A%22Current%22+AND+%28generic_name%3A%22lidocaine%22+OR+openfda.generic_name%3A%22lidocaine%22+OR+openfda.brand_name%3A%22lidocaine%22+OR+openfda.substance_name%3A%22lidocaine%22%29",
    "contact": {
      "phone": "844-646-4398"
    }
  },
  "provenance": {
    "sourceUpdatedAt": "2026-08-04T00:00:00.000Z",
    "retrievedAt": "2026-08-04T23:00:56.661Z",
    "fetchStatus": "ok",
    "isComplete": true
  },
  "comparison": {
    "changeType": "unchanged",
    "changedFields": []
  }
}
```

#### 💳 Pricing

**Pricing event**

This Actor charges $0.00001 for each matching drug shortage saved to your dataset. The event applies only when a matching shortage is saved; a run with no saved matching shortage does not create this event.

#### 🔌 Integrations

Open the dataset and run links in Apify Console, read them through the Apify API, or use dataset exports and schedules in your workflow.

https://www.youtube.com/watch?v=bNACk1\_S\_6w\&list=PLObrtcm1Kw6MUrlLNDbK9QRg8VDJg0gOW\&index=4

#### ❓ FAQ

##### Which FDA source does this use?

The Actor reads official FDA/openFDA drug shortage records. It is not the FDA and does not replace the FDA's own database.

##### Can I return current, resolved, and planned-discontinuation records?

Yes. Set `status` to `current`, `resolved`, `planned-discontinuation`, or `all`. The `all` choice includes every status exposed by this input.

##### What happens when I leave an optional filter empty?

The run keeps all available matches for the selected status and other choices until the source is exhausted. Leave both date fields empty to skip date filtering.

##### Can I use more than one drug term?

Yes. Add one list of drug or ingredient terms for the search scope. If one source record matches more than one submitted term, the first eligible match is saved and later matches are ignored; the saved row is not rewritten with later submitted values.

##### Does this Actor give medical advice or replacement recommendations?

No. It returns source data for research and programmatic workflows. It does not give clinical interpretation, medical advice, substitute recommendations, severity scores, or treatment guidance.

##### How can I check whether the source data is complete?

Open `feedInfo` for feed freshness, fetch status, and completeness. Each row also includes `provenance.sourceUpdatedAt`, `provenance.retrievedAt`, `provenance.fetchStatus`, and `provenance.isComplete` when the source provides them.

##### Do I need an FDA API key or login?

No. The Actor reads public FDA/openFDA data without buyer-supplied credentials.

### 📝 Changelog

**0.0: Initial release**

### 🆘 Support

For issues, questions, or feature requests, [file a ticket](https://console.apify.com/actors/maximedupre~drug-shortage/issues) and I'll fix or implement it in less than 24h 🫡

### 🔗 Related Actors

- [GoodRx Drug Price Scraper](https://apify.com/maximedupre/goodrx) — compare public pharmacy offers for a drug after reviewing its shortage status.
- [FDA Import Alert Monitor — DWPE Scraper](https://apify.com/maximedupre/fda-import-alerts) — check public FDA import alerts for affected firms or products during supply and compliance reviews.
- [FDA Drug Shortages Scraper](https://apify.com/automation-lab/fda-drug-shortages-scraper) — export another FDA/openFDA shortage view for a monitoring or data check.
- [Drug Shortage API — Delta Monitor & FDA Shortage Tracker](https://apify.com/malonestar/drug-shortage-delta-monitor) — review repeat-run changes in a delta-style shortage workflow.
- [FDA Drug Shortages Monitor](https://apify.com/ihitch/fda-drug-shortages-monitor) — review another recurring view of current and changed shortage records.

**Made with ❤️ by Maxime Dupré**

# Actor input Schema

## `status` (type: `string`):

Choose the shortage status to return: current, resolved, planned discontinuation, or all.

## `drugTerms` (type: `array`):

Optional. Add one or more drug or ingredient terms. Leave this empty to return all available records in the selected status until the source is exhausted.

## `manufacturerTerms` (type: `array`):

Optional. Add one or more manufacturer or company names. Leave this empty to return all available records in the selected status until the source is exhausted.

## `therapeuticCategories` (type: `array`):

Optional. Add one or more therapeutic categories. Leave this empty to return all available records in the selected status until the source is exhausted.

## `dateField` (type: `string`):

Choose which source date the date window uses. Leave both date fields empty to skip date filtering.

## `dateFrom` (type: `string`):

Optional start date in YYYY-MM-DD. The date is included in the window.

## `dateTo` (type: `string`):

Optional end date in YYYY-MM-DD. The date is included in the window.

## Actor input object example

```json
{
  "status": "current",
  "drugTerms": [
    "lidocaine"
  ],
  "dateField": "initial-posting"
}
```

# Actor output Schema

## `datasetUrl` (type: `string`):

Link to the drug shortage records.

## `totalResults` (type: `string`):

Number of drug shortage records in this run.

## `feedInfo` (type: `string`):

Shows when the FDA shortage feed was updated, how the fetch went, and whether the data is complete.

## `runSummary` (type: `string`):

Counts by therapeutic category and dosage form, plus feed information.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "status": "current",
    "drugTerms": [
        "lidocaine"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("maximedupre/drug-shortage").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "status": "current",
    "drugTerms": ["lidocaine"],
}

# Run the Actor and wait for it to finish
run = client.actor("maximedupre/drug-shortage").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "status": "current",
  "drugTerms": [
    "lidocaine"
  ]
}' |
apify call maximedupre/drug-shortage --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,maximedupre/drug-shortage"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/t8umzmdGtDnaHdnO6/builds/Qgxk2w1fi9o7jj41S/openapi.json
