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

3

Total users

1

Monthly active users

12 hours ago

Last modified

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.

Who is OpenFDA Drug Events Scraper for?

  • 💊 Pharmacovigilance teams monitoring drug safety signals across portfolios
  • 🔬 Pharmaceutical researchers analyzing side effect profiles and drug interactions
  • 🏥 Clinical safety officers tracking adverse events for regulatory compliance
  • 📊 Health data analysts building dashboards on drug safety trends
  • 🎓 Academic researchers studying epidemiology and post-market drug safety
  • ⚖️ Regulatory consultants preparing FDA safety assessments
  • 📰 Health journalists investigating drug safety concerns

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

Data extraction 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 much does it cost to scrape OpenFDA data?

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

How to scrape FDA adverse event reports

  1. Go to OpenFDA Drug Events Scraper on Apify Store.
  2. Enter a drug name — brand name (e.g., "Tylenol") or generic name (e.g., "acetaminophen").
  3. Optionally enable the serious events filter to focus on hospitalizations, deaths, and disabilities.
  4. Set the maximum number of reports to extract (up to 1,000).
  5. Click Start and wait for the run to complete.
  6. Download your adverse event data as JSON, CSV, or Excel.

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"
}

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.

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

How to use OpenFDA Scraper with the API

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(', ')}`);
});

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}")

cURL

curl "https://api.apify.com/v2/acts/automation-lab~openfda-scraper/runs" \
-X POST \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"drugName": "aspirin", "seriousOnly": true, "maxResults": 50}'

Use with AI agents via MCP

OpenFDA Drug Events Scraper is available as a tool for AI assistants via the Model Context Protocol (MCP).

Setup for Claude Code

$claude mcp add --transport http apify "https://mcp.apify.com?tools=automation-lab/openfda-scraper"

Setup for Claude Desktop, Cursor, or VS Code

{
"mcpServers": {
"apify": {
"url": "https://mcp.apify.com?tools=automation-lab/openfda-scraper"
}
}
}

Example prompts

  • "Search FDA adverse event reports for aspirin"
  • "Get serious adverse events for ibuprofen with hospitalizations"
  • "Find drug safety reports from OpenFDA for acetaminophen"

Learn more in the Apify MCP documentation.

The OpenFDA API provides public domain data published by the U.S. Food and Drug Administration. All FAERS data is freely available under the openFDA Terms of Service. The data is not copyrighted and can be used for any purpose including commercial applications.

This scraper accesses only the official public API — no scraping of protected content, no authentication bypass, and no rate limit violations.

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.

Q: My drug name returns 0 results — what should I try? A: Try both brand and generic names (e.g., "Tylenol" vs "acetaminophen"). Some drugs are filed under their active ingredient rather than the brand name. Check the exact spelling used in FDA records.

Q: Patient age or weight is null in many reports — is this expected? A: Yes. FAERS reports are voluntarily submitted and often have incomplete demographic data. The patientAge, patientWeight, and patientSex fields depend on what the reporter provided.