# Government Recalls Monitor (`datapilot/government-recalls-monitor`) Actor

Recall Alert Scraper collects product recalls from U.S. Food and Drug Administration and National Highway Traffic Safety Administration. It filters by keyword, extracts recall details, and outputs structured JSON for food, drug, medical device, and vehicle safety monitoring. 🚨📦

- **URL**: https://apify.com/datapilot/government-recalls-monitor.md
- **Developed by:** [Data Pilot](https://apify.com/datapilot) (community)
- **Categories:** SEO tools, Other
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 1,000 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.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.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/platform/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

## Government Recalls Monitor

### Overview

The **Government Recalls Monitor** is an Apify Actor that extracts real-time government recalls data from official U.S. regulatory APIs including the FDA (Food, Drug, and Medical Device) and NHTSA (Vehicle). Provide a keyword and the actor returns structured government recalls records including recall ID, product, company, reason, risk level, distribution pattern, and source URL. Whether you're tracking government recalls for consumer safety, compliance research, or product monitoring, this actor delivers accurate government recalls data efficiently.

With multi-agency coverage, keyword filtering, and built-in deduplication, the Government Recalls Monitor ensures comprehensive and clean government recalls data across food, drugs, medical devices, and vehicles.

---

### Features

- **Multi-Agency Government Recalls Coverage** – Fetches government recalls from FDA Food, FDA Drug, FDA Medical Device, and NHTSA Vehicle APIs in a single run.
- **Keyword Filtering** – Filter government recalls by any keyword (e.g., `"shrimp"`, `"insulin"`, `"airbag"`, `"Tesla"`).
- **Smart NHTSA Routing** – Automatically detects if the keyword is a car brand before querying vehicle government recalls to avoid unnecessary errors.
- **Deduplication** – Removes duplicate government recalls across all agencies using unique recall IDs.
- **Date Sorting** – Returns government recalls sorted by most recent recall date first.
- **Result Limit Control** – Set a maximum number of government recalls records to return per run.
- **Proxy Support** – Optionally uses Apify residential proxies for reliable government recalls fetching.
- **Error Handling** – Logs errors per agency and continues processing remaining government recalls sources.
- **Dataset Integration** – Automatically pushes all government recalls to your Apify dataset for easy export.

---

### How It Works

1. **Input** – Provide a keyword and optional max results limit.
2. **NHTSA Check** – If the keyword matches a known car brand, the actor queries the NHTSA vehicle government recalls API.
3. **FDA Queries** – The actor fetches up to 1,000 recent records from each FDA endpoint (Food, Drug, Medical Device) and filters them by keyword match.
4. **Merge & Deduplicate** – All government recalls are merged, deduplicated by recall ID, and sorted by date descending.
5. **Build Output** – Structures each government recall into a clean record and pushes it to the dataset.

---

### Input

| Field                | Type    | Default    | Description                                                                                       |
|----------------------|---------|------------|---------------------------------------------------------------------------------------------------|
| `keyword`            | String  | `"shrimp"` | Keyword to filter government recalls (e.g., `"peanut"`, `"airbag"`, `"metformin"`, `"Toyota"`).  |
| `max_results`        | Integer | `50`       | Maximum number of government recalls records to return.                                           |
| `proxyConfiguration` | Object  | `{}`       | Apify proxy configuration (e.g., `{ "proxyGroups": ["RESIDENTIAL"] }`).                          |

**Example input:**

```json
{
  "keyword": "shrimp",
  "max_results": 50,
  "proxyConfiguration": {
    "proxyGroups": ["RESIDENTIAL"],
    "apifyProxyCountry": "US"
  }
}
````

***

### Output

Each government recall is pushed as a separate dataset record with the following fields:

| Field          | Type   | Description                                                                             |
|----------------|--------|-----------------------------------------------------------------------------------------|
| `id`           | string | Unique government recalls ID (FDA recall number or NHTSA campaign number).              |
| `title`        | string | Descriptive title of the government recall.                                             |
| `agency`       | string | Issuing agency: `"FDA"` or `"NHTSA"`.                                                  |
| `category`     | string | Government recalls category: `"Food"`, `"Drug"`, `"Medical Device"`, or `"Vehicle"`.   |
| `company`      | string | Name of the recalling company or manufacturer.                                          |
| `product`      | string | Description of the recalled product.                                                    |
| `reason`       | string | Reason for the government recall.                                                       |
| `risk_level`   | string | FDA classification (e.g., `"Class I"`, `"Class II"`) or `"Medium"` for NHTSA recalls.  |
| `recall_date`  | string | Date the government recall was initiated.                                               |
| `country`      | string | Country of the government recall (always `"United States"`).                            |
| `state`        | string | U.S. state associated with the government recall (if available).                        |
| `city`         | string | City associated with the government recall (if available).                              |
| `status`       | string | Status of the government recall (e.g., `"Ongoing"`, `"Terminated"`).                   |
| `quantity`     | string | Number of units affected by the government recall.                                      |
| `distribution` | string | Distribution pattern of the government recalled product.                                |
| `source_url`   | string | Direct URL to the government recalls source page (FDA or NHTSA).                        |

**Example output:**

```json
{
  "id": "F-1234-2025",
  "title": "Frozen Shrimp Products - Food Recall",
  "agency": "FDA",
  "category": "Food",
  "company": "Ocean Harvest Seafood Inc.",
  "product": "Frozen Cooked Shrimp 2 lb bags",
  "reason": "Possible contamination with Listeria monocytogenes.",
  "risk_level": "Class I",
  "recall_date": "2025-03-10",
  "country": "United States",
  "state": "FL",
  "city": "Miami",
  "status": "Ongoing",
  "quantity": "12,500 cases",
  "distribution": "Nationwide",
  "source_url": "https://www.fda.gov/safety/recalls-market-withdrawals-safety-alerts"
}
```

***

### Government Recalls Sources

The Government Recalls Monitor fetches data from the following official APIs:

| Agency | Category       | API Endpoint                                    |
|--------|----------------|-------------------------------------------------|
| FDA    | Food           | `api.fda.gov/food/enforcement.json`             |
| FDA    | Drug           | `api.fda.gov/drug/enforcement.json`             |
| FDA    | Medical Device | `api.fda.gov/device/enforcement.json`           |
| NHTSA  | Vehicle        | `api.nhtsa.gov/recalls/recallsByVehicle`        |

***

### Supported Vehicle Brands (NHTSA)

The Government Recalls Monitor automatically queries NHTSA vehicle government recalls for the following brands:

Tesla, Ford, Toyota, Honda, Chevrolet, BMW, Nissan, Hyundai, Kia, Volkswagen, Mazda

***

### Use Cases

- **Consumer Safety** – Monitor government recalls for food, drugs, and products you use or sell.
- **Compliance Research** – Track FDA and NHTSA government recalls for regulatory compliance teams.
- **Supply Chain Monitoring** – Detect government recalls affecting your supply chain products.
- **Journalism & Reporting** – Investigate and report on government recalls trends and patterns.
- **Legal Research** – Gather government recalls data for product liability and legal cases.
- **Academic Research** – Collect structured government recalls data for public health or policy studies.
- **E-commerce** – Flag and remove government recalled products from online marketplaces.

***

### Quick Start

1. **Open on Apify** – Visit the actor page and click **Try for free**.
2. **Set Keyword** – Enter a keyword to filter government recalls (e.g., `"peanut butter"`, `"Honda"`, `"metformin"`).
3. **Set Limit** – Adjust `max_results` to control how many government recalls to fetch.
4. **Enable Proxy (Optional)** – Configure proxy groups for reliable government recalls fetching.
5. **Run the Actor** – Start the run and monitor progress in the logs.
6. **Download Results** – Export the government recalls dataset as JSON, CSV, or Excel.

***

### Technical Stack

- **Data Sources** – FDA Open API, NHTSA Recalls API (both free and public)
- **HTTP Client** – `requests` with optional proxy support
- **Keyword Matching** – Full-text search across product description, reason, and company fields
- **Deduplication** – Set-based unique recall ID tracking across all agencies
- **Sorting** – Date-descending sort on final government recalls results
- **Platform** – Apify Actor — serverless, scalable, integrated with Dataset and Key-Value Store

***

### Related Tools

| Actor | Description |
|-------|-------------|
| [Energy Market Notices & Reports](https://apify.com/store) | Aggregates energy market notices from EIA, Reuters, IEA, and more. |
| [TfL Transport Alerts Scraper](https://apify.com/store) | Extracts real-time transport alerts and disruptions from the TfL API. |
| [Meetup Event Scraper](https://apify.com/store) | Extracts meetup event listings from Meetup.com by keyword. |
| [Open Street Map Change Tracker](https://apify.com/store) | Extracts location and amenity data from OpenStreetMap via the Overpass API. |
| [SEC EDGAR Scraper](https://apify.com/store) | Retrieves company filings (10-K, 10-Q, 8-K) from SEC EDGAR. |
| [Product Launch Tracker](https://apify.com/store) | Tracks and extracts product launch data from Hacker News. |
| [Amazon Book Scraper](https://apify.com/store) | Scrapes book listings, prices, ratings, and metadata from Amazon. |

***

### Changelog

**v1.0.0 – Initial Release**

- Multi-agency government recalls fetching (FDA Food, Drug, Device + NHTSA)
- Keyword-based government recalls filtering across all agency endpoints
- Smart NHTSA routing based on car brand detection
- Deduplication by unique recall ID across all agencies
- Date-descending sorting of government recalls results
- Max results limit control
- Proxy configuration support
- Dataset integration with error handling per agency

***

### Pricing

- **Free** for basic usage on Apify (up to certain compute limits).
- **Paid plans** available for higher volume, priority support, and longer runs.
- Proxy credits consumed if residential proxies are enabled.

***

### Support & Feedback

- **Issues & Ideas** – Open a ticket on the Apify Actor issue tracker.
- **Documentation** – Visit [Apify Docs](https://docs.apify.com) for platform guides.
- **API Notes** – This actor uses the public FDA Open API and NHTSA Recalls API. No API key is required for basic government recalls access.

***

> **Disclaimer:** This actor accesses publicly available government recalls data from the FDA and NHTSA APIs. Please ensure your usage complies with each agency's terms of service. This actor is intended for research and informational purposes only.

# Actor input Schema

## `keyword` (type: `string`):

Enter product name or company (e.g., Tesla, Shrimp, Toy)

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

Limit of results to save

## `proxyConfiguration` (type: `object`):

Use Apify Proxy to avoid API rate limits.

## Actor input object example

```json
{
  "keyword": "shrimp",
  "max_items": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "keyword": "shrimp"
};

// Run the Actor and wait for it to finish
const run = await client.actor("datapilot/government-recalls-monitor").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 = { "keyword": "shrimp" }

# Run the Actor and wait for it to finish
run = client.actor("datapilot/government-recalls-monitor").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 '{
  "keyword": "shrimp"
}' |
apify call datapilot/government-recalls-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=datapilot/government-recalls-monitor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Government Recalls Monitor",
        "description": "Recall Alert Scraper collects product recalls from U.S. Food and Drug Administration and National Highway Traffic Safety Administration. It filters by keyword, extracts recall details, and outputs structured JSON for food, drug, medical device, and vehicle safety monitoring. 🚨📦",
        "version": "0.0",
        "x-build-id": "iSNfA46Eazhdht7zy"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/datapilot~government-recalls-monitor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-datapilot-government-recalls-monitor",
                "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/datapilot~government-recalls-monitor/runs": {
            "post": {
                "operationId": "runs-sync-datapilot-government-recalls-monitor",
                "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/datapilot~government-recalls-monitor/run-sync": {
            "post": {
                "operationId": "run-sync-datapilot-government-recalls-monitor",
                "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": [
                    "keyword"
                ],
                "properties": {
                    "keyword": {
                        "title": "Search Keyword",
                        "type": "string",
                        "description": "Enter product name or company (e.g., Tesla, Shrimp, Toy)"
                    },
                    "max_items": {
                        "title": "Max Results",
                        "type": "integer",
                        "description": "Limit of results to save",
                        "default": 50
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Use Apify Proxy to avoid API rate limits.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
