FDA Drug Shortages Scraper
Pricing
from $0.01 / 1,000 fda shortage records
FDA Drug Shortages Scraper
Export official FDA drug shortage records with status, company, availability, NDCs, dates, and product metadata for monitoring workflows.
Pricing
from $0.01 / 1,000 fda shortage records
Rating
0.0
(0)
Developer
Automation Lab
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
0
Monthly active users
8 days ago
Last modified
Categories
Share
Export official FDA/openFDA drug shortage records into a clean Apify dataset for pharmacy procurement, hospital supply-chain monitoring, pharma intelligence, and healthcare risk dashboards.
This actor calls the public openFDA Drug Shortages API, normalizes the records, and gives you searchable fields such as shortage status, generic name, company, availability, dosage form, NDC identifiers, posting dates, update dates, therapeutic category, and source metadata.
What does FDA Drug Shortages Scraper do?
FDA Drug Shortages Scraper turns the FDA drug shortage feed into analysis-ready rows.
- ✅ Monitor current drug shortages.
- ✅ Export resolved or discontinued shortages for historical review.
- ✅ Search by generic ingredient, company, therapeutic category, brand, or NDC.
- ✅ Capture FDA update and discontinuation dates for alerting workflows.
- ✅ Export discontinuation context for procurement and formulary decisions.
- ✅ Normalize nested openFDA product, NDC, SPL, UNII, and RxNorm identifiers into spreadsheet-friendly arrays.
Who is it for?
This scraper is designed for teams that need repeatable shortage data instead of manual FDA page checks.
- 🏥 Hospital supply-chain analysts tracking medication risk.
- 💊 Pharmacy procurement teams watching current availability.
- 📊 Healthcare data teams feeding BI dashboards.
- 🧪 Pharma and regulatory analysts monitoring product disruptions.
- 🔔 Risk and operations teams creating recurring shortage alerts.
Why use this FDA drug shortages extractor?
The FDA feed is public, but production workflows need consistent filters, exports, metadata, and repeatable runs.
This actor adds:
- Structured output fields.
- Apify datasets, exports, API access, and scheduling.
- Provenance fields for auditability.
- PPE billing with a small start fee and per-record pricing.
- Low-cost HTTP execution with no browser or proxy requirement.
Data source
The actor uses the official openFDA Drug Shortages endpoint:
https://api.fda.gov/drug/shortages.json
openFDA data may contain sparse or changing fields depending on the record. The actor keeps source values when present and leaves unavailable fields empty.
What data can you extract?
| Field | Description |
|---|---|
status | FDA shortage status, such as Current or Resolved |
genericName | Generic drug or active ingredient name from the shortage record |
companyName | Company listed by FDA |
availability | FDA availability text |
dosageForm | Dosage form, when supplied |
presentation | Package/presentation text |
therapeuticCategories | FDA therapeutic categories |
packageNdc | Package NDC from the shortage record |
productNdcs | Product NDC values from openFDA metadata |
brandNames | Brand names from openFDA metadata |
manufacturers | Manufacturer names from openFDA metadata |
applicationNumbers | FDA application numbers |
rxcuis | RxNorm concept identifiers |
discontinuedDate / discontinuedDateIso | FDA discontinuation date in source and ISO formats |
relatedInfo | Additional FDA shortage or discontinuation context |
productTypes | Product types from openFDA metadata |
openFdaPackageNdcs | Package NDCs from nested openFDA metadata |
splIds / splSetIds | Structured Product Label document and set identifiers |
uniis | Unique Ingredient Identifiers from openFDA metadata |
initialPostingDateIso | ISO-normalized initial posting date |
updateDateIso | ISO-normalized update date |
sourceUrl | Exact openFDA feed page URL that returned the record |
sourceQuery | openFDA search expression used for the run |
scrapedAt | Actor run timestamp |
How much does it cost to scrape FDA drug shortages?
The actor uses pay-per-event pricing.
- A small
startevent is charged once per run. - An
itemevent is charged for each shortage record saved. - The default input is intentionally small so first runs stay cheap.
- Larger scheduled monitoring runs scale with the number of records exported.
Exact live pricing is shown on the Apify actor page.
Input options
Use these inputs to focus the feed:
maxItems— maximum shortage records to save.status— Current, Resolved, To Be Discontinued, Discontinued, or All.search— free-text phrase for openFDA search.genericName— filter by generic or active ingredient.companyName— filter by company or manufacturer.therapeuticCategory— filter by category when present.updatedSince— keep records updated on or after a date.postedSince— keep records initially posted on or after a date.
Date filters must be real calendar dates in YYYY-MM-DD format. Invalid API inputs such as 2026-02-30 fail before an FDA request instead of silently producing a broader export.
Example input: current shortages
{"status": "Current","maxItems": 100}
Example input: company monitoring
{"companyName": "Takeda","status": "All","maxItems": 100}
Example input: active ingredient search
{"genericName": "lisdexamfetamine","status": "All","maxItems": 100}
Output example
{"status": "Current","genericName": "Lisdexamfetamine Dimesylate Tablet, Chewable","companyName": "Takeda Pharmaceuticals America, Inc.","availability": "Available","packageNdc": "59417-116-01","openFdaPackageNdcs": ["59417-116-01"],"productTypes": ["HUMAN PRESCRIPTION DRUG"],"splSetIds": ["example-spl-set-id"],"uniis": ["EXAMPLEUNII"],"updateDateIso": "2026-06-23","discontinuedDateIso": null,"relatedInfo": null,"sourceUrl": "https://api.fda.gov/drug/shortages.json?limit=25&skip=0&search=status%3A%22Current%22","sourceQuery": "status:\"Current\"","scrapedAt": "2026-09-22T00:00:00.000Z"}
How to run it
- Open the actor on Apify.
- Choose a shortage status.
- Add optional filters such as company, generic name, or updated date.
- Set
maxItems. - Run the actor.
- Export the dataset as JSON, CSV, Excel, or through the Apify API.
Scheduling and monitoring
You can schedule this scraper in Apify to run daily, weekly, or hourly depending on your monitoring needs.
Common patterns:
- Daily current-shortage export.
- Weekly resolved-shortage archive.
- Company-specific monitoring for a vendor list.
- Ingredient-specific monitoring for a pharmacy formulary.
Integrations
Connect the output to:
- Google Sheets for pharmacy procurement tracking.
- BigQuery or Snowflake for healthcare analytics.
- Slack or email alerts through Apify integrations.
- BI dashboards for shortage trend reporting.
- Internal inventory and risk systems.
API usage with Node.js
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: process.env.APIFY_TOKEN });const run = await client.actor('automation-lab/fda-drug-shortages-scraper').call({status: 'Current',maxItems: 100,});const { items } = await client.dataset(run.defaultDatasetId).listItems();console.log(items);
API usage with Python
from apify_client import ApifyClientclient = ApifyClient("<APIFY_TOKEN>")run = client.actor("automation-lab/fda-drug-shortages-scraper").call(run_input={"status": "Current","maxItems": 100,})items = client.dataset(run["defaultDatasetId"]).list_items().itemsprint(items)
API usage with cURL
curl -X POST "https://api.apify.com/v2/acts/automation-lab~fda-drug-shortages-scraper/runs?token=$APIFY_TOKEN" \-H "Content-Type: application/json" \-d '{"status":"Current","maxItems":100}'
MCP integration
Use this actor from AI assistants that support the Model Context Protocol (MCP).
Setup for Claude Code
$claude mcp add --transport http apify "https://mcp.apify.com?tools=automation-lab/fda-drug-shortages-scraper"
Setup for Claude Desktop, Cursor, or VS Code
Add this actor-scoped server to the MCP configuration for Claude Desktop, Cursor, or VS Code:
{"mcpServers": {"apify": {"url": "https://mcp.apify.com?tools=automation-lab/fda-drug-shortages-scraper"}}}
Your client will use OAuth to authenticate with Apify when first connected.
Example prompts:
- "Run the FDA Drug Shortages Scraper for current shortages and summarize high-risk categories."
- "Export FDA shortage records updated this month and group them by company."
- "Check whether a specific generic ingredient appears in current FDA shortages."
Tips for best results
- Use
status: Currentfor routine monitoring. - Use
status: Allfor historical analysis. - Keep
maxItemsmodest for alerting workflows. - Use
updatedSinceto focus on recent FDA changes. - Combine company and generic filters for targeted vendor risk monitoring.
Troubleshooting
If you get zero results, broaden your filters first.
Examples:
- Change
statustoAll. - Remove the company filter.
- Remove date filters.
- Try a shorter generic name.
Why are some fields empty?
FDA/openFDA records are not perfectly uniform. Some older or sparse records do not include brand names, RxCUIs, route, manufacturer metadata, discontinuation details, or nested identifiers. The actor preserves available source fields and leaves unavailable fields empty.
sourceUrl is feed-page provenance: it identifies the exact paginated openFDA query that returned a record. openFDA does not expose a stable record-detail URL for every shortage row, so the actor does not claim that this URL uniquely identifies one record. Use recordId for exported-row identity and sourceQuery to audit the applied openFDA search.
Legality
Is it legal to scrape FDA drug shortages?
The actor uses a public U.S. government/openFDA JSON endpoint. You are responsible for using the data according to your local rules, organizational policies, and openFDA terms.
Related scrapers
Other automation-lab healthcare and FDA actors may complement this workflow:
- https://apify.com/automation-lab/openfda-drug-enforcement-reports
- https://apify.com/automation-lab/openfda-adverse-events-scraper
- https://apify.com/automation-lab/health-canada-drug-product-scraper
FAQ
Can I monitor only one manufacturer?
Yes. Use companyName with the manufacturer or company name and set status to Current or All.
Can I search by NDC?
Yes. Put an NDC value in the search field. Results depend on how openFDA indexes the value.
Can I export to CSV?
Yes. Apify datasets support CSV, JSON, Excel, XML, RSS, and API export formats.
Does this actor require proxies?
No. It uses the official openFDA API over HTTP and does not need browser automation or proxies.
Can I schedule shortage alerts?
Yes. Schedule the actor on Apify and connect the dataset or webhook output to your alerting workflow.
Changelog
- 2026-09-22: Added FDA discontinuation details and openFDA product, package NDC, SPL, and UNII identifiers; corrected feed provenance; and added strict date-filter validation.
- Initial version: official openFDA drug shortage extraction with status, company, ingredient, availability, NDC, date, and source metadata fields.