# openFDA API — Food Recall Records Export (`tugelbay/openfda-recall-safety-monitor`) Actor

Use the openFDA API to search food enforcement records and export recall numbers, classifications, status, dates, firms, reasons, products, and distribution as JSON or CSV.

- **URL**: https://apify.com/tugelbay/openfda-recall-safety-monitor.md
- **Developed by:** [Tugelbay Konabayev](https://apify.com/tugelbay) (community)
- **Categories:** Automation, News, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.40 / 1,000 openfda recall 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/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

**openFDA API for food recall records export.** Search official food enforcement data and export normalized records through the Apify API, schedules, webhooks, or dataset downloads. This Actor covers one public endpoint for research and internal review queues; it is not an FDA service and must not be used for public recall alerts or authoritative lifecycle tracking.

Actor ID `openfda-recall-safety-monitor` is a stable legacy identifier. The product scope is food enforcement search and export only, not a stored alert-history or safety-certification service.

![Food recall records flowing through the openFDA API into structured rows](https://konabayev.com/images/apify-actors/openfda-food-recall-api.webp)

### Why use this Actor

- Recall number, product description, and recall reason
- Classification, status, report date, and classification date
- Recalling firm, country, and distribution pattern
- Source-backed AccessData URL and retrieval timestamp
- JSON, CSV, Excel, XML, RSS, and API access through Apify datasets

Use it for food recall research, importer or retailer review queues, compliance triage, and scheduled enforcement snapshots. It does not cover drug or medical-device endpoints.

### Quick start

1. Add one or more valid openFDA food enforcement search expressions.
2. Choose a per-query result limit from 1 to 100.
3. Run the Actor and download the dataset or read it through the Apify API.

```json
{
  "queries": ["status:\"Ongoing\""],
  "maxItems": 10
}
````

Each query must use valid [openFDA search syntax](https://open.fda.gov/apis/query-syntax/). Add up to 20 search expressions and request 1–100 records per expression.

### Example output

```json
{
  "recordType": "result",
  "query": "status:\"Ongoing\"",
  "sourceId": "H-1138-2026",
  "title": "Smoked Sausage Spice 32.86#",
  "description": "Undeclared sesame allergen",
  "status": "Ongoing",
  "url": "https://www.accessdata.fda.gov/scripts/ires/?Product=H-1138-2026",
  "publishedAt": "2026-07-15T00:00:00.000Z",
  "metadata": {
    "classification": "Class I",
    "recallingFirm": "Adams Flavors, Foods & Ingredients",
    "distributionPattern": "Texas",
    "country": "United States"
  },
  "sourceName": "openFDA Food Enforcement"
}
```

The example is a public enforcement record. Fields can be absent when openFDA does not publish them.

### Input

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `queries` | string\[] | Yes | Valid openFDA food enforcement search expressions. Up to 20. |
| `maxItems` | integer | No | Records stored per search expression, from 1 to 100. Default: 25. |
| `canaryMode` | boolean | No | Returns one no-network release-status row for deterministic platform QA. |

Useful expressions include:

```text
status:"Ongoing"
classification:"Class I"
recalling_firm:"Company Name"
```

### Output data contract

Each row uses the stable fields `recordType`, `query`, `sourceId`, `title`, `description`, `status`, `url`, `publishedAt`, `updatedAt`, `metrics`, `metadata`, `sourceName`, `sourceUrl`, `retrievedAt`, and `releaseState`.

The `OUTPUT` record in the default key-value store reports the item count, empty-query count, network use, release state, and any mandatory notice.

### Automate it

- Run recurring food enforcement snapshots with Apify Schedules
- Trigger downstream research workflows with webhooks
- Read the dataset from the Apify API
- Export to JSON, CSV, Excel, or another supported dataset format

For a buyer-focused guide and integration examples, see the [openFDA Food Recall API page](https://konabayev.com/tools/openfda-food-recall-api/?utm_source=apify\&utm_medium=store-readme\&utm_campaign=openfda-food-recall-api).

### Limitations and responsible use

- Source: [openFDA food enforcement API](https://api.fda.gov/food/enforcement.json)
- Responsible-use guidance: [openFDA food enforcement documentation](https://open.fda.gov/apis/food/enforcement/)
- API documentation: [openFDA APIs](https://open.fda.gov/apis/)
- Query syntax: [openFDA query syntax](https://open.fda.gov/apis/query-syntax/)
- Terms: [openFDA API terms](https://open.fda.gov/apis/terms/)
- Food enforcement records only
- Public-domain/CC0 source data
- Informational output; no diagnosis, causality assessment, or medical advice
- Do not use enforcement data to issue public alerts or track a recall lifecycle. openFDA notes that a published status may remain unchanged after classification; verify current recall information through official FDA notices.
- The FDA name and marks are not used to imply endorsement; this is an independent product using public openFDA data
- HTTPS source hosts are allowlisted; responses, retries, and timeouts are bounded
- Empty searches produce an explicit `emptyResult` row and are not charged

### API comparison

| Option | Best for | Important boundary |
| --- | --- | --- |
| Direct openFDA API | Custom source queries and application-specific handling | You own normalization, storage, retries, and downstream exports |
| This Actor | Bounded searches with normalized Apify datasets and automation | Research only; not public alerting or authoritative recall lifecycle tracking |

Use scheduled queries for internal research snapshots only. For current public recall information, consult official FDA notices instead of treating these enforcement records as an alert or lifecycle system.

### Validation evidence

On 2026-07-23, the bounded source canary returned 10 complete food enforcement records from 17,816 reported matches. On 2026-07-24, actor-specific live QA returned five non-empty records from the deployed build.

### Pricing

The primary pay-per-event charge is `result-item`.

- List price: **$0.002 per successfully stored source record**
- Apify plan tiers: $0.0018, $0.0016, or $0.0014 per record
- Canary, empty-result, and failed rows are not charged
- Maximum valid input: 20 queries × 100 records = 2,000 source records, or **$4.00 maximum list-price PPE charge per run**
- Duplicate query strings are removed before requests; if the same source record matches two different queries, each stored row is charged

Apify platform compute charges and plan credits are shown separately by Apify.

### Support

For a reproducible issue, include the public search expression, expected behavior, run ID, and the relevant public enforcement record. Do not send medical or patient information.

### FAQ

#### Is this an FDA drug or device API?

No. It covers the openFDA food enforcement endpoint only.

#### Does this provide medical advice?

No. It normalizes public enforcement records for research and operational workflows.

#### Can I use it for public recall alerts or lifecycle tracking?

No. The official openFDA food enforcement documentation says this data should not be used to issue public alerts or track a recall lifecycle, and a published status may remain unchanged after classification. Use it for research and internal triage, then verify current information through official FDA notices.

#### Can it monitor recalls?

You can schedule repeated research snapshots and compare datasets downstream. The Actor does not maintain a historical diff database and must not be treated as an authoritative alert or lifecycle service.

# Actor input Schema

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

Valid openFDA food enforcement search expressions, such as status:"Ongoing". Maximum 20.

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

Maximum food enforcement records to store for each search expression.

## `canaryMode` (type: `boolean`):

Return one release-status record without sending a source request.

## Actor input object example

```json
{
  "queries": [
    "status:\"Ongoing\""
  ],
  "maxItems": 5,
  "canaryMode": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing normalized results and explicit empty or release-gate rows.

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

Key-value-store record containing source, release, item, empty-query, and network metrics.

# 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 = {
    "queries": [
        "status:\"Ongoing\""
    ],
    "maxItems": 5,
    "canaryMode": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("tugelbay/openfda-recall-safety-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 = {
    "queries": ["status:\"Ongoing\""],
    "maxItems": 5,
    "canaryMode": False,
}

# Run the Actor and wait for it to finish
run = client.actor("tugelbay/openfda-recall-safety-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 '{
  "queries": [
    "status:\\"Ongoing\\""
  ],
  "maxItems": 5,
  "canaryMode": false
}' |
apify call tugelbay/openfda-recall-safety-monitor --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "openFDA API — Food Recall Records Export",
        "description": "Use the openFDA API to search food enforcement records and export recall numbers, classifications, status, dates, firms, reasons, products, and distribution as JSON or CSV.",
        "version": "0.1",
        "x-build-id": "VOoNDMo5o2paRRo4i"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/tugelbay~openfda-recall-safety-monitor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-tugelbay-openfda-recall-safety-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/tugelbay~openfda-recall-safety-monitor/runs": {
            "post": {
                "operationId": "runs-sync-tugelbay-openfda-recall-safety-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/tugelbay~openfda-recall-safety-monitor/run-sync": {
            "post": {
                "operationId": "run-sync-tugelbay-openfda-recall-safety-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": [
                    "queries"
                ],
                "properties": {
                    "queries": {
                        "title": "openFDA search expressions",
                        "minItems": 1,
                        "maxItems": 20,
                        "type": "array",
                        "description": "Valid openFDA food enforcement search expressions, such as status:\"Ongoing\". Maximum 20.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxItems": {
                        "title": "Results per query",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Maximum food enforcement records to store for each search expression.",
                        "default": 25
                    },
                    "canaryMode": {
                        "title": "No-network release canary",
                        "type": "boolean",
                        "description": "Return one release-status record without sending a source request.",
                        "default": false
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
