Openfda Scraper avatar

Openfda Scraper

Pricing

Pay per event

Go to Apify Store
Openfda Scraper

Openfda Scraper

Extract FDA drug adverse event reports by drug name. Get reactions, patient outcomes, demographics, and report details. Filter by serious events only.

Pricing

Pay per event

Rating

0.0

(0)

Developer

Stas Persiianenko

Stas Persiianenko

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Categories

Share

OpenFDA Drug Events Scraper

Extract FDA drug adverse event reports from the OpenFDA database. Search by drug name and get reactions, outcomes, patient demographics, reporter types, and seriousness indicators.

What does OpenFDA Drug Events Scraper do?

OpenFDA Drug Events Scraper searches the FDA Adverse Event Reporting System (FAERS) database and extracts structured adverse event reports. For each drug, it returns the reported reactions, seriousness level, patient age/sex, reporter type (physician, pharmacist, consumer), and outcome details.

Filter for serious events only (hospitalization, death, disability) to focus on the most significant reports.

Why use FDA adverse event data?

The FDA FAERS database contains millions of adverse event reports dating back to 2004. Use cases include:

  • Pharmacovigilance — monitor drug safety signals and adverse reaction patterns
  • Drug research — analyze side effect profiles for pharmaceutical research
  • Clinical analysis — study adverse event demographics and outcomes
  • Regulatory intelligence — track FDA safety reports for compliance and risk management
  • Academic research — build datasets for epidemiology and drug safety studies
  • Healthcare analytics — evaluate drug safety for formulary decisions

How much does it cost?

EventPrice
Run started$0.001
Report extracted$0.001 per report

Example costs:

  • 50 adverse events for aspirin: ~$0.051
  • 100 serious events for ibuprofen: ~$0.101
  • 500 reports for a new drug: ~$0.501

Platform costs are minimal. The OpenFDA API is free (40 requests/minute without key).

Input parameters

ParameterTypeDescriptionDefault
drugNamestringBrand or generic drug nameRequired
seriousOnlybooleanOnly return serious adverse eventsfalse
maxResultsintegerMaximum reports to extract (1-1000)100

Input example

{
"drugName": "aspirin",
"seriousOnly": true,
"maxResults": 50
}

Output example

Each adverse event report is returned as a JSON object:

{
"reportId": "10003349",
"drugName": "MORPHINE SULFATE",
"drugNames": ["MORPHINE SULFATE", "ASPIRIN", "LISINOPRIL"],
"reactions": ["Cerebrovascular accident", "Blood pressure increased", "Pain"],
"serious": true,
"seriousOutcomes": ["Hospitalization", "Other serious"],
"receiveDate": "20100101",
"country": "US",
"patientAge": 72,
"patientSex": "Female",
"patientWeight": 65.5,
"reporterType": "Physician",
"companynumb": "PHEH2009US00001",
"scrapedAt": "2026-03-03T05:10:00.000Z"
}

Output fields

FieldTypeDescription
reportIdstringFDA safety report identifier
drugNamestringPrimary drug name
drugNamesstring[]All drugs in the report
reactionsstring[]Reported adverse reactions (MedDRA terms)
seriousbooleanWhether the event was classified as serious
seriousOutcomesstring[]Death, Hospitalization, Disability, Life-threatening, etc.
receiveDatestringDate the report was received (YYYYMMDD)
countrystringCountry where the event occurred
patientAgenumberPatient age at event onset
patientSexstringPatient sex (Male/Female/Unknown)
patientWeightnumberPatient weight in kg
reporterTypestringWho reported: Physician, Pharmacist, Consumer, etc.
companynumbstringCompany report number
scrapedAtstringISO timestamp of extraction

How to use the OpenFDA API

Python

from apify_client import ApifyClient
client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("automation-lab/openfda-scraper").call(run_input={
"drugName": "aspirin",
"seriousOnly": True,
"maxResults": 100,
})
for event in client.dataset(run["defaultDatasetId"]).iterate_items():
reactions = ", ".join(event["reactions"][:3])
outcomes = ", ".join(event["seriousOutcomes"])
print(f"Report {event['reportId']}: {reactions}")
print(f" Patient: age={event['patientAge']} sex={event['patientSex']}")
print(f" Outcomes: {outcomes}")

Node.js

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('automation-lab/openfda-scraper').call({
drugName: 'aspirin',
seriousOnly: true,
maxResults: 100,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach(event => {
console.log(`${event.reportId}: ${event.reactions.join(', ')}`);
});

Integrations

Connect OpenFDA Scraper to apps:

  • Google Sheets — export adverse event data for analysis
  • Slack — alerts for new serious adverse events
  • Zapier / Make — automate pharmacovigilance workflows
  • Webhook — pipe data to your safety monitoring system

Tips and best practices

  1. Serious events filter — use seriousOnly: true to focus on hospitalization, death, and disability reports.
  2. Drug name variations — try both brand and generic names (e.g., "Tylenol" vs "acetaminophen").
  3. Multiple drugs per report — many reports list several drugs. The drugNames array shows all drugs the patient was taking.
  4. MedDRA terms — reactions use standardized MedDRA medical terminology.
  5. Report ≠ causation — adverse event reports indicate temporal association, not proven causation.
  6. Date formatreceiveDate uses YYYYMMDD format (e.g., "20240115").
  7. API limits — free tier: 40 requests/minute, max 5000 records per query via skip pagination.

FAQ

Q: How many reports are in the database? A: FAERS contains over 20 million adverse event reports dating back to 2004, growing by ~2 million per year.

Q: Does it need an API key? A: No. The OpenFDA API is free without authentication (40 requests/minute). An API key raises the limit to 240/minute.

Q: Can I search by reaction instead of drug? A: This scraper searches by drug name. The OpenFDA API does support reaction-based queries for advanced use cases.

Q: Is this data the same as clinical trial data? A: No. FAERS contains post-market surveillance reports — voluntary reports submitted after a drug is on the market.