ParseForge Scrapers

openFDA Drug Adverse Events Scraper

parseforge/openfda-drug-events-scraper

BusinessOtherEducation

Scrapes adverse event reports from the FDA's openFDA API. Filter by drug name, reaction term, date range, and seriousness. Returns each report as a flat row.

Run this scraper See the API call
Total users
2
Monthly active
1
Total runs
106
Bookmarked
0
Rating
Not rated yet
Last modified
9 days ago

Overview

ParseForge

openFDA Drug Adverse Events Scraper

Scrape adverse event reports for any drug from the FDA's openFDA API, up to a million per run. Each report includes the drug name, reaction terms, seriousness flags, and submission date. No API key required. Export to CSV, JSON, Excel, or XML.

The FDA's openFDA API returns drug adverse event data in nested JSON pages that are hard to flatten for analysis. This Actor queries the official drug event endpoint directly, lets you filter by drug name, reaction term, date range, and seriousness, and returns every matching report as a clean flat row. No API key, no registration, no pagination code to write.

Who uses it What they scrape openFDA for
Pharmacovigilance analysts Monitor adverse event trends for a specific drug over a date range.
Pharma market researchers Compare the safety profiles of competing drugs by reaction term.
Healthcare data journalists Pull serious adverse event reports for a drug to support an investigation.
Regulatory affairs teams Collect post-market safety data for a periodic benefit-risk evaluation report.

What it does

This Actor collects FDA adverse event reports from the openFDA API and returns each one as a flat row with drug name, reaction terms, seriousness flags, and submission date.

  • ๐Ÿ’Š Drug name filter: exact match on medicinal product name, e.g. ASPIRIN, METFORMIN, LIPITOR.
  • ๐Ÿค’ Reaction term filter: exact match on MedDRA-coded adverse reaction, e.g. NAUSEA, HEADACHE, DEATH.
  • ๐Ÿ“… Date range filter: limit reports by the date the FDA received them, in YYYYMMDD format.
  • โš ๏ธ Seriousness filter: return only reports flagged as serious (death, hospitalization, disability, life-threatening, or congenital anomaly).
  • ๐Ÿ“Š Flat row output: every nested report is flattened into a single row ready for CSV, JSON, Excel, or XML export.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

What you can do with openFDA data

๐Ÿ“ˆ Monitor post-market drug safety.

A pharmacovigilance team runs the Actor weekly for their drug, filtering by dateFrom to collect only new reports since the last run.

๐Ÿ”ฌ Compare adverse event profiles across drugs.

A market researcher pulls all serious reports for three competing drugs and pivots the reaction terms to see which has the fewest severe events.

๐Ÿ“ฐ Investigate a drug safety story.

A journalist searches for a specific reaction term linked to a drug, sets a date range around a regulatory action, and exports the flat file for analysis.

๐Ÿ“‹ Support a regulatory submission.

A regulatory affairs team collects all adverse events for their product over a two-year period to include in a periodic safety update report.

Why choose this scraper

What you get
No API key needed Queries the public openFDA endpoint directly with no registration or authentication.
Flat, analysis-ready rows Converts deeply nested FDA JSON into one row per report so you can start analyzing immediately.
Up to 1M reports per run Collect a single report or a million, controlled by the maxItems setting.
Seriousness filtering Isolate the reports that matter most for safety surveillance with one checkbox.

How it compares

This Actor focuses exclusively on adverse event reports with flat-row output, while the competitors below bundle adverse events with other FDA data types or add AI scoring.

Feature ParseForge Clinical Trials & FDA Pipeline Intelligence Scraper OpenFDA Drug & Adverse Events Scraper OpenFDA Drug Intelligence - Adverse Events + AI
Adverse event reports only (no other data types) Yes Not listed Not listed Not listed
Flat row output (no nested JSON) Yes Not listed Not listed Not listed
Seriousness filter (checkbox toggle) Yes Not listed Not listed Not listed
Drug name exact-match filter Yes Not listed Not listed Not listed
Reaction term (MedDRA) filter Yes Not listed Not listed Not listed
Date range filter (received date) Yes Not listed Not listed Not listed
Up to 1,000,000 reports per run Yes Not listed Not listed Not listed

Configure the run

Drive the Actor with a drug name, reaction term, date range, and a seriousness toggle, alone or together, and filters run as each report is read so only matches reach your dataset. The Input tab lists every parameter.

A first run with the defaults:

{
  "maxItems": 10
}

A larger pull:

{
  "maxItems": 200
}

Pricing

Pay-per-result: $0.024 per result collected. You pay only for the results written to your dataset.

Results collected Approximate cost
100 results $2.40
1,000 results $24.00
10,000 results $240.00

New Apify accounts start with $5 in free credit.

Free users

Free-plan runs return up to 10 results as a preview. Upgrade your Apify plan to collect up to 1,000,000 results per run.

Run it

  1. Create a free Apify account with $5 in credit.
  2. Open the openFDA Drug Adverse Events Scraper.
  3. Set your inputs and any filters, then click Start.
  4. Export the results as CSV, Excel, JSON, or XML from the Dataset tab.

