# FDA Food & Drug Recall Search (Official API) (`kdhan/fda-recall-search`) Actor

Search FDA recall enforcement reports through the official openFDA API. Filter by product type, severity class, status, country and date. No API key needed. Public domain U.S. government data.

- **URL**: https://apify.com/kdhan/fda-recall-search.md
- **Developed by:** [Doohan Kim](https://apify.com/kdhan) (community)
- **Categories:** Developer tools, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.20 / 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/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

## FDA Food & Drug Recall Search (Official API)

Search **FDA recall enforcement reports** through the official **openFDA API**.
No scraping, no API key.

### What it does

The FDA publishes every food and drug recall as a structured enforcement report:
who recalled it, what the product was, why it was recalled, how serious it is,
where it was distributed, and when.

This Actor searches those reports and returns them as flat rows you can open in a spreadsheet.

### Why this Actor

- **Official API only.** Calls `api.fda.gov`. No HTML scraping.
- **No API key.** openFDA is open to anyone.
- **Public domain.** U.S. government data.
- **Flat rows.** The nested `openfda` block is expanded into `openfda_*` columns,
  and list fields are joined with `; ` instead of being dumped as raw arrays.

### Filters

| Input | What it does |
|---|---|
| `product_type` | `food` or `drug` recalls |
| `search` | Free text, e.g. `salmonella`, `undeclared peanut`, `contamination` |
| `classification` | `Class I` (most serious), `Class II`, `Class III` |
| `status` | `Ongoing`, `Completed`, `Terminated`, `Pending` |
| `country` | Country of the recalling firm |
| `date_start` / `date_end` | Report date range, `YYYYMMDD` |
| `max_results` | How many records to return |

### Output fields

| Field | Description |
|---|---|
| `recall_number` | FDA recall identifier, e.g. `F-0276-2017` |
| `recalling_firm`, `city`, `state`, `country` | Who recalled, and from where |
| `product_description` | What was recalled |
| `reason_for_recall` | Why |
| `classification` | Severity class |
| `status` | Current recall status |
| `distribution_pattern` | Where it was distributed |
| `product_quantity`, `code_info` | Amount and lot/code identifiers |
| `voluntary_mandated`, `initial_firm_notification` | How the recall was initiated and announced |
| `recall_initiation_date`, `center_classification_date`, `report_date`, `termination_date` | Key dates (`YYYYMMDD`) |
| `openfda_*` | Drug identifiers when FDA provides them (often empty) |

### Example

Class I food recalls mentioning salmonella:

```json
{
  "product_type": "food",
  "search": "salmonella",
  "classification": "Class I",
  "max_results": 200
}
```

### Use cases

- Monitoring recalls for a brand, ingredient or supplier
- Building a recall history dataset for food safety or supply chain analysis
- Tracking which firms and regions recall most often
- Feeding recall alerts into your own system on a schedule

### Running locally

```bash
pip install -r requirements.txt
python -m tests.test_fda
```

### Attribution and limits

Data from openFDA, U.S. Food and Drug Administration. This Actor is not affiliated with or
endorsed by the FDA. openFDA states that its data should not be used to make medical
decisions, and that records may be incomplete or delayed. Always confirm against the
official record before acting on it.

# Actor input Schema

## `product_type` (type: `string`):

Which recall dataset to search.

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

Free text searched across the recall record, for example salmonella, undeclared peanut, contamination.

## `classification` (type: `string`):

Recall severity. Class I is the most serious (reasonable probability of serious harm).

## `status` (type: `string`):

Recall status as reported by FDA.

## `country` (type: `string`):

Country of the recalling firm, for example United States.

## `date_start` (type: `string`):

YYYYMMDD, for example 20240101.

## `date_end` (type: `string`):

YYYYMMDD, for example 20241231.

## `max_results` (type: `integer`):

You are charged per returned recall record.

## Actor input object example

```json
{
  "product_type": "food",
  "search": "salmonella",
  "max_results": 100
}
```

# Actor output Schema

## `recalls` (type: `string`):

Recall records with firm, product description, reason, classification, status, distribution pattern and dates.

# 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 = {
    "search": "salmonella"
};

// Run the Actor and wait for it to finish
const run = await client.actor("kdhan/fda-recall-search").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 = { "search": "salmonella" }

# Run the Actor and wait for it to finish
run = client.actor("kdhan/fda-recall-search").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 '{
  "search": "salmonella"
}' |
apify call kdhan/fda-recall-search --silent --output-dataset

```

## MCP server setup

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

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/aeRB9gpaCLJPhTtKd/builds/Vh1Khkn5HEta0VOG4/openapi.json
