# openFDA Food Adverse Events Scraper (`parseforge/openfda-food-events-scraper`) Actor

Scrapes food adverse event reports from the openFDA CAERS database using Lucene search queries. Returns each report as a flat row with product details, reactions, and outcomes.

- **URL**: https://apify.com/parseforge/openfda-food-events-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** News, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $19.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.
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?

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

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)](https://apify.com/parseforge?fpr=vmoqkp)

### openFDA Food Adverse Events Scraper

**Scrape food adverse event reports from the openFDA CAERS database, filtered by product name, brand, or reaction.** Every report includes the food product, patient symptoms, outcomes, and submission dates. No API key required. Export to CSV, JSON, Excel, or XML.

The FDA's CFSAN Adverse Event Reporting System (CAERS) holds millions of reports about suspected food-related illnesses and allergic reactions, but the openFDA portal only lets you browse a few pages at a time. This Actor reads the public openFDA API directly, runs your Lucene search query across the entire CAERS database, and returns every matching report in one flat dataset.\n\nYou can search by brand name, product category, specific symptoms like NAUSEA or HEADACHE, or any indexed field. Set a cap from 1 to 1,000,000 events per run.

| Who uses it | What they scrape openFDA for |
|---|---|
| Food safety researchers | Monitor emerging signals in supplement and functional food categories across multi-year windows. |
| Consumer advocacy groups | Identify which branded products appear most often in serious adverse event reports. |
| Regulatory consultants | Pull the full CAERS history for a specific ingredient before a GRAS or NDI submission. |
| Data journalists | Build a timeline of reported reactions linked to a recalled product or outbreak. |

### What it does

This Actor collects food adverse event reports from the openFDA CAERS endpoint and returns each report as a flat row with product details, reactions, outcomes, and report metadata.

- 🔍 **Lucene search queries:** use openFDA's full query syntax on fields like products.name\_brand, reactions, or date\_started.
- 📊 **Flat row output:** every report is one row, ready for pivot tables, time-series charts, or a database import.
- ⚙️ **Configurable volume:** pull as few as 1 event for a quick check or up to 1,000,000 for a complete archive.
- 🔑 **No registration needed:** the openFDA API is public and keyless, so you start scraping immediately.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with openFDA data

**🥜 Monitor a supplement brand.**

A food safety consultant runs a search for products.name\_brand:"Brand X" every month to flag any new serious outcomes before a client's annual safety review.

**🤢 Track specific symptoms.**

A researcher queries reactions:"ANAPHYLACTIC REACTION" across all products for the last five years to study underreporting patterns in food allergy data.

**📅 Build a regulatory timeline.**

A law firm pulls every CAERS report mentioning a recalled ingredient and sorts by date\_started to establish when the FDA first received signals.

**📈 Compare product categories.**

An analyst runs separate searches for energy drinks, protein powders, and herbal teas, then compares the most frequent reactions in each category.

### Why choose this scraper

|  | What you get |
|---|---|
| **No API key or OAuth** | openFDA is a public service; paste a query and run. |
| **Full CAERS schema** | Every field the API returns lands in your dataset with no column dropped. |
| **Large-volume friendly** | Set maxItems up to 1,000,000 and let the paginator handle the rest. |
| **Export anywhere** | CSV, JSON, Excel, and XML are built into the Apify platform. |

### How it compares

This Actor focuses exclusively on the openFDA CAERS food adverse events endpoint with a simple two-field input, while the competitors below cover broader FDA datasets or add AI scoring.

| Feature | ParseForge | 💊 OpenFDA Drug Intelligence | 💊 FDA Intelligence | openFDA Food Adverse Events Scraper |
|---|---|---|---|---|
| CAERS food adverse events | Yes | Not listed | Not listed | Yes |
| Lucene search query input | Yes | Not listed | Not listed | Not listed |
| No API key required | Yes | Yes | Not listed | Yes |
| Configurable max items per run | Yes | Not listed | Not listed | Not listed |
| AI severity scoring | Not listed | Yes | Not listed | Not listed |
| Drug adverse events (FAERS) | Not listed | Yes | Yes | Not listed |
| Device recalls and approvals | Not listed | Not listed | Yes | Not listed |

### Configure the run

Drive the Actor with an openFDA Lucene search query and a maximum event count; the search runs server-side so only matching reports count toward your limit. The Input tab lists every parameter.

A first run with the defaults:

```json
{
  "maxItems": 10
}
```

A larger pull:

```json
{
  "maxItems": 200
}
```

### Pricing

Pay-per-result: **$0.021 per result** collected. You pay only for the results written to your dataset.

| Results collected | Approximate cost |
|---|---|
| 100 results | $2.10 |
| 1,000 results | $21.00 |
| 10,000 results | $210.00 |

New Apify accounts start with $5 in free credit.

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [openFDA Food Adverse Events Scraper](https://apify.com/parseforge/openfda-food-events-scraper?fpr=vmoqkp).
3. Set your inputs and any filters, then click **Start**.
4. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to openFDA through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com/?tools=parseforge/openfda-food-events-scraper"
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**Why am I getting zero results?**

Check your Lucene query syntax. Field names are case-sensitive and use a colon, not an equals sign. Try a simpler query first, like reactions:"NAUSEA", to confirm the connection works.

**The run stopped before reaching my maxItems limit.**

The openFDA API returns a total match count in its metadata. If your query matches fewer reports than your maxItems value, the Actor stops when it has fetched every available match.

**Some fields are empty in my dataset.**

CAERS reports are submitted voluntarily and many fields are optional. A blank cell means the reporter did not provide that information, not that the Actor failed to extract it.

**My search query returns an error.**

Escape special Lucene characters like colons inside values. For example, a brand name with a colon needs a backslash before it. Test your query on the openFDA website first if you are unsure.

**The run is taking a long time.**

Large queries pulling hundreds of thousands of reports will take time because the Actor paginates respectfully. Reduce maxItems or narrow your search query with additional filters to speed it up.

### FAQ

| Question | Answer |
|---|---|
| What is the openFDA CAERS database? | CAERS is the CFSAN Adverse Event Reporting System, where the FDA collects voluntary and mandatory reports of suspected food-related illnesses, allergic reactions, and other adverse events. openFDA makes this data available through a public, keyless API. |
| Do I need an API key or FDA account? | No. The openFDA API is completely public and does not require registration, an API key, or OAuth. You can start scraping immediately. |
| How do I write a search query? | Use openFDA Lucene syntax in the 'search' input field. For example, products.name\_brand:"peanut butter" searches by brand name, and reactions:"NAUSEA" filters by reported symptom. Leave the field blank to fetch the newest reports. |
| What fields does each report contain? | Each row includes the product name, brand, industry code, patient reactions, outcomes (e.g., hospitalization), report submission date, and the unique report number. The exact schema is visible in the sample output on the Actor's page. |
| Can I search by date range? | Yes. Use the date\_started field in your Lucene query, for example date\_started:\[20230101 TO 20231231], to limit results to a specific year or window. |
| How many reports can I pull in one run? | You can set maxItems anywhere from 1 to 1,000,000. The Actor paginates through the openFDA API automatically until it hits your limit or exhausts the result set. |
| Is this the same as the FDA FAERS drug database? | No. FAERS covers drug adverse events. This Actor scrapes CAERS, which covers food, dietary supplements, and cosmetic products. For drug data, use a FAERS-specific scraper. |
| What export formats are supported? | You can export your dataset in CSV, JSON, Excel, or XML directly from the Apify platform after the run completes. |
| Can I schedule this to run automatically? | Yes. Apify supports scheduled runs. Set this Actor to run daily or weekly with a fixed query to monitor new adverse event reports as they appear. |
| Does this Actor handle the openFDA rate limit? | The Actor respects the openFDA API's response headers and pauses between requests automatically. For very large pulls, the run may take longer but will complete without being blocked. |

### Related actors

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by U.S. Food and Drug Administration. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

# Actor input Schema

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

How many food adverse events to collect per run.

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

openFDA Lucene search query. Examples: products.name\_brand:"peanut butter", reactions:"NAUSEA". Leave blank for newest.

## Actor input object example

```json
{
  "maxItems": 10
}
```

# Actor output Schema

## `results` (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 = {
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/openfda-food-events-scraper").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 = { "maxItems": 10 }

# Run the Actor and wait for it to finish
run = client.actor("parseforge/openfda-food-events-scraper").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 '{
  "maxItems": 10
}' |
apify call parseforge/openfda-food-events-scraper --silent --output-dataset

```

## MCP server setup

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

```

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/X5BwBrzzktG3zwtUV/builds/BkUg9dTTSR4MnAIcc/openapi.json