Run it programmatically through the Apify API (run-sync-get-dataset-items) or the ApifyClient for JavaScript and Python.

Use with AI agents (MCP)

Give an AI agent live access to openFDA through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/openfda-drug-events-scraper"

Then prompt it in plain language to run the scraper and read back the results.

Troubleshooting

Why am I getting no results?

Check that your drug name or reaction term is an exact match. Try a broader search first, e.g. remove the reaction term filter and use only the drug name. Also verify your date range covers a period when reports were received.

Why does the Actor return fewer results than my maxItems setting?

The Actor returns only the number of reports that match your filters. If fewer reports exist in the openFDA database for your criteria, you will receive fewer than maxItems. Try broadening your filters.

Why are some fields empty in my output?

Not every adverse event report contains every data field. The FDA's FAERS data is submitted by reporters with varying levels of completeness. Empty fields reflect missing data in the original report.

Why did my run fail with an API error?

The openFDA API may occasionally return errors under heavy load. The Actor includes retry logic, but if the error persists, wait a few minutes and retry the run. Check that your date format is exactly YYYYMMDD.

How do I search for a drug with a brand name versus a generic name?

The openFDA API stores the medicinal product name as reported. Try both the brand name (e.g. LIPITOR) and the generic name (e.g. ATORVASTATIN) in separate runs to capture all relevant reports.

FAQ

Question Answer
Do I need an API key to use this Actor? No. The Actor queries the public openFDA API endpoint, which does not require an API key or registration.
What is the maximum number of adverse event reports I can collect? You can set maxItems up to 1,000,000 reports per run. The openFDA API itself limits each query to 25,000 records, and the Actor handles pagination automatically.
How do I filter by a specific drug? Enter the exact medicinal product name in the Drug Name field, e.g. ASPIRIN or LIPITOR. The filter uses an exact match on the openFDA patient.drug.medicinalproduct field.
What reaction terms can I search for? Use MedDRA-coded terms like NAUSEA, HEADACHE, RASH, or DEATH. The filter performs an exact match on the patient.reaction.reactionmeddrapt field.
How do I get only serious adverse events? Check the 'Serious Reports Only' box. This limits results to reports where serious is '1', which includes death, hospitalization, disability, life-threatening events, and congenital anomalies.
What date format should I use for the date range? Use YYYYMMDD format, e.g. 20200101 for January 1, 2020. The filter applies to the date the FDA received the report.
Can I combine multiple filters in one run? Yes. You can combine drug name, reaction term, date range, and the seriousness toggle in a single run. All filters are applied together, and only reports matching every condition are returned.
What export formats are supported? You can export the results to CSV, JSON, Excel, or XML directly from the Apify dataset.
Does this Actor cover drug labels or recalls? No. This Actor focuses on adverse event reports from the openFDA drug event endpoint. For labels, recalls, or other FDA data, consider a broader FDA intelligence Actor.
Is the data from an official source? Yes. All data comes directly from the FDA's openFDA API, which provides the FDA Adverse Event Reporting System (FAERS) data.

Related actors

Browse the full ParseForge collection for more scrapers.

๐Ÿ†˜ Need help? Email parseforge@protonmail.com with your run ID, your input, and what you expected.

โš ๏ธ Disclaimer. This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by U.S. Food and Drug Administration. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

Input

FieldTypeWhat it doesDefault
maxItems integer How many drug events to collect per run. 10
drugName string Medicinal product name (exact match). Examples: ASPIRIN, METFORMIN, LIPITOR. not set
reactionTerm string Adverse reaction term, MedDRA-coded (exact match). Examples: NAUSEA, HEADACHE, RASH, DEATH. not set
dateFrom string Lower bound on the report's received date. Format: YYYYMMDD. Example: 20200101. not set
dateTo string Upper bound on the report's received date. Format: YYYYMMDD. Example: 20231231. not set
seriousOnly boolean Limit to reports flagged as serious (death, hospitalization, disability, life-threatening, congenital anomaly, or other serious medical event). false

Pricing

from $18.00 per 1,000 results

Charged forWhat it isPrice each
Result Item Charged once per result collected. $0.018 to $0.024

Tiered: the lower figure is the price on a higher Apify plan. Billing and the free credit live on Apify.

API

One POST returns the dataset directly. Same shape for every scraper in the library, so swapping the slug is the only change.

POST ยท run and get results
curl -X POST "https://api.apify.com/v2/acts/parseforge~openfda-drug-events-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "helloWorld": 123
  }'

Examples

Input that runs as-is.

input.json
{
  "helloWorld": 123
}

Reviews

No reviews yet. Be the first.

Issues

We build and maintain this scraper, so a problem with it comes to us. Report it on the Apify listing and the thread stays attached to the scraper where the next person can find it: open an issue.

Broken and urgent, or you would rather not post in public? Write to parseforge@protonmail.com and it reaches the people who wrote it.

Related scrapers

Run openFDA Drug Adverse Events Scraper on Apify All scrapers