# openFDA Drug Adverse Events & Recalls Scraper (`slavako/open-fda-drug-adverse-events`) Actor

Scrape official US FDA drug safety adverse events, patient reactions, manufacturer recall enforcements, and clinical label data. Zero-cost fast openFDA HTTP engine.

- **URL**: https://apify.com/slavako/open-fda-drug-adverse-events.md
- **Developed by:** [Sviatoslav](https://apify.com/slavako) (community)
- **Categories:** Business, Developer tools, AI
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 safety records

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## openFDA Drug Adverse Events & Recalls Scraper

Fast, reliable, zero-cost US Food and Drug Administration (FDA) openFDA drug safety, adverse reaction events, and pharmaceutical recalls scraper. Extract verified patient adverse drug experiences (MedDRA reactions, hospitalization, outcomes) and manufacturer recall enforcement actions without costly healthcare data subscriptions or enterprise API keys.

***

### Features

- **Official openFDA API:** Direct connection to official US FDA regulatory databases (RFC compliant REST).
- **Adverse Drug Reactions:** Scrapes MedDRA standardized reaction terms, patient age, gender, and seriousness flags (hospitalization, death, life-threatening disability).
- **Drug Recall Enforcements:** Extracts ongoing and completed FDA drug recalls, recalling firms, reason for recall, and distribution patterns.
- **Pay-Per-Event (PPE) Monetization:** Pay only for the clinical records you inspect. Zero subscription overhead.
- **Standby Mode & MCP Server Ready:** Can be queried as an active web server or Model Context Protocol tool via `/mcp` or `/api/safety`.

***

### Use Cases

1. **Pharmacovigilance & Drug Safety Monitoring:** Monitor real-world adverse drug reactions and signal detection across prescription and OTC medications.
2. **Biotech & Pharma Competitive Intelligence:** Track competitor drug side-effect profiles and FDA warning letters/recalls.
3. **Medical AI Knowledge Bases:** Ingest structured drug reaction data into clinical LLM workflows and RAG diagnostic assistants.
4. **Healthcare Compliance & Legal:** Verify pharmaceutical recall status and manufacturer enforcement histories.

***

### Input Parameters

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `drugNames` | Array of Strings | Yes | `["OZEMPIC", "ASPIRIN"]` | Generic or brand drug names to search. |
| `queryType` | String | No | `"adverse_events"` | Mode: `adverse_events`, `recalls`, or `both`. |
| `seriousOnly` | Boolean | No | `true` | Filter for serious adverse events (death, hospitalization, disability). |
| `maxItemsPerDrug` | Integer | No | `10` | Maximum recent records per drug (1 to 50). |

***

### Output Data Structure

Each extracted record produces a clean JSON item in your Apify dataset:

```json
{
  "recordType": "adverse_event",
  "drugName": "OZEMPIC",
  "safetyReportId": "10188271",
  "receiveDate": "2014-05-22",
  "serious": true,
  "seriousnessDeath": false,
  "seriousnessHospitalization": false,
  "reactions": [
    "Stenosis",
    "Hunger",
    "Visual impairment"
  ],
  "patientAge": "54",
  "patientSex": "Female",
  "scrapedAt": "2026-11-21T06:00:00.000Z"
}
```

***

### Pay-Per-Event (PPE) Pricing

| Event | Price (USD) | Description |
|---|---|---|
| `apify-actor-start` | $0.004 | Billed once per scraping run |
| `apify-default-dataset-item` | $0.001 | Billed per drug safety record saved |
| `fda-safety-enriched` | $0.002 | Billed per record with MedDRA reactions and patient clinical details |

***

### Standby / MCP Server Usage

When deployed in Standby mode, query safety data directly:

```bash
curl "https://open-fda-drug-adverse-events.apify.actor/api/safety?drug=OZEMPIC&mode=adverse_events&limit=5"
```

# Actor input Schema

## `drugNames` (type: `array`):

List of generic or brand drug names to search (e.g. 'OZEMPIC', 'ASPIRIN', 'IBUPROFEN', 'METFORMIN').

## `queryType` (type: `string`):

Choose between patient adverse event reports, FDA recalls/enforcements, or both.

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

Filter for serious adverse events (hospitalization, death, disability).

## `maxItemsPerDrug` (type: `integer`):

Maximum number of recent records to return per drug (1 to 50).

## Actor input object example

```json
{
  "drugNames": [
    "OZEMPIC",
    "ASPIRIN"
  ],
  "queryType": "adverse_events",
  "seriousOnly": true,
  "maxItemsPerDrug": 10
}
```

# Actor output Schema

## `dataset` (type: `string`):

Extracted FDA drug adverse events, MedDRA reactions, and recall enforcement details.

# 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 = {
    "drugNames": [
        "OZEMPIC",
        "ASPIRIN"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("slavako/open-fda-drug-adverse-events").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 = { "drugNames": [
        "OZEMPIC",
        "ASPIRIN",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("slavako/open-fda-drug-adverse-events").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "drugNames": [
    "OZEMPIC",
    "ASPIRIN"
  ]
}' |
apify call slavako/open-fda-drug-adverse-events --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,slavako/open-fda-drug-adverse-events"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/IAkyhMvHMtWWpU6gU/builds/4MXC3dQzEyFH4dUBf/openapi.json
