# FDA Drug Shortages Scraper (Current and Resolved) (`talcoe/fda-drug-shortages`) Actor

Scrape FDA drug shortage records with shortage reason, availability, estimated resupply, company and NDC, filtered by status, drug, therapeutic category and dosage form, priced per result.

- **URL**: https://apify.com/talcoe/fda-drug-shortages.md
- **Developed by:** [M Usama](https://apify.com/talcoe) (community)
- **Categories:** Lead generation, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 results

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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### Data source

The public openFDA drug shortages JSON endpoint (api.fda.gov/drug/shortages.json), which mirrors the FDA Drug Shortages database and is refreshed by the FDA as shortages are posted or updated.

### What does FDA Drug Shortages Scraper do?

It returns FDA drug shortage records as clean, flat JSON: generic and brand name, shortage status (current, resolved, to be discontinued), availability, the reason for the shortage, estimated resupply notes, company, presentation and NDC, dosage form, therapeutic categories, and posting and update dates. Filters keep runs small, and pricing is per result.

### Why use it?

- Pharmacy and hospital buyers: monitor which products are short and what the manufacturer says about resupply.
- Distributors and wholesalers: find shortage products by drug, category or dosage form to target sourcing and outreach.
- Researchers and analysts: build a history of shortage reasons and durations, including resolved shortages.
- Replaces manually browsing the FDA site or writing your own pagination against the API.

### How to use it

1. Open the Actor and set the filters.
2. Click Start. Download results as JSON, CSV or Excel, or read them through the API.
3. Add a Schedule and an Integration (Slack, Google Sheets, webhook) to get new records automatically.

### Input

| Field | Description |
|---|---|
| `status` | `Current`, `Resolved`, `To Be Discontinued` or `All`. Default `Current`. |
| `searchTerm` | Optional. Matches generic name, brand name, active substance or company, for example `heparin` or `Pfizer`. |
| `therapeuticCategory` | Optional. For example `Anesthesia`, `Oncology`, `Anti-Infective`, `Cardiovascular`. |
| `dosageForm` | Optional. For example `Injection`, `Tablet`, `Capsule`. |
| `maxResults` | Hard stop for the run. You are billed per result, so this caps the cost. |
| `proxyConfiguration` | Not needed for this API. Leave off unless you hit rate limits. |

Example input:

```json
{ "status": "Current", "searchTerm": "heparin", "maxResults": 50 }
```

### Output

Every record has the same shape (trimmed example):

```json
{
  "id": "63323-285-10|Current|03/23/2018",
  "genericName": "Ropivacaine Hydrochloride Injection",
  "brandNames": ["NAROPIN"],
  "status": "Current",
  "availability": "Unavailable",
  "shortageReason": "Demand increase for the drug",
  "company": "Fresenius Kabi USA, LLC",
  "presentation": "Naropin, Injection, 2 mg/1 mL (NDC 63323-285-10)",
  "dosageForm": "Injection",
  "therapeuticCategories": ["Anesthesia"],
  "initialPostingDate": "2018-03-23",
  "updateDate": "2026-09-15",
  "estimatedResupplyNote": "Estimated recovery: TBD",
  "packageNdc": "63323-285-10",
  "contactInfo": "888-386-1300",
  "scrapedAt": "2026-10-02T08:15:25.167Z"
}
```

| Field | Meaning |
|---|---|
| `id` | Stable key (NDC, status and posting date), safe for deduplication between runs |
| `genericName`, `brandNames` | Drug names |
| `status` | Current, Resolved or To Be Discontinued |
| `availability` | Availability as reported by the manufacturer, when published |
| `shortageReason` | Reason given for the shortage, when published |
| `estimatedResupplyNote` | Resupply or recovery note from the manufacturer, when published |
| `resolvedNote` | Note on resolved records |
| `initialPostingDate`, `updateDate`, `changeDate`, `discontinuedDate` | ISO dates (YYYY-MM-DD) |
| `manufacturers`, `substanceNames`, `applicationNumbers`, `routes` | Extra openFDA product metadata when matched |

### Pricing

Pay per event: a small fee when a run starts, then a fixed price per result returned. You only pay for records that pass your filters. Set `maxResults` to cap any run.

### Limitations

- Covers FDA shortage data only. ASHP shortage listings are not included.
- Some fields (shortage reason, availability, resupply estimate) are blank when the manufacturer did not publish them.
- One record per shortage posting row (per NDC and presentation), so a single drug can appear several times.
- The FDA states openFDA data is unvalidated and must not be used for medical decisions.

### FAQ

**Is this legal?** The Actor reads data the FDA publishes openly through its public API without a login and stores only business information published for that purpose. You are responsible for how you use the data.

**Something is missing or broken?** Open an issue in the Issues tab; response time is usually under a day.

# Actor input Schema

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

Current shortages, resolved shortages, products to be discontinued, or all.

## `searchTerm` (type: `string`):

Optional. Matches generic name, brand name, active substance or company, for example heparin or Pfizer.

## `therapeuticCategory` (type: `string`):

Optional. For example Anesthesia, Oncology, Anti-Infective, Cardiovascular, Neurology, Pediatric.

## `dosageForm` (type: `string`):

Optional. For example Injection, Tablet, Capsule, Oral Suspension.

## `maxResults` (type: `integer`):

Hard stop for the run. You are billed per result, so this caps the cost.

## `proxyConfiguration` (type: `object`):

Not needed for the openFDA API. Leave off unless you hit rate limits.

## Actor input object example

```json
{
  "status": "Current",
  "maxResults": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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",
    "maxResults": 50,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("talcoe/fda-drug-shortages").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",
    "maxResults": 50,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("talcoe/fda-drug-shortages").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",
  "maxResults": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call talcoe/fda-drug-shortages --silent --output-dataset

```

## MCP server setup

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

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/WMdsdei4RdVw9Hm6y/builds/KmbvDfiVbiml3Cc3N/openapi.json
