# openFDA Scraper — 7 Endpoints: Drug, Device & Food, No Key (`themineworks/openfda-unified-crawler`) Actor

Scrape all openFDA endpoints in one actor: drug adverse events (FAERS), recalls, labels, device 510k & MAUDE, food enforcement. No API key needed. Date filtering, JSON output. Use in Claude, ChatGPT & any MCP agent for pharmacovigilance.

- **URL**: https://apify.com/themineworks/openfda-unified-crawler.md
- **Developed by:** [The Mine Works](https://apify.com/themineworks) (community)
- **Categories:** Other, Business, MCP servers
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 record scrapeds

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 web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## 💊 openFDA Scraper: Drugs, Devices & Food Recalls, FAERS

### Overview

openFDA Scraper searches every openFDA endpoint from a single actor: drug adverse events (FAERS), drug labels, drug recalls, medical device 510k clearances, device recalls, device adverse events (MAUDE), and food enforcement actions. Change the `endpoint` field and you switch from FAERS to food recalls without touching any other input. Every record comes back as clean structured JSON with the raw openFDA payload plus `endpoint` and `scraped_at` tags.

The FDA's openFDA API covers 12 distinct endpoints across drugs, medical devices, and food, but most developers build separate integrations for each. This actor unifies the entire openFDA surface under one input schema, with date filtering, optional key support, and pagination handled internally.

✅ No API key needed | ✅ 12 openFDA endpoints in one actor | ✅ Date range filtering | ✅ Pay only per record delivered | ✅ MCP-ready for AI agents

### Features

Every openFDA endpoint (drug/event, drug/label, drug/enforcement, device/510k, device/recall, device/event, food/enforcement) reachable from one actor.
Optional free FDA API key raises your rate limit from 1,000 to 120,000 requests per day; keyless by default.
Date range filtering (`YYYY-MM-DD`) on every endpoint.
Native openFDA search syntax passthrough for precise queries (`brand_name:"Humira"`, `patient.reaction.reactionmeddrapt:nausea`).
Zero charge on empty runs and errors, so exploratory queries are safe.

### How it works

The actor calls `api.fda.gov/{endpoint}` with your `search` query, date range, and pagination cursor. If you supply an FDA API key it is appended to each request for the higher rate limit; otherwise the keyless 1,000 req/day tier is used. Pagination is walked internally up to your `maxResults` cap.

Each record is stored as the raw openFDA response object with `endpoint` and `scraped_at` fields added. Structure varies by endpoint (drug/event fields differ from device/510k), so refer to the openFDA documentation for per-endpoint field definitions.

Reliability posture: blocked, empty, or failed runs are never charged. You only pay for a record that was actually delivered to the dataset.

### 🧾 Input configuration

```json
{
  "endpoint": "drug/enforcement",
  "search": "reason_for_recall:\"contamination\"",
  "dateFrom": "2026-01-01",
  "dateTo": "2026-07-01",
  "maxResults": 500
}
```

### 📤 Output format

Records vary by endpoint. Example from `drug/event` (real FAERS report, drug detail trimmed for readability):

```json
{
  "endpoint": "drug/event",
  "safetyreportid": "10003304",
  "receivedate": "20140312",
  "serious": "2",
  "patient": {
    "patientsex": "2",
    "reaction": [
      { "reactionmeddrapt": "Drug hypersensitivity", "reactionoutcome": "6" }
    ],
    "drug": [
      { "medicinalproduct": "DOXYCYCLINE HYCLATE", "drugcharacterization": "1", "drugdosagetext": "UNK" },
      { "medicinalproduct": "ASPIRIN", "drugcharacterization": "1", "drugdosagetext": "UNK" }
    ]
  },
  "scraped_at": "2026-07-15T04:19:41.803Z"
}
```

Common top-level fields (endpoint-dependent):

| Field | Description |
| --- | --- |
| 🔌 `endpoint` | openFDA endpoint the record came from |
| 🆔 `safetyreportid` / `k_number` / `recall_number` | Endpoint-specific ID |
| 📅 `receivedate` / `report_date` / `recall_initiation_date` | Endpoint-specific date field |
| 🩺 `patient` | Reaction and drug detail on FAERS records |
| 🏷️ `openfda` | Normalized openFDA drug or device fields |
| 🕒 `scraped_at` | ISO timestamp of capture |

Full field definitions per endpoint: open.fda.gov/apis.

### 💼 Common use cases

**Pharmacovigilance**
Pull FAERS adverse-event reports for a molecule or reaction and score signal strength over time.
Combine with drug label pulls for on-label vs. off-label context.

**Drug and device recall monitoring**
Schedule daily runs on `drug/enforcement`, `device/recall`, or `food/enforcement` with a rolling date range.
Alert internal teams the moment a competitor product is recalled.

**Medical device competitive intelligence**
Track 510k clearances by manufacturer or product code, and cross-reference with MAUDE for post-market signals.
Feed the results into an internal pipeline dashboard.

**Food safety research**
Pull food enforcement actions by product, hazard, or firm for policy and journalism work.
Combine with retailer data to trace product distribution.

### 🚀 Getting started

1. Open the actor and pick an Endpoint (default `drug/event`); see the list above for all seven common endpoints.
2. Enter a Search query using openFDA syntax (e.g. `brand_name:"Humira"`, `patient.reaction.reactionmeddrapt:nausea`).
3. Optionally add Date from and Date to (`YYYY-MM-DD`).
4. Optionally paste a free FDA API key from open.fda.gov/apis/authentication/ for the higher rate limit.
5. Click Save & Start, then download as JSON, CSV, or Excel, or pull via API or MCP.

### FAQ

**Do I need an FDA API key?**
No. The actor works keyless at 1,000 req/day per IP. For large pulls, get a free key at open.fda.gov/apis/authentication/ and enter it in the `fdaApiKey` field for 120,000 req/day.

**Which endpoint has the most data?**
`drug/event` (FAERS) has the largest dataset with millions of adverse event reports going back to 2004. `device/510k` covers clearances back to 1976.

**How do I search for a specific drug?**
Use openFDA syntax in `search`: `brand_name:"Humira"` for a brand, `generic_name:"semaglutide"` for generics. The openFDA docs at open.fda.gov list every field per endpoint.

**Can I automate recall monitoring?**
Yes. Schedule the actor daily or weekly on Apify with `endpoint: drug/enforcement` (or device or food) and a rolling date range.

**How am I charged?**
Pay per record at $0.005 per record ($5 per 1,000). You pay only for records actually delivered to the dataset. There is no free tier. Zero charge on empty runs or errors.

### Use in Claude, ChatGPT & any MCP agent

```
https://mcp.apify.com/?tools=themineworks/openfda-unified-crawler
```

Or call it programmatically with the Apify client:

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const run = await client.actor('themineworks/openfda-unified-crawler').call({
  endpoint: 'drug/event',
  search: 'brand_name:"Humira"',
  maxResults: 100,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### 🛠️ Complete your life-sciences pipeline

FDA data pairs with the rest of the biomedical stack:

- **[ClinicalTrials.gov Scraper](https://apify.com/themineworks/clinicaltrials-scraper)**: trials by condition, sponsor, phase, and location.
- **[Medicare Part D Drug Spending](https://apify.com/themineworks/medicare-part-d-drug-spending)**: total spend, claims, beneficiaries, and unit cost for every Part D drug.
- **[OpenAlex Scraper](https://apify.com/themineworks/openalex-scholarly-works)**: 250M+ scholarly papers with citations and abstracts.

Typical flow: monitor FAERS for a molecule, cross-check against active trials, and pair with the underlying literature.

Found a bug or have a feature request? Open an issue on the actor's Apify Console page or reach out through the Apify profile.

# Actor input Schema

## `endpoint` (type: `string`):

openFDA endpoint: drug/event, drug/label, drug/enforcement, device/510k, device/recall, device/event, food/enforcement

## `search` (type: `string`):

openFDA search string, e.g. brand\_name:aspirin or patient.reaction.reactionmeddrapt:nausea

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

Filter results from this date onward.

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

Filter results up to this date.

## `fdaApiKey` (type: `string`):

Free key from open.fda.gov/apis/authentication/ lifts rate limit to 120,000 req/day. Leave blank for 1,000 req/day keyless.

## `maxResults` (type: `integer`):

Maximum records to return.

## Actor input object example

```json
{
  "endpoint": "drug/event",
  "search": "aspirin",
  "maxResults": 25
}
```

# Actor output Schema

## `results` (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 = {
    "endpoint": "drug/event",
    "search": "aspirin",
    "maxResults": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("themineworks/openfda-unified-crawler").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 = {
    "endpoint": "drug/event",
    "search": "aspirin",
    "maxResults": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("themineworks/openfda-unified-crawler").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 '{
  "endpoint": "drug/event",
  "search": "aspirin",
  "maxResults": 25
}' |
apify call themineworks/openfda-unified-crawler --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/HPP04F8R0rc4NZqNh/builds/OT3sMIFoBRQwzXbSu/openapi.json
