# FDA Recalls Scraper — Drug, Food & Device Enforcement (`devilscrapes/fda-recalls-scraper`) Actor

Export FDA enforcement and recall records — recalling firm, product description, reason for recall, classification, distribution pattern and dates — across drug, food and device endpoints as clean JSON, CSV or Excel.

- **URL**: https://apify.com/devilscrapes/fda-recalls-scraper.md
- **Developed by:** [DevilScrapes](https://apify.com/devilscrapes) (community)
- **Categories:** Other, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

<div align="center">
  <img src=".actor/icon.svg" width="160" alt="Devil Scrapes mark" />

## FDA Recalls Scraper — Drug, Food & Device Enforcement

**💰 $2.05 / 1 000 results**  ·  pay only for results  ·  no credit card to try

*We do the dirty work so your dataset stays clean.* 😈

Export FDA enforcement and recall records — recalling firm, product description, reason for recall, classification, distribution pattern and dates — across drug, food and device endpoints as clean JSON, CSV or Excel.

</div>

***

### 🎯 What this scrapes

openFDA publishes every drug, food and device enforcement report, and it is the fastest way to see which firms are recalling what and why. The raw API paginates in a way that quietly caps you at 26 000 records and mixes three endpoints with different shapes. This Actor normalises all three into one row format and pages them properly, so a compliance watchlist becomes a spreadsheet instead of a scripting project.

### 🔥 What we handle for you

normalises drug, food and device endpoints into one predictable row shape
stops cleanly at openFDA's 26 000-record pagination ceiling instead of looping
retries transient 429/5xx responses so a rate-limit blip does not kill the run

### 💡 Use cases

- Watch a competitor's recall history for quality-system signals before a supplier decision.
- Build a compliance dashboard of Class I recalls in your product category.
- Feed a supplier-risk model with recall frequency by firm and hazard class.
- Track whether an ongoing recall affecting your supply chain has been terminated.

### ⚙️ How to use it

1. Click **Try for free** at the top of the page.
2. Fill in the input form — most fields have sensible defaults.
3. Click **Start**. Output streams into the run's dataset.
4. Export from **Storage → Dataset** as JSON, CSV, or Excel — or fetch via the API.

### 📥 Input

| Field | Type | Required | Default | Notes |
|---|---|:--:|---|---|
| `endpoint` | `string` | no | 'drug' | Which openFDA enforcement endpoint to pull. |
| `searchQuery` | `string` | no | 'classification:"Class I"' | openFDA search expression, e.g. <code>recalling\_firm:"Pfizer"</code> or <code>classification:"Class I"</code>. Leave… |
| `sinceDate` | `string` | no | '20250101' | Only include recalls initiated on or after this date, as <code>YYYYMMDD</code>. Leave empty for no date floor. |
| `maxResults` | `integer` | no | 100 | Stop after this many records. Each record is one billed result row. |
| `proxyConfiguration` | `object` | no | {'useApifyProxy': False} | openFDA is a public government API and does not need a proxy. Leave this off unless your account requires egress… |

#### Example input

```json
{
  "endpoint": "drug",
  "searchQuery": "classification:\"Class I\"",
  "maxResults": 3,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

### 📤 Output

Every row is one dataset item.

| Field | Type | Notes |
|---|---|---|
| `recall_number` | `string` | FDA recall identifier. |
| `event_id` | `string` | FDA enforcement event id grouping related recalls. |
| `endpoint` | `string` | Which enforcement endpoint the row came from: `drug`, `food` or `device`. |
| `status` | `string` | Recall status, e.g. `Ongoing`, `Completed`, `Terminated`. |
| `classification` | `string` | Hazard class — `Class I`, `Class II` or `Class III`. |
| `recalling_firm` | `string` | Firm conducting the recall. |
| `city` | `string` | Recalling firm city. |
| `state` | `string` | Recalling firm state. |
| `country` | `string` | Recalling firm country. |
| `product_type` | `string` | Product type as reported by FDA. |
| `product_description` | `string` | Product description text. |
| `product_quantity` | `string` | Quantity in distribution, as published. |
| `reason_for_recall` | `string` | Stated reason for the recall. |
| `distribution_pattern` | `string` | Where the product was distributed. |
| `voluntary_mandated` | `string` | Whether the recall was voluntary or FDA-mandated. |
| `recall_initiation_date` | `string` | Date the recall began (`YYYYMMDD`). |
| `report_date` | `string` | Date FDA published the report (`YYYYMMDD`). |
| `termination_date` | `string` | Date the recall was terminated, when applicable. |

#### Example output

```json
{}
```

### 💰 Pricing

Pay-Per-Event — you pay only when these events fire:

| Event | USD | What it is |
|---|---:|---|
| `actor-start` | $0.05 | One-off warm-up charge per run |
| `result` | $0.002 | Per dataset item |

Example: 1 000 results at the rates above ≈ **$2.05**. No subscription, no minimum, no card to start — Apify gives every new account $5 of free credit.

### 🚧 Limitations

- openFDA caps pagination at 26 000 records per query — narrow the search or the date floor to go deeper.
- Date fields are passed through in FDA's `YYYYMMDD` string form rather than being reformatted.

### ❓ FAQ

**Do I need an API key?**

No. openFDA serves this data keylessly; the Actor stays inside the anonymous rate limit.

**Can I pull all three recall types at once?**

Run the Actor once per endpoint — the row shape is identical, so the datasets append cleanly.

**Why is there a 26 000 record ceiling?**

openFDA's <code>skip</code> parameter refuses to page past 26 000. The Actor stops cleanly at that boundary and tells you in the log rather than looping.

### 💬 Your feedback

Spotted a bug, hit a weird edge case, or need a new field? Open an
issue on the Actor's **Issues** tab on Apify Console — we ship
fixes weekly and we read every report.

***

<div align="center">

Built by **[Devil Scrapes](https://apify.com/DevilScrapes)** 😈 — a small fleet of
opinionated public-data Actors. Honest pricing, real engineering, zero fine print.

</div>

# Actor input Schema

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

Which openFDA enforcement endpoint to pull.

## `searchQuery` (type: `string`):

openFDA search expression, e.g. <code>recalling\_firm:"Pfizer"</code> or <code>classification:"Class I"</code>. Leave empty for all recent records.

## `sinceDate` (type: `string`):

Only include recalls initiated on or after this date, as <code>YYYYMMDD</code>. Leave empty for no date floor.

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

Stop after this many records. Each record is one billed result row.

## `proxyConfiguration` (type: `object`):

openFDA is a public government API and does not need a proxy. Leave this off unless your account requires egress through Apify Proxy.

## Actor input object example

```json
{
  "endpoint": "drug",
  "searchQuery": "classification:\"Class I\"",
  "sinceDate": "20250101",
  "maxResults": 100,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `datasetItems` (type: `string`):

All dataset items as JSON.

## `datasetItemsCsv` (type: `string`):

Same data exported to CSV.

## `datasetView` (type: `string`):

Open the run dataset in the Console.

# 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 = {
    "searchQuery": "classification:\"Class I\"",
    "sinceDate": "20250101",
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("devilscrapes/fda-recalls-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 = {
    "searchQuery": "classification:\"Class I\"",
    "sinceDate": "20250101",
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("devilscrapes/fda-recalls-scraper").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 '{
  "searchQuery": "classification:\\"Class I\\"",
  "sinceDate": "20250101",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call devilscrapes/fda-recalls-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,devilscrapes/fda-recalls-scraper"
        }
    }
}

```

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/2USgkrAdamsCAk15E/builds/npUWDEQwhhTa3oXqh/openapi.json
