# US Product Recall & Enforcement Search API (`hamzamihaidaniel/us-product-recall-search-api`) Actor

Search official CPSC, FDA, and NHTSA recall records through one normalized compliance API.

- **URL**: https://apify.com/hamzamihaidaniel/us-product-recall-search-api.md
- **Developed by:** [Hamza Mihai Daniel](https://apify.com/hamzamihaidaniel) (community)
- **Categories:** Automation, Developer tools, E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 recall results

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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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

## US Product Recall & Enforcement Search API

Search official US product-safety and recall sources in one run and receive a
single normalized dataset. The Actor covers:

- CPSC consumer-product recalls
- FDA food enforcement reports
- FDA drug enforcement reports
- FDA medical-device enforcement reports
- NHTSA vehicle recalls by campaign number or make/model/year

It is designed for marketplace compliance, brand monitoring, product safety,
insurance research, due diligence, and scheduled alert workflows.

### Why use this Actor?

The official sources expose different APIs, query syntaxes, date formats, and
record shapes. This Actor handles those differences and emits consistent fields
for every result:

- stable source and recall IDs
- title, summary, authority, and official URL
- publication and recall dates
- classification and status
- products, companies, hazards, remedies, and incidents
- image URLs when supplied by the source
- the original source record for auditability

Only results written to the dataset are billed. Empty searches do not generate a
result charge.

### Input

| Field                                        | Description                                                                         |
| -------------------------------------------- | ----------------------------------------------------------------------------------- |
| `query`                                      | Brand, company, product, hazard, component, recall number, or NHTSA campaign number |
| `sources`                                    | One or more official APIs to search                                                 |
| `dateFrom`, `dateTo`                         | Optional inclusive date range in `YYYY-MM-DD`                                       |
| `lookbackYears`                              | Date window used when `dateFrom` is omitted                                         |
| `maxResults`                                 | Maximum normalized rows across all sources                                          |
| `vehicleMake`, `vehicleModel`, `vehicleYear` | Optional complete vehicle tuple for NHTSA                                           |
| `nhtsaCampaignNumber`                        | Optional exact NHTSA campaign number; takes priority over vehicle fields            |

#### Example: product and hazard search

```json
{
  "query": "battery",
  "sources": ["cpsc", "fda_food", "fda_drug", "fda_device"],
  "lookbackYears": 5,
  "maxResults": 50
}
````

#### Example: vehicle recall search

```json
{
  "query": "Tesla",
  "sources": ["nhtsa_vehicle"],
  "vehicleMake": "Tesla",
  "vehicleModel": "Model 3",
  "vehicleYear": 2023,
  "maxResults": 50
}
```

### Output

Each dataset row is one normalized recall record.

```json
{
  "source": "nhtsa_vehicle",
  "recordType": "vehicle_safety_recall",
  "recordId": "22V844000",
  "title": "Tesla, Inc. recall — EXTERIOR LIGHTING:TAIL LIGHTS",
  "summary": "Tesla, Inc. is recalling certain vehicles...",
  "authority": "U.S. National Highway Traffic Safety Administration (NHTSA)",
  "country": "US",
  "publishedDate": "2022-11-15T00:00:00.000Z",
  "classification": "Vehicle safety recall",
  "products": ["2023 TESLA MODEL 3"],
  "companies": ["Tesla, Inc."],
  "hazards": ["A taillight failure may increase crash risk."],
  "remedies": ["An over-the-air update is available."],
  "officialUrl": "https://api.nhtsa.gov/recalls/campaignNumber?campaignNumber=22V844000",
  "matchedQuery": "Tesla"
}
```

The key-value store record named `REPORT` contains per-source status, timing,
returned and billed counts, and completion status.

### Source behavior

- CPSC keyword matching is applied across titles, descriptions, products,
  companies, hazards, remedies, and incident text.
- FDA searches official recall number, firm, product description, recall reason,
  and product-code fields within the requested date range.
- NHTSA accepts an exact campaign number, or a complete make/model/year tuple.
  Partial vehicle tuples are rejected so the query cannot silently return the
  wrong vehicle.
- The final result set reserves a slot for every selected source that returned
  data, then fills remaining capacity with the newest records.

### Scheduling and monitoring

Use Apify Schedules to run a saved task daily or weekly. Connect the dataset to
webhooks, Make, Zapier, n8n, Slack, email, Google Sheets, or your own data
warehouse to alert when new matching recalls appear.

### Responsible use and limitations

This Actor uses public US government APIs and does not bypass authentication.
Source records can be corrected or updated after publication. A missing result
does not prove that no recall or safety issue exists.

This tool is informational only. Verify medical, safety, legal, and compliance
decisions in the linked official source. Do not rely on openFDA for medical
decisions.

### Official data sources

- CPSC SaferProducts.gov Recall REST service
- FDA openFDA enforcement endpoints
- NHTSA Recalls API

### Development

```bash
npm install
npm run check
npm start
```

The project uses strict TypeScript and includes parser, validation, balancing,
and normalization tests.

# Actor input Schema

## `query` (type: `string`):

Brand, company, product, hazard, recall number, component, or campaign number.

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

Government recall APIs to search. NHTSA requires either a campaign number or all three vehicle fields below.

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

Optional inclusive start date in YYYY-MM-DD format. If omitted, the lookback period is used.

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

Optional inclusive end date in YYYY-MM-DD format. Defaults to today.

## `lookbackYears` (type: `integer`):

Number of years searched when Date from is empty.

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

Maximum normalized records saved across all selected sources.

## `vehicleMake` (type: `string`):

Optional. Provide together with model and year, for example Tesla.

## `vehicleModel` (type: `string`):

Optional. Provide together with make and year, for example Model 3.

## `vehicleYear` (type: `integer`):

Optional. Provide together with make and model.

## `nhtsaCampaignNumber` (type: `string`):

Optional exact campaign number, for example 22V844000. This takes priority over the vehicle fields.

## Actor input object example

```json
{
  "query": "battery",
  "sources": [
    "cpsc",
    "fda_food",
    "fda_drug",
    "fda_device"
  ],
  "lookbackYears": 5,
  "maxResults": 50
}
```

# Actor output Schema

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

No description

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

No description

# 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 = {
    "query": "battery"
};

// Run the Actor and wait for it to finish
const run = await client.actor("hamzamihaidaniel/us-product-recall-search-api").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 = { "query": "battery" }

# Run the Actor and wait for it to finish
run = client.actor("hamzamihaidaniel/us-product-recall-search-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "query": "battery"
}' |
apify call hamzamihaidaniel/us-product-recall-search-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=hamzamihaidaniel/us-product-recall-search-api",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "US Product Recall & Enforcement Search API",
        "description": "Search official CPSC, FDA, and NHTSA recall records through one normalized compliance API.",
        "version": "0.1",
        "x-build-id": "M13VgAUOaxB97zQFz"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/hamzamihaidaniel~us-product-recall-search-api/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-hamzamihaidaniel-us-product-recall-search-api",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/hamzamihaidaniel~us-product-recall-search-api/runs": {
            "post": {
                "operationId": "runs-sync-hamzamihaidaniel-us-product-recall-search-api",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/hamzamihaidaniel~us-product-recall-search-api/run-sync": {
            "post": {
                "operationId": "run-sync-hamzamihaidaniel-us-product-recall-search-api",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "query"
                ],
                "properties": {
                    "query": {
                        "title": "Search query",
                        "minLength": 1,
                        "maxLength": 250,
                        "type": "string",
                        "description": "Brand, company, product, hazard, recall number, component, or campaign number."
                    },
                    "sources": {
                        "title": "Official sources",
                        "minItems": 1,
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Government recall APIs to search. NHTSA requires either a campaign number or all three vehicle fields below.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "cpsc",
                                "fda_food",
                                "fda_drug",
                                "fda_device",
                                "nhtsa_vehicle"
                            ],
                            "enumTitles": [
                                "CPSC consumer-product recalls",
                                "FDA food enforcement reports",
                                "FDA drug enforcement reports",
                                "FDA medical-device enforcement reports",
                                "NHTSA vehicle safety recalls"
                            ]
                        },
                        "default": [
                            "cpsc",
                            "fda_food",
                            "fda_drug",
                            "fda_device"
                        ]
                    },
                    "dateFrom": {
                        "title": "Date from",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                        "type": "string",
                        "description": "Optional inclusive start date in YYYY-MM-DD format. If omitted, the lookback period is used."
                    },
                    "dateTo": {
                        "title": "Date to",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                        "type": "string",
                        "description": "Optional inclusive end date in YYYY-MM-DD format. Defaults to today."
                    },
                    "lookbackYears": {
                        "title": "Default lookback",
                        "minimum": 1,
                        "maximum": 20,
                        "type": "integer",
                        "description": "Number of years searched when Date from is empty.",
                        "default": 5
                    },
                    "maxResults": {
                        "title": "Maximum results",
                        "minimum": 1,
                        "maximum": 200,
                        "type": "integer",
                        "description": "Maximum normalized records saved across all selected sources.",
                        "default": 50
                    },
                    "vehicleMake": {
                        "title": "NHTSA vehicle make",
                        "maxLength": 100,
                        "type": "string",
                        "description": "Optional. Provide together with model and year, for example Tesla."
                    },
                    "vehicleModel": {
                        "title": "NHTSA vehicle model",
                        "maxLength": 100,
                        "type": "string",
                        "description": "Optional. Provide together with make and year, for example Model 3."
                    },
                    "vehicleYear": {
                        "title": "NHTSA model year",
                        "minimum": 1949,
                        "maximum": 2100,
                        "type": "integer",
                        "description": "Optional. Provide together with make and model."
                    },
                    "nhtsaCampaignNumber": {
                        "title": "NHTSA campaign number",
                        "maxLength": 30,
                        "type": "string",
                        "description": "Optional exact campaign number, for example 22V844000. This takes priority over the vehicle fields."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
