# CPSC product recalls - search by product, hazard, date (API) (`retrainmap/cpsc-recalls`) Actor

Search U.S. Consumer Product Safety Commission recalls (saferproducts.gov API) by title, product, hazard, manufacturer and date range. One row per recall: number, date, title, description, products, hazards, remedies, manufacturers, retailers, units, image count, URL. Default: last 180 days.

- **URL**: https://apify.com/retrainmap/cpsc-recalls.md
- **Developed by:** [RetrainMap Team](https://apify.com/retrainmap) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 records

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?

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

## CPSC product recalls — search by product, hazard, date (API)

One row per recall from the U.S. Consumer Product Safety Commission's public recall API
(https://www.saferproducts.gov/RestWebServices/Recall). Filter by recall title, product
name, hazard text, manufacturer and recall date; get recall number, date, title,
description, product names, hazards, remedies, manufacturers, importers, retailers, units
sold, injuries, image count and the cpsc.gov page URL — normalised, one flat row per recall,
ready for CSV or JSON.

**The default input (last 180 days, 300 rows) succeeds within 5 minutes and returns rows**
(about 300 recalls per half year) — Apify auto-tests it daily.

### Data source and status

| | |
|---|---|
| Publisher | U.S. Consumer Product Safety Commission (CPSC) |
| API | https://www.saferproducts.gov/RestWebServices/Recall?format=json — public, no key (documentation: https://www.cpsc.gov/Recalls/CPSC-Recalls-Application-Program-Interface-API-Information) |
| What this Actor reads | One GET per run with `RecallDateStart`, `RecallDateEnd` and, when given, `RecallTitle`, `ProductName`, `Manufacturer`; the API answers with every matching recall in a single JSON array (newest first, no paging) |
| Refresh cadence | CPSC publishes recalls as they are announced (typically several per week). The Actor reads live on every run; `fetched_at` on each row is the fetch time and `last_publish_date` is the API's own last-publication date for the recall |
| Copyright | Works of the United States Government are not subject to copyright in the U.S. (17 U.S.C. §105). The data are public; please cite CPSC as the source |
| Known caveats | The API's own `Hazard` parameter matched nothing for any value tried on 2026-09-04, so `hazard_contains` is applied by the Actor to the hazard texts of the recalls returned for the other filters (the run summary counts what it dropped); many recalls list importers or retailers instead of manufacturers, so `manufacturer_contains` can miss them; a malformed date makes the API answer HTTP 200 with an error pseudo-recall, which the Actor detects and fails on; `description` is trimmed to 2,000 characters |

Honesty note: the rows are the API's own fields flattened — nothing is inferred, summarised
or classified by this Actor; recall details are **informational** and should be confirmed on
the linked cpsc.gov page before acting on them. A run stops with an error rather than guess
when the API's shape changes.

Identification: the requests carry a product-token User-Agent and the operator's contact
address in the standard `From:` header (RFC 9110 §10.1.2).

### Input

| Field | Type | Meaning |
|---|---|---|
| `title_contains` | string | Optional substring of the recall title (API `RecallTitle`) |
| `product_contains` | string | Optional substring of a product name (API `ProductName`) |
| `hazard_contains` | string | Optional substring of the hazard text, applied by the Actor |
| `manufacturer_contains` | string | Optional substring of a manufacturer name (API `Manufacturer`) |
| `date_from` / `date_to` | `YYYY-MM-DD` | Optional, inclusive. Both empty = the last 180 days |
| `max_records` | integer | Default 300, at most 20,000 (newest first) |
| `request_interval_ms` | integer | Default 1000 (floor 250) |
| `contact_email` | string | Sent in the `From:` header |

Example — recalls since January 2026 whose hazard text mentions fire:

```json
{ "hazard_contains": "fire", "date_from": "2026-01-01", "max_records": 200 }
```

### Output (dataset row)

`recall_id`, `recall_number`, `recall_date`, `last_publish_date`, `title`, `description`
(≤ 2,000 chars), `products` (names joined with `; `), `product_types`, `hazards`, `remedies`,
`remedy_options` (e.g. Refund, Repair), `manufacturers`, `importers`, `distributors`,
`retailers`, `manufacturer_countries`, `units` (e.g. "About 2,200"), `injuries`,
`consumer_contact`, `images_count`, `url` (cpsc.gov recall page), `source`, `fetched_at`.

A run summary (filters, the API's own count, rows dropped by the hazard filter, requests,
whether the pay-per-event budget stopped the run) is stored as `RUN_SUMMARY` in the run's
key-value store.

### Pricing (pay per event)

| Event | Price |
|---|---|
| `run-start` — once per run | $0.10 |
| `record` — per row written | $0.005 |

The default 180-day pull (≤ 300 rows) costs at most $1.60; 1,000 recalls cost $5.10. Rows
stop when your run's maximum charge is reached; the run summary says so.

### Operator

Steelyard Ventures LLC (RetrainMap) — info@steelyardclinical.com. Not affiliated with the
U.S. Consumer Product Safety Commission. The Actor writes only to its own dataset and
key-value store; it stores no credentials and sends nothing else.

# Actor input Schema

## `title_contains` (type: `string`):

Optional substring of the recall title (the API's RecallTitle parameter, case-insensitive). Empty = any title.

## `product_contains` (type: `string`):

Optional substring of a recalled product's name (the API's ProductName parameter). Empty = any product.

## `hazard_contains` (type: `string`):

Optional substring of the hazard description, e.g. fire, laceration, choking. Applied by the Actor to the hazard texts of the recalls the API returned for the other filters (the API's own Hazard parameter matched nothing in testing on 2026-09-04). Empty = any hazard.

## `manufacturer_contains` (type: `string`):

Optional substring of a manufacturer name (the API's Manufacturer parameter). Note many recalls list importers or retailers instead of manufacturers. Empty = any.

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

Optional, inclusive (the API's RecallDateStart). When both dates are empty the Actor uses the last 180 days (today minus 180 days through today, UTC); if only date\_to is given, date\_from becomes date\_to minus 180 days.

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

Optional, inclusive (the API's RecallDateEnd). If only date\_from is given, date\_to becomes today (UTC).

## `max_records` (type: `integer`):

Stop after this many recalls have been written (newest first). The API returns every matching recall in one answer; a year holds roughly 550 recalls.

## `request_interval_ms` (type: `integer`):

Politeness delay towards saferproducts.gov (one request per run plus retries); the floor is 250 ms.

## `contact_email` (type: `string`):

Sent in the standard From: request header so the data owner can reach the operator (RFC 9110 s10.1.2).

## Actor input object example

```json
{
  "max_records": 300,
  "request_interval_ms": 1000,
  "contact_email": "info@steelyardclinical.com"
}
```

# Actor output Schema

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

Every matched CPSC recall as one row: id, number, date, title, description, products, hazards, remedies, manufacturers, retailers, units, image count, URL.

## `results_csv` (type: `string`):

The same rows as a CSV file.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("retrainmap/cpsc-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("retrainmap/cpsc-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 '{}' |
apify call retrainmap/cpsc-recalls --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,retrainmap/cpsc-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/OLuOBJ5h4lPzVUbPJ/builds/fLcu3DjvtOiaPG9sV/openapi.json
