# FDA Enforcement Recalls (`lanternlab318/fda-recalls`) Actor

Collect structured U.S. FDA drug, food, and medical device recall enforcement reports from openFDA with classification and status filtering, deduplication, and explicit request limits.

- **URL**: https://apify.com/lanternlab318/fda-recalls.md
- **Developed by:** [Lantern Lab](https://apify.com/lanternlab318) (community)
- **Categories:** Open source
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.79 / 1,000 fda enforcement 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/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

## FDA Enforcement Recalls

Collect structured U.S. FDA drug, food, and medical device recall enforcement reports from the official openFDA API (`api.fda.gov`) with classification, status, and keyword filtering, deduplication, and explicit request and item caps.

### Quick start

```json
{
  "productTypes": [
    "drug"
  ],
  "search": "",
  "classification": "any",
  "status": "any",
  "maxItems": 3,
  "maxUpstreamRequests": 1
}
```

### Input and limits

`productTypes` accepts 1 to 3 openFDA enforcement endpoints: `drug`, `food`, and/or `device` (defaults to `["drug"]`). `search` accepts an optional free-text query phrase (sanitized before being sent to openFDA). `classification` filters by `any`, `Class I`, `Class II`, or `Class III`. `status` filters by `any`, `Ongoing`, `Completed`, or `Terminated`.

`maxItems` defaults to 100 (hard maximum 1,000 unique billable rows). `maxUpstreamRequests` defaults to 10 (hard maximum 50); every attempt including failed requests counts. Requests are sequential with 1.1-second pacing, 20-second per-request timeout, 5 MiB decoded response cap, and a 180-second collection budget (capped by the platform run timeout). Pagination follows openFDA's `meta.results.total` up to the openFDA `skip` limit of 25,000.

### Output and billing

Each `recall` row includes a stable `id` (`<productType>:<recallNumber || eventId>`), `recallNumber`, `eventId`, `productType`, `classification`, `status`, `recallingFirm`, `reasonForRecall`, `productDescription`, `productQuantity`, `distributionPattern`, `voluntaryMandated`, `initialFirmNotification`, `city`, `state`, `country`, `recallInitiationDate`, `centerClassificationDate`, `reportDate`, `terminationDate`, `sourceUrl`, and `collectedAt`.

#### Example output row

```json
{
  "recordType": "recall",
  "id": "drug:D-321-2016",
  "recallNumber": "D-321-2016",
  "eventId": "72241",
  "productType": "Drugs",
  "classification": "Class II",
  "status": "Terminated",
  "recallingFirm": "Kalman Health & Wellness, Inc. dba Essential Wellness Pharma",
  "reasonForRecall": "Lack of Assurance of Sterility: ...",
  "productDescription": "Progesterone 100 mg/mL in Corn Oil Injection, 2 mL vials...",
  "productQuantity": "1 vial",
  "distributionPattern": "Nationwide",
  "voluntaryMandated": "Voluntary: Firm initiated",
  "initialFirmNotification": "Letter",
  "city": "Peoria",
  "state": "IL",
  "country": "United States",
  "recallInitiationDate": "20150903",
  "centerClassificationDate": "20151117",
  "reportDate": "20151125",
  "terminationDate": "20171229",
  "sourceUrl": "https://api.fda.gov/drug/enforcement.json?limit=3&skip=0",
  "collectedAt": "2026-11-23T00:00:00.000Z"
}
```

Only unique real `recall` rows use the `recall` billing event. When openFDA returns HTTP 404 (`NOT_FOUND`) for a query with zero matches, the Actor records a free `missing_value` row rather than failing the run. Free `input_status` rows and `run_summary` / `RUN_SUMMARY` in the key-value store record results, charged rows, requests, duplicates, missing queries, failures, and stop reason.

### Source and scope

Official public API: `https://api.fda.gov/<productType>/enforcement.json`

Data is provided by openFDA (`https://open.fda.gov/terms/`). Do not rely on openFDA to make decisions regarding medical care.

# Actor input Schema

## `productTypes` (type: `array`):

One to three openFDA enforcement product endpoints to query: drug, food, or device.

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

Optional free-text search phrase applied to openFDA enforcement records (for example, sterility or hand sanitizer). Leave blank to collect without a text filter.

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

Filter enforcement reports by FDA hazard class (Class I, Class II, Class III), or keep all classes with any.

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

Filter enforcement reports by recall status (Ongoing, Completed, Terminated), or keep all statuses with any.

## `maxItems` (type: `integer`):

Stop after this many unique real recall rows. Status and missing-value rows are free.

## `maxUpstreamRequests` (type: `integer`):

Hard cap on all upstream request attempts, including failed requests.

## Actor input object example

```json
{
  "productTypes": [
    "drug"
  ],
  "search": "",
  "classification": "any",
  "status": "any",
  "maxItems": 3,
  "maxUpstreamRequests": 1
}
```

# Actor output Schema

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

No description

## `runSummary` (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 = {
    "productTypes": [
        "drug"
    ],
    "search": "",
    "classification": "any",
    "status": "any",
    "maxItems": 3,
    "maxUpstreamRequests": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("lanternlab318/fda-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 = {
    "productTypes": ["drug"],
    "search": "",
    "classification": "any",
    "status": "any",
    "maxItems": 3,
    "maxUpstreamRequests": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("lanternlab318/fda-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 '{
  "productTypes": [
    "drug"
  ],
  "search": "",
  "classification": "any",
  "status": "any",
  "maxItems": 3,
  "maxUpstreamRequests": 1
}' |
apify call lanternlab318/fda-recalls --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lanternlab318/fda-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/cW5SWVzlaaLGUxcr7/builds/9Tkx5fjdEuac4SrJz/openapi.json
