# openFDA Recalls, Enforcement & Adverse Events (`j0401/openfda-compliance`) Actor

Search the U.S. openFDA public feeds in one actor: device, food and drug recalls and enforcement reports, device PMAs, food and drug adverse events. Filter by firm, state, classification, product or date; aggregate enforcement corpora by any facet. No API key.

- **URL**: https://apify.com/j0401/openfda-compliance.md
- **Developed by:** [Wenhao Yang](https://apify.com/j0401) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.03 / 1,000 openfda compliance records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## openFDA Recalls, Enforcement & Adverse Events

Seven public FDA datasets in one actor: **20,692,690 drug adverse-event
reports**, **151,589 food adverse events**, **59,494 device recall records**,
**57,278 device premarket approvals**, and **87,744 recall enforcement
reports** across devices (40,249), food (29,485) and drugs (18,010). Counts
measured from the live API on **20 October 2026**.

Each record carries the recall or approval identity, dates, classification,
status, firm, product description, reason, location and the source link.

### Low cost

**From $0.00005 per record, down to $0.00003 at Gold.** Pay only for the
records you receive.

### What you get

| field | meaning |
|---|---|
| `corpus` | which FDA dataset the row came from |
| `recordId` | recall number, product recall number, PMA number or report number |
| `reportDate`, `eventDate` | published and event dates |
| `classification` | `Class I`, `Class II`, `Class III` (enforcement), `Serious` / `Non-serious` (drug events), grade where published |
| `status` | `Ongoing` / `Terminated`, recall status, PMA decision code, or event outcome |
| `productType`, `productDescription` | device / drug, or the food industry, and the product |
| `reason` | reason for recall, root cause, adverse reactions |
| `firm` | recalling firm or PMA applicant (enforcement, recall and PMA corpora; blank for adverse events) |
| `city`, `state`, `country`, `postalCode` | firm location (enforcement, recall and PMA corpora; blank for adverse events) |
| `distribution`, `quantity`, `eventId`, `notification`, `action` | recall depth where published |
| `sourceUrl`, `refreshedDate` | FDA endpoint and its last-updated date |

### Search it

- **Keyword** - free text across firm, product and reason.
- **Firm** - `firm="Medtronic"`.
- **Class** - `classification="Class I"` for the most serious recalls.
- **Status** - `status="Ongoing"` or `"Terminated"`.
- **Geography** - `state="MA"`, `country="United States"`.
- **Date window** - `dateFrom` / `dateTo` (`YYYY-MM-DD`).
- **Drug adverse events** - `serious="Serious"`.

### Example inputs

**Device recalls from one firm**

```json
{ "corpus": "device-enforcement", "firm": "Medtronic", "maxResults": 25 }
```

**Class I recalls in a date window**

```json
{ "corpus": "device-enforcement", "classification": "Class I",
  "dateFrom": "2025-01-01", "maxResults": 50 }
```

**Food adverse events for a product**

```json
{ "corpus": "food-event", "keyword": "gummy", "dateFrom": "2025-01-01" }
```

**Serious drug adverse events mentioning aspirin**

```json
{ "corpus": "drug-event", "keyword": "aspirin", "serious": "Serious",
  "dateFrom": "2025-01-01", "maxResults": 25 }
```

**Premarket approvals for one applicant**

```json
{ "corpus": "device-pma", "firm": "Abbott", "maxResults": 25 }
```

**Counts by class** - `mode=aggregate`.

```json
{ "mode": "aggregate", "corpus": "device-enforcement",
  "groupBy": "classification" }
```

**Counts by state** - `groupBy=state`, `country`, `status` or `productType`.

```json
{ "mode": "aggregate", "corpus": "food-enforcement",
  "groupBy": "state" }
```

### Example output

Long text fields are trimmed here; real rows carry the full source value.

```json
{
 "corpus": "device-enforcement",
 "recordId": "Z-2372-2023",
 "reportDate": "2023-08-23",
 "eventDate": "2023-06-28",
 "classification": "Class I",
 "status": "Ongoing",
 "productType": "Devices",
 "productDescription": "MAHURKAR 12 Fr High Pressure Triple Lumen Acute Dialysis Catheter",
 "reason": "Catheter center lumen was found to have an occlusion",
 "action": "Letter",
 "firm": "Covidien LP",
 "city": "Mansfield",
 "state": "MA",
 "country": "United States",
 "postalCode": "02048-1113",
 "eventId": "92660",
 "notification": "Voluntary: Firm initiated",
 "sourceUrl": "https://api.fda.gov/device/enforcement.json",
 "refreshedDate": "2026-10-07"
}
```

### Notes on the data, from the source

- **Aggregation covers the three enforcement corpora** (device, food, drug).
  The recall, PMA and adverse-event corpora support search only.
- **Paging limit.** One query can return at most 25,000 records; `maxResults`
  above that is rejected rather than silently clamped. Add a date window or a
  more specific filter to cover a larger set.
- **No ordering.** The API does not expose a sort control, so search returns
  the source's own order. Use a date window and `maxResults` for a bounded
  result.
- **Adverse events are de-identified.** Patient demographics, narratives and
  reporter details are not returned. Drug event records carry the product,
  reactions, outcome, seriousness classification and dates; food event records
  carry the product, reactions, outcome and dates. `firm` and location are
  blank on both; food events also leave `classification` blank.
- **Not medical advice.** openFDA states that results are unvalidated and must
  not be relied on for clinical decisions.
- **Licence.** openFDA data is a U.S. Government work in the public domain.

Data source: `api.fda.gov` (U.S. Food and Drug Administration).

# Actor input Schema

## `corpus` (type: `string`):

device/food/drug-enforcement = recall enforcement reports; device-recall = device recall events; device-pma = premarket approvals; food-event / drug-event = adverse event reports.

## `mode` (type: `string`):

search = matching records. aggregate = one row per group (enforcement corpora only). Leave blank to auto-route: filters -> search, no filters -> aggregate.

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

Free text over firm, product description and reason (case-insensitive).

## `firm` (type: `string`):

Recalling firm or PMA applicant, e.g. "Medtronic".

## `reason` (type: `string`):

Text inside the reason-for-recall field (device, food and drug enforcement corpora).

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

FDA enforcement class (the three enforcement corpora only). Class I is the most serious.

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

Enforcement: Ongoing / Completed / Terminated. Device recall: recall status. Device PMA: decision code (e.g. OK30).

## `state` (type: `string`):

Two-letter US state of the firm, e.g. "MA".

## `country` (type: `string`):

Firm country as published, e.g. "United States".

## `productType` (type: `string`):

Enforcement corpora only: Devices / Food / Drugs.

## `serious` (type: `string`):

Drug adverse events only: filter serious vs non-serious reports.

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

Inclusive lower bound on the corpus date field (report, event, decision or date posted, depending on the corpus).

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

Inclusive upper bound on the corpus date field.

## `groupBy` (type: `string`):

Enforcement corpora only. Blank defaults to classification.

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

Cap the number of search records pushed (0 = the default 50, maximum 25000). Aggregate returns every group.

## Actor input object example

```json
{
  "corpus": "device-enforcement",
  "maxResults": 50
}
```

# Actor output Schema

## `recordsUrl` (type: `string`):

openFDA compliance records - as JSON

## `datasetUrl` (type: `string`):

No description

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

// Run the Actor and wait for it to finish
const run = await client.actor("j0401/openfda-compliance").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("j0401/openfda-compliance").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 j0401/openfda-compliance --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,j0401/openfda-compliance"
        }
    }
}
```

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/GolXbzlQsbD9pd4EN/builds/BQN94yjlS4WVHkSyR/openapi.json
