# FDA Food Recalls Scraper: openFDA Enforcement (`plainkitbin/openfda-food-recalls`) Actor

Extract FDA food recall enforcement reports from openFDA API as structured JSON dataset rows. Pay-per-event pricing at $0.005 per row.

- **URL**: https://apify.com/plainkitbin/openfda-food-recalls.md
- **Developed by:** [PlainKit bin](https://apify.com/plainkitbin) (community)
- **Categories:** Business, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.48 / 1,000 openfda food recall records

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

## openFDA Food Enforcement Reports Scraper

### Introduction

Food safety managers, compliance officers, supply chain monitors, grocery distributors, and restaurant operations specialists need openFDA food enforcement reports as structured dataset rows without manual extraction or parsing complex government feeds. This scraper extracts published food recall enforcement reports directly from the public openFDA API, outputting structured JSON dataset records that document product descriptions, recalling firms, hazard classifications, recall reasons, distribution patterns, and critical dates.

This Actor is an independent open-source tool and is not affiliated with openFDA Food Enforcement Reports (U.S. Food and Drug Administration). Data accessible via openFDA resides in the public domain under Creative Commons CC0 1.0 Universal.

### Tutorial

Getting started with openFDA Food Enforcement Reports Scraper takes only a few moments:

1. **Configure Search Parameters**: Enter target keywords such as specific pathogens (e.g. `salmonella`, `listeria`), allergen terms, or recalling firm names.
2. **Apply Classification Filters**: Restrict results by hazard classification level (`Class I` for serious health consequences, `Class II` for temporary reversible effects, or `Class III` for lower risk situations) or leave blank to retrieve all classes.
3. **Set Recall Status**: Filter records by operational status (`Ongoing`, `Completed`, or `Terminated`).
4. **Choose Date Range and Limit**: Specify `date_from` and `date_to` in standard `YYYY-MM-DD` format and configure `max_items` to bound the total number of delivered dataset rows.
5. **Run the Actor**: Click Start. Each delivered food recall record is pushed to the default dataset and charged individually.

### Pricing

The price is **$0.005** per delivered recall row under the `FREE` tier on Apify Pay-Per-Event (event name: `openfda-food-recall`).

- Event name: `openfda-food-recall`
- Pricing model: Apify Pay-Per-Event
- Volume tier rates:
  - FREE: $0.005 per event
  - BRONZE: $0.0045 per event
  - SILVER: $0.004 per event
  - GOLD: $0.003484 per event
  - PLATINUM: $0.003484 per event
  - DIAMOND: $0.003334 per event

Charging guarantees:

- Each recall row is pushed first to the dataset and charged right after a successful push.
- A refused charge or reached spending limit stops work immediately; that row remains delivered and uncharged.
- Failed network requests produce 0 charges and push no data rows.
- Restart safety: if a run resumes after platform restart, previously delivered recall numbers are recognized so no item is pushed or charged twice.

### Input and output examples

#### Input Example

```json
{
  "search": "salmonella",
  "classification": "Class I",
  "status": "Ongoing",
  "max_items": 5
}
```

#### Output Example

Delivered dataset rows contain structured fields copied from the openFDA response:

```json
{
  "category": "food",
  "classification": "Class I",
  "distribution_pattern": "Nationwide distribution to retail grocery stores.",
  "product_description": "Organic Baby Spinach, 5 oz plastic clamshell container.",
  "reason_for_recall": "Potential contamination with Salmonella species detected during routine sampling.",
  "recall_initiation_date": "2024-03-12",
  "recall_number": "F-0201-2024",
  "recalling_firm": "Green Valley Produce LLC",
  "report_date": "2024-03-20",
  "status": "Ongoing",
  "termination_date": "",
  "voluntary_mandated": "Voluntary: Firm Initiated"
}
```

### Actor recommendations

For comprehensive regulatory compliance monitoring, consider pairing this Actor with complementary tools:

- **FDA Recalls Scraper**: To monitor medical device and pharmaceutical drug enforcement actions alongside food recalls.
- **SEC Filings Scraper**: To track material public disclosure events and risk factor updates for publicly traded food manufacturers.
- **News and RSS Feed Extractor**: To monitor consumer news alerts and public health advisories connected to ongoing recall events.

### FAQ and support

#### Is an API key required to run this Actor?

No API key is required. The Actor queries the public keyless openFDA API endpoint directly.

#### What happens if the openFDA API returns a rate limit or refusal?

If the openFDA endpoint returns HTTP 401, 403, or 429, the run halts immediately and delivers a single uncharged status reason row to explain the refusal.

#### How are dates formatted in the output dataset?

All dates (such as `report_date`, `recall_initiation_date`, and `termination_date`) are formatted as standard ISO `YYYY-MM-DD` strings when valid calendar dates are present.

#### How can I request assistance or report issues?

Contact support at support@example.com for questions regarding dataset integrations or schema configurations.

# Actor input Schema

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

Free-text search term matching product description, recalling firm, reason for recall, or recall number.

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

Health hazard classification level: 'Class I', 'Class II', or 'Class III'. Leave empty for all classifications.

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

Recall operational status: 'Ongoing', 'Completed', or 'Terminated'. Leave empty for all statuses.

## `date_from` (type: `string`):

Filter by recall report date on or after this date (format: YYYY-MM-DD or YYYYMMDD).

## `date_to` (type: `string`):

Filter by recall report date on or before this date (format: YYYY-MM-DD or YYYYMMDD).

## `max_items` (type: `integer`):

Maximum total number of food recall records to output across the run.

## Actor input object example

```json
{
  "search": "",
  "classification": "",
  "status": "",
  "date_from": "",
  "date_to": "",
  "max_items": 10
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset items produced by this run.

# 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": "",
    "classification": "",
    "status": "",
    "date_from": "",
    "date_to": "",
    "max_items": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("plainkitbin/openfda-food-recalls").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": "",
    "classification": "",
    "status": "",
    "date_from": "",
    "date_to": "",
    "max_items": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("plainkitbin/openfda-food-recalls").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": "",
  "classification": "",
  "status": "",
  "date_from": "",
  "date_to": "",
  "max_items": 10
}' |
apify call plainkitbin/openfda-food-recalls --silent --output-dataset

```

## MCP server setup

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

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/lXWDYYphleWAyb9I4/builds/s8J2iUiSbc4SjCy2v/openapi.json
