# FDA Drug Shortages List Scraper - NDC Lookup and Trends (`scrape_api/fda-drug-shortages`) Actor

Search FDA drug shortages by name, NDC, manufacturer, status and date. Export the drug shortages list with supply notes, ISO dates, trend counts and NDC joins for health data workflows.

- **URL**: https://apify.com/scrape_api/fda-drug-shortages.md
- **Developed by:** [Scrape_API](https://apify.com/scrape_api) (community)
- **Categories:** Business, Developer tools, Open source
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 drug shortage row returneds

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

## FDA Drug Shortages List Scraper

Search the FDA drug shortages list by generic name, brand name, package NDC, manufacturer, status or date. Export shortage records and trend counts with supply notes, normalised dates and identifiers for health data joins.

Use this Actor to follow products in a pharmacy purchasing workflow, prepare a hospital procurement report, or add shortage status to a health data catalogue. Every shortage row represents a source record for a product presentation and manufacturer. A package NDC can appear in several source records, so it is a join key rather than a unique record identifier.

### Use cases for drug shortage data

- **Pharmacy purchasing:** keep a watch list of the packages a department buys, and re-run the same input weekly to see which records turned `Resolved`, which were revised and which were announced for discontinuation.
- **Hospital procurement reporting:** pull every current shortage in one therapeutic category, group by manufacturer and hand the export to the buying committee as JSON, CSV or Excel.
- **Catalogue enrichment:** join shortage rows to your own item master on package NDC, then keep `start_date`, `updated_date` and `status` beside the item so the catalogue shows availability context instead of a bare stock flag.
- **Health data pipelines:** combine the rows with drug label, adverse event or recall datasets through `spl_set_ids`, `rxcuis`, `uniis` or NDC, and schedule the run on a cadence that matches how often you refresh those datasets.
- **Trend questions:** ask the source for aggregations instead of downloading rows and counting them yourself, for example shortages by status, by therapeutic category or by update date.

### Search drug shortages

Names within `drug_names` are combined with OR. Each name searches both the generic name and the harmonised brand name. Different filter groups are combined with AND. For example, a name plus a manufacturer returns records matching both. Category values within `therapeutic_categories` also use OR.

The `ndc` input searches an exact package NDC. Preserve its hyphens and leading zeroes. NDC wildcard characters remain literal phrase text and are never expanded; a non-matching phrase returns no matches. Other search terms reject wildcard expressions. Quotes and backslashes are rejected before the source request. This makes malformed searches visible before source requests start.

Status filters are `current`, `resolved`, `to_be_discontinued` and `all`. The alias `ongoing` means `current`, and `planned-discontinuation` means `to_be_discontinued`. Output keeps the original source strings: `Current`, `Resolved` and `To Be Discontinued`. An announced discontinuation is not a resolved shortage.

### FDA Drug Shortages List Scraper input

Start with this name search, which also corresponds to a captured real response in the product examples:

```json
{"drug_names": ["epinephrine"], "max_items": 5}
```

For a package lookup, use:

```json
{"ndc": "0228-2551-06", "max_items": 3}
```

You can provide `manufacturer`, `dosage_form`, `shortage_reason`, or `therapeutic_categories` to narrow the results. Use `date_from` and `date_to` in `YYYY-MM-DD` format. Bounds are inclusive. `date_field` selects `update` by default or `initial_posting`. One bound may be omitted. Invalid calendar dates and reversed date ranges are rejected.

At least one filter, an explicit status, or a count field is required. To request the unfiltered shortage list, set `status` to `all`. An empty input object is rejected to avoid an accidental broad collection. `max_items` defaults to 100 and accepts 1 through 1,000. It limits delivered rows, including count buckets.

Set `outputMode` to `full` to include the original shortage record in `raw`. The default `compact` mode returns the normalised fields and all documented join identifiers without the raw object. The raw record keeps the original source date formatting.

### FDA Drug Shortages List Scraper output

Results are stored in the default dataset, one row per shortage record or count bucket. The run output includes warnings, the source dataset update date and continuation information. Shortage rows carry both `_type` and `record_type` with the value `drug_shortage`.

A real shortage row, returned by the input `{"drug_names": ["epinephrine"], "max_items": 5}`. Every value below is exactly as the Actor delivered it; fields that repeat on every row (`source`, `authority`, `fetched_at`, `position`, `record_key`) and the longer identifier arrays (`package_ndcs`, `product_ndcs`, `rxcuis`, `uniis`) are left out to keep the example readable:

```json
{
  "record_type": "drug_shortage",
  "drug": "Bupivacaine Hydrochloride, Epinephrine Bitartrate Injection",
  "package_ndc": "0409-3812-01",
  "presentation": "Marcaine with Epinephrine, Injection, Marcaine™ 0.25% 125 mg/50 mL (2.5 mg/mL) with Epinephrine 1:200,000 (as bitartrate) Multiple Dose Vial Novaplus (NDC 0409-3812-01)",
  "dosage_form": "Injection",
  "manufacturer": "Hospira, Inc., a Pfizer Company",
  "status": "Current",
  "resolved": false,
  "reason": null,
  "start_date": "2018-02-20",
  "end_date": null,
  "updated_date": "2026-10-29",
  "availability": "Available",
  "therapeutic_categories": ["Anesthesia"],
  "brand_names": ["MARCAINE WITH EPINEPHRINE"],
  "substance_names": ["BUPIVACAINE HYDROCHLORIDE", "EPINEPHRINE BITARTRATE"],
  "application_numbers": ["NDA016964"],
  "spl_set_ids": ["93cf0914-de08-4ec6-8f8c-d663243b9958"]
}
```

A real count row from `{"count": "status"}`:

```json
{
  "record_type": "shortage_count",
  "count_field": "status",
  "term": "Current",
  "count": 1113
}
```

Core fields include `drug`, `manufacturer`, `dosage_form`, `status`, `resolved`, `reason`, `start_date`, `end_date`, `updated_date`, `url`, `position`, `source`, `authority` and `fetched_at`. Dates are normalised to `YYYY-MM-DD`. The fetch timestamp is UTC. A missing value is null rather than an invented date or explanation.

`start_date` comes from the initial posting date. `updated_date` comes from the source update date. `end_date` uses the change date only when status is `Resolved`. The original change and discontinuation dates are also exposed separately. A planned discontinuation date never becomes an end date.

Supply fields include `presentation`, `availability`, `availability_raw`, `related_info`, `resolved_note`, `contact_info` and `update_type`. Recognised availability spelling mistakes are normalised. Unknown supply text stays in `availability_raw` with a null normalised value and a warning. In the research snapshot, reasons appeared in 435 of 1,598 records and availability appeared only on current records. Null values therefore reflect source coverage.

The source does not supply a structured list of therapeutic alternatives. Supply notes and resolved notes are delivered as source text. They do not establish that another medicine can replace the product.

### NDC joins and trend counts

`package_ndc` identifies the presentation. Additional arrays include `package_ndcs`, `product_ndcs`, `brand_names`, `substance_names`, `application_numbers`, `spl_set_ids`, `rxcuis`, `uniis`, `routes` and `product_types`. Missing harmonised data produces empty arrays. Match NDC values to compatible drug label, adverse event or recall datasets; verify that both datasets use the same package or product NDC granularity. `spl_set_ids` can also connect shortage records to drug labels by label identifier.

Set `count` to `status`, `availability`, `therapeutic_category`, `update_type` or `update_date` for source aggregations. For example:

```json
{"count": "status", "max_items": 100}
```

Count rows use `record_type` and `_type` equal to `shortage_count`, with `count_field`, `term` and `count`. Date bucket terms retain the source `YYYYMMDD` form. Availability buckets retain source spelling, so differently spelled values remain separate buckets. The numeric `count` is the number of matching source records in that bucket.

The text fields `generic_name`, `company_name` and `dosage_form` can also be counted. These counts are calculated from all matching source pages. A failed or incomplete collection produces an error instead of a misleading subtotal. Narrow filters if a text aggregation cannot finish in one request. Count buckets are limited by `max_items`; warnings identify truncation.

### FDA drug shortages vs the official list and other scrapers

The agency publishes these shortage records on its own website, and pharmacy associations keep human-readable lists of them too, so a search for an FDA drug shortage list starts on those pages. Those pages are built for reading one record at a time: no package-NDC lookup, no identifier arrays, no aggregation you can schedule, and copying a record into a spreadsheet by hand. This Actor reads the official dataset behind those pages and returns it as rows you can filter, export and join, which is the difference between browsing a list and working with drug shortage data.

Several other actors in the Apify Store read the same public feed, so the records themselves are the same wherever you buy them. What differs is what a single run can ask for. When you compare listings, check whether a run can combine name, manufacturer, category and date filters in one request, look up an exact package NDC, return the identifier arrays that make rows joinable to drug labels, adverse events and recalls, and deliver the source's own aggregations as rows instead of counting them yourself. This Actor does all four, and every delivered row is billed once.

### Pricing and free use

See the current pricing tab for the event prices. A delivered shortage row counts once as a `drug_shortage` event. A delivered count bucket counts once as a `shortage_count` event. The source record count inside a bucket is not the number of billable rows. A bucket describing many records is still one delivered row. Empty results do not incur row charges, and there is no custom start event.

Free users receive at most ten rows per run. The same limit applies to shortage records and count buckets. Paying users can request up to 1,000 delivered rows with `max_items`. Export the dataset as JSON, CSV or another format supported by Apify.

### Limits and continuation

Source responses may be reused for up to five minutes. `last_updated` reports the source publication date; it is separate from the time a row is retrieved. The list is a view of the published dataset rather than a guarantee of stock at a pharmacy or wholesaler.

Each collection request has a bounded time budget. If shortage collection stops after delivering rows, the output contains `partial`, warnings and a cursor. The Actor follows cursor pages automatically while preserving the requested total. Direct API callers should resend the original input with the returned `cursor`. The dataset can change between pages, so a multi-page request is not an immutable historical snapshot. Broad requests beyond the source search window must be narrowed using filters or dates.

### FAQ

#### Is this the ASHP drug shortages list?

No. Every row comes from the shortage records the FDA publishes itself, and nothing is merged in from anywhere else. ASHP maintains its own shortage database separately, so it is a different list that can be read beside this one. Use this Actor when you need the FDA records with package NDCs, identifier arrays and source aggregations; keep the association list next to it if your process already works from that.

#### Does a resolved shortage mean every wholesaler has stock?

No. It means the published record is marked `Resolved`. Read the source notes and confirm purchasing availability through your usual suppliers.

#### Can I use an NDC as the unique key for a shortage row?

No. Several shortage records can share one NDC. Keep the presentation, manufacturer, status and dates when comparing records between runs.

#### Why is a reason or brand name missing?

Those fields are not present on every source record. Reasons become null, and absent harmonised identifier lists become empty arrays. Full mode preserves the original record for inspection.

#### Are count rows shortage records?

They are aggregation buckets. Use the row discriminator to separate them from shortage records, and use `count_field` to interpret the terms.

#### Does the Actor recommend replacement medicines?

It delivers published shortage information and source notes. Choosing a therapeutic replacement requires the appropriate clinical and product information and is outside this dataset.

# Actor input Schema

## `drug_names` (type: `array`):

Generic or brand names, OR within the list; combined with other filters using AND.

## `ndc` (type: `string`):

Exact package NDC, for example 0228-2551-06. Wildcard characters are treated as literal phrase text, never expanded.

## `manufacturer` (type: `string`):

Manufacturer phrase from the shortage record company_name.

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

Shortage status. ongoing aliases current; all explicitly requests every status.

## `therapeutic_categories` (type: `array`):

Therapeutic category phrases, OR within this list.

## `dosage_form` (type: `string`):

Dosage form phrase, such as Injection or Tablet.

## `shortage_reason` (type: `string`):

Reason phrase, such as Demand increase for the drug.

## `date_from` (type: `string`):

Inclusive YYYY-MM-DD lower date bound.

## `date_to` (type: `string`):

Inclusive YYYY-MM-DD upper date bound.

## `date_field` (type: `string`):

Which source date the range filters.

## `max_items` (type: `integer`):

Maximum delivered rows, including count buckets. Across cursor pages this is a run total.

## `count` (type: `string`):

Count rows instead of shortage rows. Text fields are counted from complete matching source pages.

## `outputMode` (type: `string`):

compact returns normalised fields; full also includes the original shortage record.

## `cursor` (type: `string`):

Opaque continuation token; reuse the original input unchanged.

## Actor input object example

```json
{
  "drug_names": [
    "epinephrine"
  ],
  "date_field": "update",
  "max_items": 100,
  "outputMode": "compact"
}
```

# Actor output Schema

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

Delivered rows.

## `summary` (type: `string`):

Warnings and continuation 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 = {
    "drug_names": [
        "epinephrine"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrape_api/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 = { "drug_names": ["epinephrine"] }

# Run the Actor and wait for it to finish
run = client.actor("scrape_api/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 '{
  "drug_names": [
    "epinephrine"
  ]
}' |
apify call scrape_api/fda-drug-shortages --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrape_api/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/vBsPIPOfphRV8eCe4/builds/CG3az09pgFMyS3QU8/openapi.json
