# Product Recalls API - CPSC, NHTSA, USDA, EU, UK (`whitel1ght/unified-product-recalls`) Actor

Search product recalls from US CPSC, NHTSA, USDA FSIS, EU Safety Gate and UK FSA in one unified JSON schema, with an only-new mode for monitoring.

- **URL**: https://apify.com/whitel1ght/unified-product-recalls.md
- **Developed by:** [Dzmitry Mamyrau](https://apify.com/whitel1ght) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 recalls

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/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

## Unified Product Recalls (Apify actor)

One actor, one JSON schema, five official recall sources. Search consumer product, vehicle and food recalls
from the **US CPSC**, **US NHTSA**, **US USDA FSIS**, **EU Safety Gate (RAPEX)** and the **UK Food Standards Agency**,
filter by keyword and date, and monitor for new recalls on a schedule. Built for product-safety, compliance, retail,
insurance and supply-chain teams, and for AI agents calling it through Apify's MCP server.

Pricing: **$5 per 1,000 recalls ($0.005 each)** plus Apify's standard per-run start fee (pay per event).

### Sources

| Key | Agency | Covers | Notes |
|---|---|---|---|
| `cpsc` | US Consumer Product Safety Commission | Consumer products (toys, appliances, furniture, ...) | Official Recalls REST API |
| `nhtsa` | US National Highway Traffic Safety Administration | Vehicles, tires, car seats, equipment | Official bulk recalls file (RCL flat file, streamed); one item per campaign; date = report received |
| `fsis` | US Dept. of Agriculture, Food Safety and Inspection Service | Meat, poultry, egg products; public health alerts | Official Recall API; class I/II/III |
| `safety-gate` | European Commission, EU Safety Gate (RAPEX) | Dangerous non-food products in the EU/EEA | **Beta.** Official weekly-report XML export; alerts appear once their weekly report is published (Fridays), dated by that report; at most the last 26 weeks per run |
| `fsa` | UK Food Standards Agency | Food recalls, allergy alerts, alerts for action | Official food alerts API |

FDA recalls (food, drugs, devices) are covered by the sibling actor "FDA Recalls Monitor".

### Input

| Field | Meaning | Default |
|---|---|---|
| `sources` | Any of `cpsc`, `nhtsa`, `fsis`, `safety-gate`, `fsa` | all five |
| `searchText` | Keywords; all words must appear in title, product, hazard, company or brand (case-insensitive) | none |
| `dateFrom`, `dateTo` | Inclusive `YYYY-MM-DD` window on the recall date | last 30 days |
| `maxResults` | Max recalls returned in total. The cap is shared fairly across the selected sources (unused share goes to the others); output is sorted newest first | 20 |
| `onlyNew` + `monitorId` | Return only recalls not delivered before to this monitor | off |
| `includeRaw` | Add the unmodified source record as `raw` | off |

Leave the input empty to get the newest recalls right away. Example:

```json
{ "sources": ["cpsc", "fsa"], "searchText": "peanut", "dateFrom": "2026-08-01", "maxResults": 50 }
```

### Output

One dataset item per recall, in the same shape for every source:

`id` (source-prefixed, unique), `source`, `agency`, `country` (US/EU/GB), `category` (food, vehicle, consumer-product),
`title`, `productDescription`, `hazard`, `riskLevel` (high/medium/low or null), `riskLevelRaw` (the source's own value),
`company`, `brands`, `date` (ISO), `url` (official notice), `images`, `extra` (source-specific details such as remedy,
units affected, allergens, vehicles, measures) and `raw` (with `includeRaw`). Missing values are `null`.

```json
{
  "id": "fsa:FSA-AA-41-2026",
  "source": "fsa",
  "agency": "UK Food Standards Agency (FSA)",
  "country": "GB",
  "category": "food",
  "title": "Waitrose & Partners recalls Waitrose Rhubarb Crumble because of undeclared oats (gluten)",
  "productDescription": "Waitrose Rhubarb Crumble",
  "hazard": "Oats (gluten) This product contains gluten making it a possible health risk for anyone with an allergy or intolerance to oats or gluten, or with coeliac disease.",
  "riskLevel": "medium",
  "riskLevelRaw": "AA (Allergy Alert)",
  "company": "Waitrose & Partners",
  "brands": [],
  "date": "2026-09-03",
  "url": "https://alerts.food.gov.uk/news-alerts/alert/fsa-aa-41-2026",
  "images": [],
  "extra": { "alertType": "AA", "allergens": ["Gluten", "Oats"], "countries": ["England", "Scotland", "Wales"] }
}
```

Risk levels are normalised only where the source provides something to normalise: FSIS class I/II/III, the EU Safety Gate risk level (serious/high = high), FSA alert type
(Food Alert for Action = high, Product Recall Information Notice and Allergy Alert = medium; this is **derived by this actor** from the alert type, because the FSA publishes no severity, so use `riskLevelRaw` for what the FSA actually said) and NHTSA "park it" / "park outside"
warnings (high). CPSC does not publish a severity, so `riskLevel` is `null` there; read `hazard` instead.

The run also stores an `OUTPUT` record in the key-value store with per-source status, item counts and errors.
**One failing source never fails the run**: it is logged, reported as `error` in the summary and skipped
(the run fails only if every selected source fails).

### Monitoring and scheduling

Turn on `onlyNew` with a `monitorId` (for example `peanut-watch`) and schedule the actor daily in Apify Console.
Each run returns only recalls not delivered before to that monitor. The list of delivered ids lives in a named
key-value store in your account. The first run is the baseline and returns everything matching. Only items actually
delivered are marked seen, so a run cut short by `maxResults` or your max charge picks up the rest next time.
Attach an Apify integration (Slack, email, webhook, Zapier, Make) to get notified.

### API and MCP usage

Run via the Apify API:

```bash
curl -X POST "https://api.apify.com/v2/acts/whitel1ght~unified-product-recalls/run-sync-get-dataset-items?token=<APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"searchText": "battery", "sources": ["cpsc", "safety-gate"], "maxResults": 10}'
```

With the Apify MCP server, add this actor as a tool and ask an agent things like "Any vehicle or consumer product
recalls involving lithium batteries in the last 14 days?". Input descriptions are written to be self-explanatory to
LLMs, and every result carries an official notice `url` to cite.

### FAQ

**Is this affiliated with any agency?** No. It is not affiliated with or endorsed by the CPSC, NHTSA, USDA, the European
Commission or the UK Food Standards Agency. Always confirm against the official notice linked in `url`.

**Why fewer than `maxResults` items?** The filters matched fewer recalls in the window, `onlyNew` removed ones you already
received, or a source failed (see the `OUTPUT` summary).

**Why is an EU Safety Gate alert missing or dated a few days ago?** The actor uses the official weekly-report export. A weekly
report is published every Friday, so alerts appear once their report is out, and `date` is the report's publication date.
The export is not a documented API contract, so Safety Gate stays marked beta.

**How does NHTSA search work?** The actor streams NHTSA's official bulk recalls file (about 15 MB zipped) on every run and keeps
campaigns whose report-received date is inside your window, so keyword search works over any date range without hammering
the NHTSA API.

**What if a source is slow or blocked?** Each source has its own deadline (90 s, NHTSA 120 s) and a timed-out source is reported as an
error while the others are returned. FSIS is retried with backoff and, if it still fails, served from the last good copy
(last 180 days) kept in a named key-value store in your account; the run summary says so.

**Is it up to date?** Data is fetched live on every run, but agencies publish with their own delay.

**What does it cost?** $5 per 1,000 recalls ($0.005 each) plus Apify's standard per-run start fee. You are charged only for items returned.

### Data licences and attribution

- **US sources (CPSC, NHTSA, USDA FSIS):** works of the US federal government, public domain.
- **EU Safety Gate:** Alerts from the Rapid Alert System for dangerous non-food products, published free of charge on the Safety Gate website (https://ec.europa.eu/safety-gate-alerts). © European Union, reused under CC BY 4.0. Source of the data in this actor: the official weekly-report XML export (`https://ec.europa.eu/safety-gate-alerts/api/download/weeklyReport/list/xml/en` and the per-week files it links to). On data.europa.eu the dataset "Safety Gate (the EU rapid alert system - non-food)" lists these exports under CC0 1.0 and the Commission reuse notice (Decision 2011/833/EU); attribution is given as above.
- **UK FSA:** Source: Food Standards Agency. Published under the [Open Government Licence v3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/); contains public sector information licensed under the OGL.

Dates without a timezone in a source are treated as UTC; all `date` values are UTC calendar dates.

### Develop

```bash
npm install
npm run typecheck
npm test            # unit tests, network mocked
npm run build       # tsc -> dist/
npm run smoke [source]   # live calls, e.g. npm run smoke fsa
```

Run locally: put input in `storage/key_value_stores/default/INPUT.json`, `npm run build`, then `node dist/main.js`
(results in `storage/datasets/default`). Locally, pay-per-event charging is a no-op.

`onlyNew` remembers delivered ids for 180 days (at most 50,000) and never looks back further than that.

### Before publishing (owner checklist)

1. Set `apifyUsername` in `src/config.ts` and replace `whitel1ght` in this README.
2. `apify login`, then `apify push`.
3. In Console, Monetization: pay per event, set only the two built-in events: `apify-default-dataset-item` = $0.005 (and leave `apify-actor-start` at Apify's standard fee). Do not add custom events.
4. Fill in the listing from `LAUNCH.md`.
5. Run once in the Console with the default input and check the "Recalls" view and the `OUTPUT` record.
6. Add a support contact or issues URL to the listing.

# Actor input Schema

## `sources` (type: `array`):

Which recall sources to query. cpsc = US Consumer Product Safety Commission (consumer products), nhtsa = US vehicle recalls, fsis = US USDA meat/poultry/egg food recalls and public health alerts, safety-gate = EU Safety Gate (RAPEX) non-food product alerts from the official weekly reports (beta; alerts appear once their weekly report is published), fsa = UK Food Standards Agency food alerts. Defaults to all five.

## `searchText` (type: `string`):

Keywords matched case-insensitively against title, product, hazard, company and brand. Multiple words must ALL appear, e.g. "peanut" or "lithium battery fire". Leave empty for no keyword filter.

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

Earliest recall date to include, format YYYY-MM-DD (inclusive). Defaults to 30 days before dateTo. Dates are UTC calendar dates.

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

Latest recall date to include, format YYYY-MM-DD (inclusive). Defaults to today.

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

Maximum number of recalls returned in total across all sources, split fairly between the selected sources and sorted newest first. Each returned recall is billed, so keep this small for tests.

## `onlyNew` (type: `boolean`):

Return only recalls not delivered by earlier runs that used the same Monitor ID. Requires monitorId. The first run is the baseline and returns everything matching. Only-new runs look back at most 180 days.

## `monitorId` (type: `string`):

Short name of this monitoring job, e.g. "peanut-watch". Recalls already delivered are remembered per Monitor ID in a named key-value store in your account. Used only when onlyNew is on.

## `includeRaw` (type: `boolean`):

Add the unmodified source record under "raw" (larger output).

## Actor input object example

```json
{
  "sources": [
    "cpsc",
    "fsa"
  ],
  "maxResults": 20,
  "onlyNew": false,
  "includeRaw": false
}
```

# Actor output Schema

## `output` (type: `string`):

Recalls (overview view of the default dataset).

## `summary` (type: `string`):

Per-source status, item counts and errors.

# 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 = {
    "sources": [
        "cpsc",
        "fsa"
    ],
    "maxResults": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("whitel1ght/unified-product-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 = {
    "sources": [
        "cpsc",
        "fsa",
    ],
    "maxResults": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("whitel1ght/unified-product-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 '{
  "sources": [
    "cpsc",
    "fsa"
  ],
  "maxResults": 20
}' |
apify call whitel1ght/unified-product-recalls --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,whitel1ght/unified-product-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/dvdc5bCkmo6tis6Bf/builds/MgRaTbeWanyn6s86x/openapi.json
