Openfda Scraper
Pricing
Pay per event
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
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
| Field | Type | Description |
|---|---|---|
reportId | string | FDA safety report identifier |
drugName | string | Primary drug name |
drugNames | string[] | All drugs in the report |
reactions | string[] | Reported adverse reactions (MedDRA terms) |
serious | boolean | Whether the event was classified as serious |
seriousOutcomes | string[] | Death, Hospitalization, Disability, Life-threatening, etc. |
receiveDate | string | Date the report was received (YYYYMMDD) |
country | string | Country where the event occurred |
patientAge | number | Patient age at event onset |
patientSex | string | Patient sex (Male/Female/Unknown) |
patientWeight | number | Patient weight in kg |
reporterType | string | Who reported: Physician, Pharmacist, Consumer, etc. |
companynumb | string | Company report number |
scrapedAt | string | ISO timestamp of extraction |
How much does it cost to scrape OpenFDA data?
| Event | Price |
|---|---|
| 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
- Go to OpenFDA Drug Events Scraper on Apify Store.
- Enter a drug name — brand name (e.g., "Tylenol") or generic name (e.g., "acetaminophen").
- Optionally enable the serious events filter to focus on hospitalizations, deaths, and disabilities.
- Set the maximum number of reports to extract (up to 1,000).
- Click Start and wait for the run to complete.
- Download your adverse event data as JSON, CSV, or Excel.
Input parameters
| Parameter | Type | Description | Default |
|---|---|---|---|
drugName | string | Brand or generic drug name | Required |
seriousOnly | boolean | Only return serious adverse events | false |
maxResults | integer | Maximum 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
- 🎯 Serious events filter — use
seriousOnly: trueto focus on hospitalization, death, and disability reports. - 💊 Drug name variations — try both brand and generic names (e.g., "Tylenol" vs "acetaminophen").
- 📋 Multiple drugs per report — many reports list several drugs. The
drugNamesarray shows all drugs the patient was taking. - 🏥 MedDRA terms — reactions use standardized MedDRA medical terminology.
- ⚠️ Report ≠ causation — adverse event reports indicate temporal association, not proven causation.
- 📅 Date format —
receiveDateuses YYYYMMDD format (e.g., "20240115"). - 🔄 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 ApifyClientclient = 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.
Is it legal to scrape OpenFDA data?
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.
Related scrapers
- ClinicalTrials Scraper — extract clinical trial data from ClinicalTrials.gov
- Open Food Facts Scraper — scrape food product nutrition data
- OpenAlex Scraper — extract academic paper metadata, citations, and author data
- ArXiv Scraper — scrape preprint papers from arXiv
- Crossref Scraper — extract scholarly article metadata via CrossRef
- NASA Images Scraper — search and extract NASA images with full metadata