# Openfda Device Recall Extractor (`jeeves_is_my_copilot/openfda-device-recall-extractor`) Actor

Public data actor with normalized output.

- **URL**: https://apify.com/jeeves\_is\_my\_copilot/openfda-device-recall-extractor.md
- **Developed by:** [Alexander Abernathy](https://apify.com/jeeves_is_my_copilot) (community)
- **Categories:** Business, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 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 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

## OpenFDA Device Recall Extractor

[![Apify Actor](https://apify.com/actor-badge?actor=jeeves_is_my_copilot/openfda-device-recall-extractor)](https://apify.com/jeeves_is_my_copilot/openfda-device-recall-extractor)

> **Status:** ✅ **Working** - Uses official OpenFDA public API

### Best for

This actor queries the [OpenFDA Device Recall API](https://api.fda.gov/) to fetch medical device recall records including safety alerts, enforcement actions, and recall classifications.

### API Endpoint

- **Base URL:** `https://api.fda.gov`
- **Recalls Endpoint:** `/device/enforcement.json`
- **Documentation:** https://open.fda.gov/apis/device/enforcement/

### Capabilities

- Search by device name, product type, or keywords
- Filter by recall class (A, B, C)
- Returns normalized recall records with all FDA enforcement data

### Input

| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| `queries` | string\[] | Yes | - | List of device names, manufacturers, or keywords |
| `maxItemsPerQuery` | number | No | 100 | Maximum number of recall records per query |
| `recallClass` | string | No | "" | Filter by recall class: "A", "B", or "C" |
| `includeRaw` | boolean | No | false | Attach raw API response to each record |

### Example input

```json
{
  "queries": ["defibrillator", "pacemaker"],
  "maxItemsPerQuery": 100,
  "recallClass": "A",
  "includeRaw": false
}
```

### Output

| Field | Type | Description |
|-------|------|-------------|
| `source` | string | Always "openfda-device-recall" |
| `query` | string | The original search query |
| `recordType` | string | Always "medical\_device\_recall" |
| `title` | string | Company name + recall number |
| `identifier` | string | FDA recall number |
| `date` | string | Recall event date |
| `url` | string | FDA enforcement page URL |
| `summary` | string | Human-readable summary |
| `recallingFirm` | string | Company that issued recall |
| `recallClass` | string | Recall class (A, B, or C) |
| `recallStatus` | string | Current status (Terminated, Ongoing, etc.) |
| `productTypes` | array\[] | List of recalled products |
| `recallReasons` | array\[] | List of reasons for recall |
| `raw` | object | (Optional) Raw API response |

### Example output

```json
{
  "source": "openfda-device-recall",
  "query": "defibrillator",
  "recordType": "medical_device_recall",
  "title": "Boston Scientific - 2019-2168-1",
  "identifier": "2019-2168-1",
  "date": "2019-11-15",
  "url": "https://www.fda.gov/safety/recalls",
  "summary": "Boston Scientific (2019-2168-1) - Class A (most serious), Ongoing. Products: Implantable defibrillators. Reason: Battery depletion",
  "recallingFirm": "Boston Scientific Corporation",
  "recallClass": "A",
  "recallStatus": "Ongoing",
  "productTypes": ["Cardiac Rhythm Management Devices"],
  "recallReasons": ["Battery may deplete earlier than expected"]
}
```

### Recall Classifications

- **Class A:** Reasonable probability that use will cause serious adverse health consequences or death
- **Class B:** Remote probability of serious adverse health consequences but possible
- **Class C:** Unlikely to cause adverse health consequences

### Notes

- **Rate Limits:** OpenFDA allows ~15 requests/minute per IP
- **Data Freshness:** FDA data is updated regularly but may have slight delays
- **Search Limitations:** Query syntax must follow OpenFDA rules
- **No Pagination:** Use query terms to refine results; max 1000 per request

#### Additional notes

Run `npm run check` to verify syntax:

```bash
npm run check
```

#### Additional notes

- OpenFDA Device Enforcement API: https://api.fda.gov/device/enforcement.json
- FDA Recalls: https://www.fda.gov/safety/recalls

### Pricing

This actor uses the [Apify Pay-Per-Event](https://apify.com/pricing) model at **$0.002 per dataset item**.

**Example cost:** 1,000 items ≈ $2 in actor charges (plus standard Apify platform compute).

# Actor input Schema

## `queries` (type: `array`):

List of device names, manufacturers, or recall classes to search.

## `maxItemsPerQuery` (type: `integer`):

Maximum number of recall records to return per query.

## `recallClass` (type: `string`):

Filter by recall class: A, B, or C (optional).

## `includeRaw` (type: `boolean`):

If true, attach the raw API response to each output item.

## Actor input object example

```json
{
  "queries": [
    "defibrillator"
  ],
  "maxItemsPerQuery": 100,
  "recallClass": "A",
  "includeRaw": false
}
```

# 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("jeeves_is_my_copilot/openfda-device-recall-extractor").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("jeeves_is_my_copilot/openfda-device-recall-extractor").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 '{}' |
apify call jeeves_is_my_copilot/openfda-device-recall-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=jeeves_is_my_copilot/openfda-device-recall-extractor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/TYROl6eDSUzrkZblq/builds/D7vfsKj6L1SLK4Z66/openapi.json
