# openFDA Drug Adverse Events Scraper (`parseforge/openfda-drug-events-scraper`) Actor

Export FAERS drug adverse-event reports from openFDA. Search 20M+ post-market safety records by drug name, reaction term (MedDRA), and received-date range. Pull report ID, patient demographics, drugs, reactions, outcomes, and source country.

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

## Pricing

from $18.00 / 1,000 result items

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

![ParseForge Banner](https://github.com/ParseForge/apify-assets/blob/ad35ccc13ddd068b9d6cba33f323962e39aed5b2/banner.jpg?raw=true)

## 💊 openFDA Drug Adverse Events Scraper

> 🚀 **Export the official FDA drug-safety dataset in seconds.** Pull **20,000,000+ post-market adverse-event reports** filtered by drug name, reaction term, date range, or seriousness. No login, no daily quota juggling, no schema guesswork.

> 🕒 **Last updated:** 2026-05-22 · **📊 26 fields** per record · **💊 20M+ reports** · **🌍 200+ reporter countries** · **🧪 every FAERS field**

The **openFDA Drug Adverse Events Scraper** exports FAERS (FDA Adverse Event Reporting System) post-market safety reports and returns **26 fields per record**, including report identifiers, patient demographics, full drug list, MedDRA reaction terms, outcomes, seriousness flags, and reporter geography. FAERS is the foundation of U.S. pharmacovigilance and is referenced by regulators, manufacturers, and safety researchers worldwide.

The catalog covers **every FAERS submission published by the FDA, from the early 2000s to last week**. This Actor turns the live safety feed into a downloadable dataset as CSV, Excel, JSON, or XML in under five minutes. Filtering happens at source, so you skip the paging and field-name spelunking entirely.

| 🎯 Target Audience | 💡 Primary Use Cases |
|---|---|
| Pharmacovigilance teams, drug-safety researchers, regulatory affairs, medical-affairs analysts, academic epidemiologists, health journalists | Signal detection, post-market surveillance, comparator-drug benchmarks, literature reviews, dashboards for drug safety committees, investigative reporting on adverse events |

---

### 📋 What the openFDA Drug Adverse Events Scraper does

Four filtering workflows in a single run:

- 💊 **Drug-name filter.** Restrict to one medicinal product, e.g. ASPIRIN, METFORMIN, or LIPITOR.
- 🤕 **Reaction-term filter.** Limit to one MedDRA term, e.g. NAUSEA, RASH, or DEATH.
- 📅 **Date-range filter.** Bound the report received date with `YYYYMMDD` from/to values.
- ⚠️ **Serious-only filter.** Return only reports flagged for death, hospitalization, disability, life-threatening, congenital anomaly, or other serious outcomes.

Each record includes the safety report ID and version, three FAERS date fields, six seriousness flags, patient sex and age, the structured drugs array with indication and dose, MedDRA reactions, patient outcomes, reporter country, qualification, and report-source metadata.

> 💡 **Why it matters:** drug safety signals hide in the long tail. Building a parser yourself means handling 25+ years of submission format drift, MedDRA upgrades, and shifting field names. This Actor skips that work and keeps the dataset fresh on every run.

---

### 🎬 Full Demo

_🚧 Coming soon: a 3-minute walkthrough showing how to go from sign-up to a downloaded drug-safety feed._

---

### ⚙️ Input

<table>
<thead>
<tr><th>Input</th><th>Type</th><th>Default</th><th>Behavior</th></tr>
</thead>
<tbody>
<tr><td><code>maxItems</code></td><td>integer</td><td><code>10</code></td><td>Records to return. Free plan caps at 10, paid plan at 1,000,000.</td></tr>
<tr><td><code>drugName</code></td><td>string</td><td><code>""</code></td><td>Medicinal product name, exact match. Empty = any drug.</td></tr>
<tr><td><code>reactionTerm</code></td><td>string</td><td><code>""</code></td><td>MedDRA-coded reaction term, exact match.</td></tr>
<tr><td><code>dateFrom</code></td><td>string</td><td><code>""</code></td><td>Lower bound on received date, format <code>YYYYMMDD</code>.</td></tr>
<tr><td><code>dateTo</code></td><td>string</td><td><code>""</code></td><td>Upper bound on received date, format <code>YYYYMMDD</code>.</td></tr>
<tr><td><code>seriousOnly</code></td><td>boolean</td><td><code>false</code></td><td>When <code>true</code>, only reports flagged as serious are returned.</td></tr>
</tbody>
</table>

**Example: 500 serious reports for METFORMIN in 2024.**

```json
{
    "maxItems": 500,
    "drugName": "METFORMIN",
    "dateFrom": "20240101",
    "dateTo": "20241231",
    "seriousOnly": true
}
````

**Example: every NAUSEA report for ASPIRIN over a five-year window.**

```json
{
    "maxItems": 1000,
    "drugName": "ASPIRIN",
    "reactionTerm": "NAUSEA",
    "dateFrom": "20200101",
    "dateTo": "20241231"
}
```

> ⚠️ **Good to Know:** FAERS submissions are voluntary. A report does not establish causation, only that an event was observed and submitted. Treat the dataset as a signal source, not a clinical conclusion.

***

### 📊 Output

Each report record contains **26 fields**. Download the dataset as CSV, Excel, JSON, or XML.

#### 🧾 Schema

| Field | Type | Example |
|---|---|---|
| 🆔 `safetyReportId` | string | `"18234567-1"` |
| 🔢 `safetyReportVersion` | string | null | `"3"` |
| 📅 `receiveDate` | string | `"20240312"` |
| 📅 `receiptDate` | string | `"20240310"` |
| 📅 `transmissionDate` | string | `"20240314"` |
| ⚠️ `serious` | string | `"1"` |
| ☠️ `seriousnessDeath` | string | null | `"1"` |
| ♿ `seriousnessDisabling` | string | null | `null` |
| ❓ `seriousnessOther` | string | null | `"1"` |
| 🌍 `reporterCountry` | string | null | `"US"` |
| 👤 `reporterQualification` | string | null | `"1"` |
| 🌐 `occurCountry` | string | null | `"US"` |
| 🌐 `primarySourceCountry` | string | null | `"US"` |
| 📋 `reportType` | string | null | `"1"` |
| ⏱️ `fulfillExpediteCriteria` | string | null | `"1"` |
| 👤 `patientSex` | string | null | `"2"` |
| 🎂 `patientAge` | number | null | `64` |
| 🕐 `patientAgeUnit` | string | null | `"801"` |
| 💊 `drugs` | array | `[{"medicinalProduct": "METFORMIN", "drugIndication": "TYPE 2 DIABETES", ...}]` |
| 🤕 `reactions` | array | `[{"reactionMeddrapt": "NAUSEA", "reactionOutcome": "1"}]` |
| 📊 `outcomes` | array | `["1", "6"]` |
| 📤 `sender` | string | null | `"FDA-PUBLIC USE"` |
| 📥 `receiver` | string | null | `"FDA"` |
| 🏢 `companyNumber` | string | null | `"US-PFIZER INC-2024009876"` |
| 🕒 `scrapedAt` | ISO 8601 | `"2026-05-22T00:00:00.000Z"` |
| ⚠️ `error` | string | null | `null` |

#### 📦 Sample records

<details>
<summary><strong>💊 Serious METFORMIN report</strong></summary>

```json
{
    "safetyReportId": "18234567-1",
    "safetyReportVersion": "3",
    "receiveDate": "20240312",
    "serious": "1",
    "seriousnessDeath": null,
    "seriousnessOther": "1",
    "reporterCountry": "US",
    "patientSex": "2",
    "patientAge": 64,
    "patientAgeUnit": "801",
    "drugs": [{"medicinalProduct": "METFORMIN", "drugIndication": "TYPE 2 DIABETES"}],
    "reactions": [{"reactionMeddrapt": "NAUSEA"}, {"reactionMeddrapt": "DIARRHOEA"}],
    "outcomes": ["6"],
    "scrapedAt": "2026-05-22T00:00:00.000Z"
}
```

</details>

<details>
<summary><strong>☠️ Fatal outcome report</strong></summary>

```json
{
    "safetyReportId": "19345678-2",
    "receiveDate": "20240515",
    "serious": "1",
    "seriousnessDeath": "1",
    "reporterCountry": "DE",
    "patientSex": "1",
    "patientAge": 78,
    "patientAgeUnit": "801",
    "drugs": [{"medicinalProduct": "WARFARIN", "drugIndication": "ATRIAL FIBRILLATION"}],
    "reactions": [{"reactionMeddrapt": "HAEMORRHAGE INTRACRANIAL"}],
    "outcomes": ["5"],
    "scrapedAt": "2026-05-22T00:00:00.000Z"
}
```

</details>

<details>
<summary><strong>🩹 Non-serious skin reaction</strong></summary>

```json
{
    "safetyReportId": "20456789-1",
    "receiveDate": "20240618",
    "serious": "2",
    "reporterCountry": "GB",
    "patientSex": "2",
    "patientAge": 32,
    "patientAgeUnit": "801",
    "drugs": [{"medicinalProduct": "AMOXICILLIN", "drugIndication": "BACTERIAL INFECTION"}],
    "reactions": [{"reactionMeddrapt": "RASH"}, {"reactionMeddrapt": "PRURITUS"}],
    "outcomes": ["6"],
    "scrapedAt": "2026-05-22T00:00:00.000Z"
}
```

</details>

***

### ✨ Why choose this Actor

| | Capability |
|---|---|
| 💊 | **Full FAERS coverage.** 20M+ post-market adverse-event reports across decades of submissions. |
| 🎯 | **Multi-dimensional filtering.** Drug, reaction, date range, and seriousness compose freely in a single run. |
| 🌍 | **Global reporter geography.** Country of reporter, occurrence, and primary source on every record. |
| 🧪 | **MedDRA-coded reactions.** Standardized reaction terms ready for cross-source joins. |
| ⚡ | **Fast.** 10 reports in under 5 seconds, 10,000 in under five minutes. |
| 🔁 | **Always fresh.** Every run pulls live FAERS data published by the FDA. |
| 🚫 | **No authentication.** Works with the public openFDA dataset. No token or quota required from you. |

> 📊 Adverse-event surveillance is the foundation of every modern pharmacovigilance program, drug-safety dashboard, and regulatory filing.

***

### 📈 How it compares to alternatives

| Approach | Cost | Coverage | Refresh | Filters | Setup |
|---|---|---|---|---|---|
| **⭐ openFDA Drug Adverse Events Scraper** *(this Actor)* | $5 free credit, then pay-per-use | **20M+** reports worldwide | **Live per run** | drug, reaction, date, serious | ⚡ 2 min |
| Commercial pharmacovigilance suites | $50k+/year per seat | Global, plus signal scoring | Daily | Many | ⏳ Weeks |
| Manual FAERS quarterly downloads | Free | Bulk only, lagging | Quarterly | Local parsing | 🐢 Days |
| Building your own ingestion | Engineering cost | Brittle | Breaks on schema drift | Custom | 🕒 Weeks |

Pick this Actor when you want clean structured FAERS records, server-side filters, and no pipeline maintenance.

***

### 🚀 How to use

1. 📝 **Sign up.** [Create a free account with $5 credit](https://console.apify.com/sign-up?fpr=vmoqkp) (takes 2 minutes).
2. 🌐 **Open the Actor.** Go to the openFDA Drug Adverse Events Scraper page on the Apify Store.
3. 🎯 **Set input.** Pick a drug name, reaction term, or date range, and set `maxItems`.
4. 🚀 **Run it.** Click **Start** and let the Actor collect your data.
5. 📥 **Download.** Grab your results in the **Dataset** tab as CSV, Excel, JSON, or XML.

> ⏱️ Total time from signup to downloaded dataset: **3-5 minutes.** No coding required.

***

### 💼 Business use cases

<table>
<tr>
<td width="50%" valign="top">

#### 🛡️ Pharmacovigilance teams

- Quarterly safety updates per active product
- Comparator-drug adverse-event benchmarks
- Signal detection across reaction terms
- Geographic clustering of serious reports

</td>
<td width="50%" valign="top">

#### 🏥 Medical affairs and KOL teams

- Brief KOLs on the latest event profile of a drug
- Build dashboards for advisory boards
- Cross-reference reactions with published literature
- Track reporting trends by patient demographic

</td>
</tr>
<tr>
<td width="50%" valign="top">

#### ⚖️ Regulatory affairs

- Periodic Safety Update Reports (PSURs)
- Risk-management plan evidence
- Post-marketing commitment reporting
- Inspection-ready trail of source records

</td>
<td width="50%" valign="top">

#### 📰 Health journalism and watchdogs

- Reproducible investigations into post-market signals
- Compare manufacturer reporting volumes
- Public-interest reporting on drug-class trends
- Visualizations of serious-event geography

</td>
</tr>
</table>

***

### 🔌 Automating openFDA Drug Adverse Events Scraper

Control the scraper programmatically for scheduled runs and pipeline integrations:

- 🟢 **Node.js.** Install the `apify-client` NPM package.
- 🐍 **Python.** Use the `apify-client` PyPI package.
- 📚 See the [Apify API documentation](https://docs.apify.com/api/v2) for full details.

The [Apify Schedules feature](https://docs.apify.com/platform/schedules) lets you trigger this Actor on any cron interval. Daily or weekly refreshes keep downstream safety dashboards in sync automatically.

***

### 🌟 Beyond business use cases

Data like this powers more than commercial workflows. The same structured records support research, education, civic projects, and personal initiatives.

<table>
<tr>
<td width="50%">

#### 🎓 Research and academia

- Epidemiology coursework on post-market surveillance
- Replication studies citing reproducible pulls
- Master's and PhD theses on adverse-event mining
- Cross-source studies linking FAERS to literature

</td>
<td width="50%">

#### 🎨 Personal and creative

- Patient-advocacy newsletters covering recent reports
- Personal medication tracking for caregivers
- Open data visualizations of long-term trends
- Blog posts on specific drug-class safety histories

</td>
</tr>
<tr>
<td width="50%">

#### 🤝 Non-profit and civic

- Patient-safety nonprofits monitoring evolving signals
- Civic transparency on drug recalls
- Investigative journalism on under-reported reactions
- Public-health agencies tracking regional signals

</td>
<td width="50%">

#### 🧪 Experimentation

- Train adverse-event classifiers on labeled reactions
- Build LLM agents that summarize safety profiles
- Prototype anomaly detection on time-series reports
- Validate medical-NLP pipelines against real reports

</td>
</tr>
</table>

***

### 🤖 Ask an AI assistant about this scraper

Open a ready-to-send prompt about this ParseForge actor in the AI of your choice:

- 💬 [**ChatGPT**](https://chat.openai.com/?q=How%20do%20I%20use%20the%20openFDA%20Drug%20Adverse%20Events%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🧠 [**Claude**](https://claude.ai/new?q=How%20do%20I%20use%20the%20openFDA%20Drug%20Adverse%20Events%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🔍 [**Perplexity**](https://perplexity.ai/search?q=How%20do%20I%20use%20the%20openFDA%20Drug%20Adverse%20Events%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🅒 [**Copilot**](https://copilot.microsoft.com/?q=How%20do%20I%20use%20the%20openFDA%20Drug%20Adverse%20Events%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)

***

### ❓ Frequently Asked Questions

#### 🧩 How does it work?

Set a drug name, reaction term, or date range in the input form, click Start, and the Actor queries the official FDA safety dataset and emits a clean structured record per safety report. No browser automation, no captchas, no setup.

#### 📏 How accurate is the data?

The dataset is sourced directly from the FDA. Submission quality varies because reports come from clinicians, patients, and manufacturers around the world. Treat the records as raw signals, not adjudicated outcomes.

#### 🔁 How often is the dataset refreshed?

The FDA refreshes the public dataset on an ongoing basis. Every run of this Actor fetches the latest data, so your output reflects current records as of run time.

#### 📅 What date range is covered?

Records reach back over two decades. Use the `dateFrom` and `dateTo` inputs to scope any window down to the day.

#### ⚠️ What does "serious" mean here?

The FDA flags a report as serious when it involves death, life-threatening event, hospitalization, disability, congenital anomaly, or other clinically significant outcome.

#### ⏰ Can I schedule regular runs?

Yes. Use Apify Schedules to run this Actor on any cron interval (daily, weekly, monthly) and keep a downstream pharmacovigilance dashboard in sync.

#### ⚖️ Is this data legal to use?

Yes. FAERS is published by the U.S. FDA under a permissive open-data policy. Review downstream regulatory requirements for your specific use case.

#### 💼 Can I use this data commercially?

Yes. Open FDA safety records are publicly available for commercial reuse. You are responsible for any downstream regulatory or labeling obligations.

#### 💳 Do I need a paid Apify plan to use this Actor?

No. The free Apify plan is enough for testing and small runs (10 records per run). A paid plan lifts the limit and gives you access to scheduling, higher concurrency, and larger datasets.

#### 🔁 What happens if a run fails or gets interrupted?

Apify automatically retries transient errors. If a run still fails, you can inspect the log in the Runs tab, fix the input, and re-run. Partial datasets from failed runs are preserved so you never lose progress.

#### 🆘 What if I need help?

Our support team is here to help. Contact us through the Apify platform or use the Tally form linked below.

***

### 🔌 Integrate with any app

openFDA Drug Adverse Events Scraper connects to any cloud service via [Apify integrations](https://apify.com/integrations):

- [**Make**](https://docs.apify.com/platform/integrations/make) - Automate multi-step workflows
- [**Zapier**](https://docs.apify.com/platform/integrations/zapier) - Connect with 5,000+ apps
- [**Slack**](https://docs.apify.com/platform/integrations/slack) - Get safety alerts in your channels
- [**Airbyte**](https://docs.apify.com/platform/integrations/airbyte) - Pipe safety data into your warehouse
- [**GitHub**](https://docs.apify.com/platform/integrations/github) - Trigger runs from commits and releases
- [**Google Drive**](https://docs.apify.com/platform/integrations/drive) - Export datasets straight to Sheets

You can also use webhooks to trigger downstream actions when a run finishes. Push fresh adverse-event data into your pharmacovigilance system, or alert your team in Slack on new serious reports.

***

### 🔗 Recommended Actors

- [**💊 openFDA Drug NDC Directory Scraper**](https://apify.com/parseforge/openfda-drug-ndc-scraper) - Marketed drug products with NDC, ingredients, and labelers
- [**📋 Drugs@FDA Approvals Scraper**](https://apify.com/parseforge/openfda-drugsfda-scraper) - NDA, ANDA, and BLA approval records
- [**🏥 openFDA Medical Device Events Scraper**](https://apify.com/parseforge/openfda-device-event-scraper) - MAUDE post-market device adverse events
- [**🧪 ClinicalTrials.gov Scraper**](https://apify.com/parseforge/clinicaltrials-gov-scraper) - Clinical trial registrations and results
- [**🩺 Florida MQA License Scraper**](https://apify.com/parseforge/florida-mqa-scraper) - U.S. healthcare practitioner license records

> 💡 **Pro Tip:** browse the complete [ParseForge collection](https://apify.com/parseforge) for more healthcare and life-sciences scrapers.

***

**🆘 Need Help?** [**Open our contact form**](https://tally.so/r/BzdKgA) to request a new scraper, propose a custom data project, or report an issue.

***

> **⚠️ Disclaimer:** this Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by the U.S. Food and Drug Administration. All trademarks mentioned are the property of their respective owners. Only publicly available openFDA records are collected. Safety reports do not establish causation and should not be interpreted as clinical conclusions.

# Actor input Schema

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

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

## `drugName` (type: `string`):

Medicinal product name (exact match). Examples: ASPIRIN, METFORMIN, LIPITOR.

## `reactionTerm` (type: `string`):

Adverse reaction term, MedDRA-coded (exact match). Examples: NAUSEA, HEADACHE, RASH, DEATH.

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

Lower bound on the report's received date. Format: YYYYMMDD. Example: 20200101.

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

Upper bound on the report's received date. Format: YYYYMMDD. Example: 20231231.

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

Limit to reports flagged as serious (death, hospitalization, disability, life-threatening, congenital anomaly, or other serious medical event).

## Actor input object example

```json
{
  "maxItems": 10,
  "seriousOnly": false
}
```

# 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
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/openfda-drug-events-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 }

# Run the Actor and wait for it to finish
run = client.actor("parseforge/openfda-drug-events-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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
}' |
apify call parseforge/openfda-drug-events-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=parseforge/openfda-drug-events-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "openFDA Drug Adverse Events Scraper",
        "description": "Export FAERS drug adverse-event reports from openFDA. Search 20M+ post-market safety records by drug name, reaction term (MedDRA), and received-date range. Pull report ID, patient demographics, drugs, reactions, outcomes, and source country.",
        "version": "1.0",
        "x-build-id": "jGyAkb3jDzwKJXZyt"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/parseforge~openfda-drug-events-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-parseforge-openfda-drug-events-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/parseforge~openfda-drug-events-scraper/runs": {
            "post": {
                "operationId": "runs-sync-parseforge-openfda-drug-events-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/parseforge~openfda-drug-events-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-parseforge-openfda-drug-events-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 1,
                        "maximum": 1000000,
                        "type": "integer",
                        "description": "Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000"
                    },
                    "drugName": {
                        "title": "Drug Name",
                        "type": "string",
                        "description": "Medicinal product name (exact match). Examples: ASPIRIN, METFORMIN, LIPITOR."
                    },
                    "reactionTerm": {
                        "title": "Reaction Term (MedDRA)",
                        "type": "string",
                        "description": "Adverse reaction term, MedDRA-coded (exact match). Examples: NAUSEA, HEADACHE, RASH, DEATH."
                    },
                    "dateFrom": {
                        "title": "Received Date From (YYYYMMDD)",
                        "pattern": "^[0-9]{8}$",
                        "type": "string",
                        "description": "Lower bound on the report's received date. Format: YYYYMMDD. Example: 20200101."
                    },
                    "dateTo": {
                        "title": "Received Date To (YYYYMMDD)",
                        "pattern": "^[0-9]{8}$",
                        "type": "string",
                        "description": "Upper bound on the report's received date. Format: YYYYMMDD. Example: 20231231."
                    },
                    "seriousOnly": {
                        "title": "Serious Reports Only",
                        "type": "boolean",
                        "description": "Limit to reports flagged as serious (death, hospitalization, disability, life-threatening, congenital anomaly, or other serious medical event).",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
