# openFDA Scraper: Drug Safety, Recalls, Labels (`parselab/openfda-drug-safety-scraper`) Actor

Scrape openFDA for drug safety profiles, adverse event reports, drug and device and food recalls, label warnings, product codes, approvals and device clearances. Get outcomes, top reactions, recall class and risk flags per drug. Filter by drug, company or date. Export to CSV or Excel.

- **URL**: https://apify.com/parselab/openfda-drug-safety-scraper.md
- **Developed by:** [ParseLab](https://apify.com/parselab) (community)
- **Categories:** Other, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $19.50 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## openFDA Scraper: Drug Safety Profiles, Adverse Events, Recalls and Labels

This openFDA scraper puts the public safety data of the US Food and Drug Administration into one tool. Give it a drug name and it returns a safety profile in one row: how many adverse event reports exist, how many were serious or fatal, the most common reactions, whether the trend is going up, the recalls on file, whether the label has a boxed warning and how many products are on the market. Switch the mode and you get the raw material: single adverse event reports, drug, device and food recalls, label sections, the national drug code directory, drug approvals and medical device clearances.

Every row is clean and ready for a spreadsheet. Dates are real dates, counts are numbers, names are lists, and the codes of the source are translated into words, for example the reporter type, the patient sex, the outcome and the recall class with its meaning.

Pharmacovigilance teams, drug safety researchers, health tech builders, pharmacists, lawyers, analysts and journalists use it to watch products and companies.

### What can you do with this openFDA scraper?

- Get a safety profile of any drug, generic or brand, in one row
- Pull adverse event reports for a drug, a reaction, a country or a period
- Keep only serious reports, or only reports with death, hospitalization or disability
- Find ongoing Class I recalls of drugs, devices or food
- Group recalls by reason, such as contamination, sterility or labeling errors
- Read the boxed warning and the main label sections of a drug
- List every product of a company in the drug code directory
- See when a drug was first approved and how many label changes followed
- Search medical device clearances by device name, company or product code, with the days the review took
- Export to CSV or Excel, or send new reports to Slack and your own tools

### What data can you extract from openFDA?

| Mode | One row is | Highlights |
|---|---|---|
| Drug safety profile | One drug | Event reports in total, serious, death, hospitalization, life threatening and disabling reports, shares, reports in the last 12 months and the 12 months before, trend, top 15 reactions with counts and shares, top co-reported drugs, reports by sex and country, recalls, Class I and ongoing recalls, latest recall, boxed warning, brands, pharmacologic classes, routes, products on the market, signal flags and a signal score |
| Adverse events | One report | Report id, dates, report type, serious flag and each outcome, death date, country, reporter type, patient sex, age in years, weight, reactions and their outcomes, suspect, concomitant and interacting drugs with role, indication, route, dose text and manufacturer |
| Recalls | One recall (drugs, devices or food) | Recall number, class and its meaning, status, ongoing flag, firm, place, voluntary or mandated, dates, days the recall lasted, product, quantity as a number, reason and its category, distribution, nationwide flag, code information, brand and generic names |
| Labels | One drug label | Set id, version, effective date, brands, generic names, substances, manufacturers, routes, pharmacologic classes, mechanism, codes, boxed warning, indications, contraindications, warnings, adverse reactions, interactions, dosage, pregnancy, overdose |
| Drug directory | One product | National drug code, brand, generic name, labeler, dosage form, routes, ingredients with strength, marketing category, application number, dates, packages |
| Approvals | One application | Application number and type, sponsor, brands, products with dosage form and marketing status, first approval date, latest approved action, submissions, label supplements, priority review |
| Device clearances | One 510(k) | Number, device, applicant, place, dates, days to decision, decision, clearance type, product code, device class, medical specialty, expedited and third party review |

### How to scrape openFDA

1. Choose a mode. Start with **Drug safety profile**.
2. Type one or more drug names. Generic names and brand names both work.
3. For other modes, add companies, reactions, countries, classes or dates.
4. Set **Max Items** and click **Start**.
5. Export the dataset as CSV, Excel or from the Apify console.

### Input example

```json
{
  "mode": "profile",
  "drugNames": ["metformin", "Ozempic"],
  "maxItems": 10
}
```

### Safety profile output example

```json
{
  "drug": "metformin",
  "eventReportsTotal": 461399,
  "seriousSharePct": 67.4,
  "deathSharePct": 8.29,
  "reportsLast12Months": 18467,
  "reportsPrior12Months": 26741,
  "reportTrendPct": -30.9,
  "topReactions": [
    { "reaction": "NAUSEA", "reports": 31708, "pctOfReports": 6.9 },
    { "reaction": "DIARRHOEA", "reports": 29649, "pctOfReports": 6.4 },
    { "reaction": "LACTIC ACIDOSIS", "reports": 20537, "pctOfReports": 4.5 }
  ],
  "drugRecallsTotal": 91,
  "classIRecalls": 1,
  "ongoingRecalls": 23,
  "hasBoxedWarning": true,
  "ndcProducts": 742,
  "signalScore": 70,
  "signalFlags": ["Death in 4% or more of reports", "Boxed warning on the label", "1 Class I recall(s)", "23 ongoing recall(s)"]
}
```

### Recall output example

```json
{
  "recallNumber": "D-0866-2026",
  "classification": "Class I",
  "classificationMeaning": "Reasonable chance of serious health problems or death",
  "status": "Ongoing",
  "recallingFirm": "VITRUVIAS THERAPEUTICS INC",
  "recallInitiationDate": "2026-08-21",
  "daysRecallLasted": 53,
  "reasonCategory": "Potency, dissolution or stability failure",
  "isNationwide": true
}
```

### How much does it cost to scrape openFDA?

You pay per result: $26 per 1,000 rows plus a tiny start fee. The free plan returns up to 10 rows per run. A safety profile is one row per drug, so profiles of 100 drugs cost a few dollars.

### Tips for better results

- Adverse event reports are not proof that a drug caused the event. They come from patients, doctors and companies, can be incomplete or repeated, and depend on how many people use the drug.
- A drug name matches the generic name, the brand name, the substance and the name written in the report. Reports that mention the drug in any role are counted, so a profile describes reports about the drug and not only cases where it was the main suspect.
- The signal score from 0 to 100 is a simple screen built from the shares of serious and fatal reports, the boxed warning, recalls and the trend. It points to drugs worth a closer look and is not a safety rating.
- Without a free FDA access code the FDA allows about 40 requests per minute and about 1,000 per day for each address, so a profile takes about half a minute. With a code, runs are about five times faster. You can get a code at open.fda.gov and paste it in the optional field.
- For a very large list of reports, use dates. The FDA returns at most 25,000 rows per query and the Actor splits long periods for you.
- Recall classes: Class I can cause serious harm or death, Class II can cause temporary harm, Class III is unlikely to cause harm.
- Label text can be long. The length limit field keeps each section to a size you choose.
- For a weekly watch, schedule the Actor with the recalls mode, ongoing status and the last seven days.

### Who uses openFDA data?

- **Pharmacovigilance and safety teams** monitor products and competitors.
- **Pharmacists and clinicians** check warnings and recalls.
- **Lawyers and consultants** research product history and regulatory actions.
- **Health tech and AI builders** feed safety data to apps and agents.
- **Journalists and analysts** report on recalls and safety trends.

### Automate and connect

Schedule the Actor every week and send new recalls to Slack, Google Sheets, Zapier, Make or n8n, or trigger a webhook when a run ends.

### FAQ

**Do I need an account or a login?**
No. The Actor works without any login. A free access code from the FDA is optional and speeds up large runs.

**Is the data medical advice?**
No. Do not use it to decide about treatment. Ask a doctor or pharmacist and read the official label.

**Why do counts differ from other websites?**
Sites count reports in different ways, for example with or without duplicates, with the drug in any role or only as suspect.

**Can I search by reaction?**
Yes. In the adverse events mode type a reaction term such as Pancreatitis, with or without a drug.

**How current is the data?**
The FDA updates each data set on its own schedule, and recent reports can arrive months after the event.

**Does it cover devices and food?**
Yes for recalls and device clearances. Adverse event reports and labels are for drugs.

### Legal note

This Actor collects information that is publicly visible on the website. The data is provided by the FDA and is not validated. Check the source site's terms and your local rules before using the data.

### Support

Missing a field or found a bug? Open an issue from the Actor page.

# Actor input Schema

## `maxItems` (type: `integer`):

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000.

## `mode` (type: `string`):

Safety profile returns one row per drug with report counts, outcomes, top reactions, recalls and label warnings. The other modes return one row per adverse event report, recall, label, product code listing, approval or device clearance.

## `drugNames` (type: `array`):

Generic or brand names, for example ibuprofen, Ozempic or metformin. In the device clearances mode they are searched in the device name.

## `searchTerms` (type: `array`):

Free words searched in the product description and reason for recalls, in the device name for clearances, and in the drug name for labels, directory and approvals.

## `reactions` (type: `array`):

Adverse events mode. Medical terms such as Nausea, Hepatotoxicity or Anaphylactic reaction.

## `countries` (type: `array`):

Adverse events mode. Two letter country codes, for example US, GB, DE.

## `companies` (type: `array`):

Recalling firm for recalls, manufacturer for labels, labeler for the directory, sponsor for approvals, applicant for device clearances.

## `productCodes` (type: `array`):

Device clearances mode. Three letter FDA product codes such as NAY or DQA.

## `recallCategory` (type: `string`):

Recalls mode. Which kind of product recalls to read.

## `classifications` (type: `array`):

Recalls mode. Class I is the most serious, Class III the least.

## `recallStatus` (type: `string`):

Recalls mode. Ongoing recalls are still open, terminated ones are closed.

## `states` (type: `array`):

Recalls and device clearances. Two letter US state codes of the firm, for example CA, TX.

## `suspectDrugOnly` (type: `boolean`):

Adverse events mode. Keep only reports where the drug you searched is listed as the suspect drug, not just a medicine the patient also took.

## `seriousOnly` (type: `boolean`):

Adverse events mode. Keep reports with a serious outcome.

## `outcomes` (type: `array`):

Adverse events mode. Keep reports with one of these outcomes.

## `patientSex` (type: `string`):

Adverse events mode.

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

First date, in the form 2025-01-31. Applies to the received date of reports, the report date of recalls, the label date and the decision date of clearances.

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

Last date, in the form 2026-09-30.

## `onlyWithBoxedWarning` (type: `boolean`):

Labels mode. Keep labels that have the strongest FDA warning box.

## `sectionMaxChars` (type: `integer`):

Labels mode. Maximum number of characters kept per label section.

## `openFdaApiKey` (type: `string`):

Free code from open.fda.gov. Without it the FDA allows 40 requests per minute and about 1,000 per day for each address, and runs are slower. With it runs are about five times faster.

## Actor input object example

```json
{
  "maxItems": 10,
  "mode": "profile",
  "drugNames": [
    "ibuprofen"
  ],
  "recallCategory": "drug",
  "recallStatus": "any",
  "suspectDrugOnly": false,
  "seriousOnly": false,
  "patientSex": "any",
  "onlyWithBoxedWarning": false,
  "sectionMaxChars": 1500
}
```

# Actor output Schema

## `overview` (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 = {
    "maxItems": 10,
    "drugNames": [
        "ibuprofen"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("parselab/openfda-drug-safety-scraper").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 = {
    "maxItems": 10,
    "drugNames": ["ibuprofen"],
}

# Run the Actor and wait for it to finish
run = client.actor("parselab/openfda-drug-safety-scraper").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 '{
  "maxItems": 10,
  "drugNames": [
    "ibuprofen"
  ]
}' |
apify call parselab/openfda-drug-safety-scraper --silent --output-dataset

```

## MCP server setup

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

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/XDUfSwegAQ3qCYOis/builds/KmShfr75EEx3jiaP6/openapi.json
