# openFDA Scraper (`anyxsolutions/openfda-scraper`) Actor

Scrape openFDA: drug, device and food recalls, FAERS and MAUDE adverse-event reports, drug labels with boxed warnings, Drugs@FDA approvals and 510(k) clearances. Search by keyword, query or date and get one clean row per record. No login, no proxy, API key optional.

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

## Pricing

from $2.50 / 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?

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

![banner](https://anyx.solutions/banners/openfda-scraper.png)

## openFDA Scraper

**FDA recalls, adverse-event reports, drug labels, drug approvals and 510(k) clearances from openFDA, searchable by keyword and date, as clean JSON.**

openFDA is the US Food and Drug Administration's public data service: millions of records on the
drugs, medical devices and foods sold in the United States. This Actor turns it into a dataset.
Pick one of nine FDA datasets, type search terms such as a drug, device, firm or ingredient, add a
date range or an openFDA query, and get one row per record, newest first: drug, device and food
recalls with their class, status, reason, firm and distribution; drug adverse-event reports
(FAERS) with seriousness, patient age and sex, the drugs involved and each reaction's outcome;
medical-device reports (MAUDE) with the devices, problems and event narrative; food, supplement
and cosmetic adverse-event reports (CAERS); drug labels with the boxed warning, indications,
dosage, contraindications, warnings, adverse reactions and interactions; Drugs@FDA applications
with their products, approval date and every submission with its letters and labels; and 510(k)
device clearances with their decision. Every row keeps the full FDA record too. No login and no
proxy; an API key is optional. Built for pharmacovigilance and drug-safety teams, regulatory
affairs and quality, medical-device and food-safety compliance, competitive intelligence on
products and manufacturers, healthcare analysts, journalists and researchers.

### ⚡ Quick start

```json
{
  "dataset": "drug/enforcement",
  "searchTerms": ["metformin"],
  "maxItems": 5
}
```

Or every serious Ozempic adverse-event report received in 2025:

```json
{
  "dataset": "drug/event",
  "searchTerms": ["ozempic"],
  "searchQuery": "serious:1",
  "dateFrom": "2025-01-01",
  "dateTo": "2025-12-31",
  "maxItems": 1000
}
```

### 🧩 Input

| Field                | Type    | Required | Default                      | Description                                                                                                                                                                                      |
| -------------------- | ------- | -------- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `dataset`            | string  | no       | `"drug/enforcement"`         | The FDA dataset to search (see the table below).                                                                                                                                                 |
| `searchTerms`        | array   | no       | —                            | Words to look for, one search per line, such as `metformin` or `insulin pump`. Each is matched as a phrase in the dataset's main text (see the table below).                                     |
| `searchQuery`        | string  | no       | —                            | Optional openFDA query syntax, combined with every search term, such as `classification:"Class I" AND state:CA`. Without search terms it runs as a search of its own.                            |
| `dateFrom`           | string  | no       | —                            | Only records on or after this date (`YYYY-MM-DD`), on the dataset's main date.                                                                                                                   |
| `dateTo`             | string  | no       | —                            | Only records on or before this date (`YYYY-MM-DD`), on the dataset's main date.                                                                                                                  |
| `maxItems`           | integer | no       | —                            | Maximum number of records per search term, query or start URL, newest first. The input form starts at 5; leave it empty to get every match.                                                      |
| `startUrls`          | array   | no       | —                            | Public FDA pages to look up: a device recall, 510(k), MAUDE report or Drugs@FDA application on accessdata.fda.gov, or a DailyMed label or search page. Each record page returns that one record. |
| `apiKey`             | string  | no       | —                            | Optional free openFDA API key. Raises openFDA's daily limit from 1,000 to 120,000 requests.                                                                                                      |
| `proxyConfiguration` | object  | no       | `{ "useApifyProxy": false }` | Proxy settings. openFDA needs no proxy.                                                                                                                                                          |

With no search terms, query or start URL, the Actor returns the newest records of the whole
dataset, narrowed by the date range if you set one.

**Datasets.** Each search term is matched as a phrase in the fields listed here, and the date range
applies to the date shown:

| `dataset`          | Records                                                      | Search terms match                                            | Dates filter on      |
| ------------------ | ------------------------------------------------------------ | ------------------------------------------------------------- | -------------------- |
| `drug/enforcement` | Drug recalls (FDA enforcement reports)                       | Product description, reason for recall, recalling firm        | Report date          |
| `drug/event`       | Drug adverse-event reports (FAERS)                           | Drug name, brand and generic names, reaction terms            | Date FDA received it |
| `drug/label`       | Drug labels (structured product labels)                      | Brand, generic and substance names, manufacturer, indications | Effective date       |
| `drug/drugsfda`    | Drug approvals (Drugs@FDA applications)                      | Brand names, active ingredients, sponsor                      | Submission date      |
| `device/event`     | Medical-device adverse-event reports (MAUDE)                 | Device brand and generic names, manufacturer                  | Date FDA received it |
| `device/recall`    | Medical-device recalls                                       | Product description, reason for recall, firm, device name     | Date posted          |
| `device/510k`      | 510(k) premarket clearances                                  | Device name, applicant                                        | Decision date        |
| `food/enforcement` | Food recalls (FDA enforcement reports)                       | Product description, reason for recall, recalling firm        | Report date          |
| `food/event`       | Food, dietary supplement and cosmetic adverse events (CAERS) | Product name, industry, reaction terms                        | Date created         |

**openFDA queries.** `searchQuery` takes openFDA's own syntax, field by field, so any field of a
record can be filtered, for example `classification:"Class I"` and `status:Ongoing` for recalls,
`patient.patientsex:2` or `occurcountry:US` for drug reports, `openfda.product_type:"HUMAN OTC DRUG"`
for labels, or `decision_code:SESE` for 510(k)s. Join conditions with `AND`, `OR` and `NOT`.

### 📤 Output

Each FDA record is one dataset row. Every row has `dataset`, `id`, `url`, `title`, `date` and
`raw`; the other fields depend on the dataset, as listed below. Fields a record does not have are
`null` (or an empty list), and `raw` always holds the complete FDA record with every field.

#### Fields

| Field                   | Type    | Description                                                                                                                                                                                                                                               |
| ----------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `dataset`               | string  | The dataset the record comes from, such as `drug/enforcement`.                                                                                                                                                                                            |
| `id`                    | string  | The record's FDA identifier: recall number, report ID, label set ID, application number or K number.                                                                                                                                                      |
| `url`                   | string  | The record's public FDA page (device recall, MAUDE report, DailyMed label, Drugs@FDA or 510(k) page), or the dataset's openFDA page when FDA has none per record.                                                                                         |
| `title`                 | string  | A short label: the product, drug or device and, for reports, what happened.                                                                                                                                                                               |
| `date`                  | string  | The record's main date (the one `dateFrom` and `dateTo` filter on), `YYYY-MM-DD`.                                                                                                                                                                         |
| `raw`                   | object  | The full openFDA record, unchanged.                                                                                                                                                                                                                       |
| `recallNumber`          | string  | Recalls: FDA recall number, such as `D-0657-2026`.                                                                                                                                                                                                        |
| `eventId`               | string  | Recalls: the recall event the product belongs to.                                                                                                                                                                                                         |
| `status`                | string  | Recalls: `Ongoing`, `Terminated`, `Completed`, or a device recall's status.                                                                                                                                                                               |
| `classification`        | string  | Drug and food recalls: `Class I`, `Class II` or `Class III`.                                                                                                                                                                                              |
| `productType`           | string  | Recalls: `Drugs`, `Food`, `Devices`. Labels: such as `HUMAN PRESCRIPTION DRUG`.                                                                                                                                                                           |
| `productDescription`    | string  | Recalls: the recalled product as FDA describes it.                                                                                                                                                                                                        |
| `productCode`           | string  | Device recalls and 510(k)s: FDA product code.                                                                                                                                                                                                             |
| `productQuantity`       | string  | Recalls: quantity recalled.                                                                                                                                                                                                                               |
| `codeInfo`              | string  | Recalls: lots, serial numbers and expiry dates affected.                                                                                                                                                                                                  |
| `reasonForRecall`       | string  | Recalls: why the product was recalled.                                                                                                                                                                                                                    |
| `rootCause`             | string  | Device recalls: the firm's root cause.                                                                                                                                                                                                                    |
| `action`                | string  | Device recalls: what the firm told customers to do.                                                                                                                                                                                                       |
| `recallingFirm`         | string  | Recalls: the firm recalling the product.                                                                                                                                                                                                                  |
| `city`                  | string  | Recalls and 510(k)s: the firm's city.                                                                                                                                                                                                                     |
| `state`                 | string  | Recalls and 510(k)s: the firm's state.                                                                                                                                                                                                                    |
| `country`               | string  | Recalls and 510(k)s: the firm's country.                                                                                                                                                                                                                  |
| `distributionPattern`   | string  | Recalls: where the product was distributed.                                                                                                                                                                                                               |
| `voluntaryMandated`     | string  | Drug and food recalls: whether the recall was voluntary or FDA-mandated.                                                                                                                                                                                  |
| `recallInitiationDate`  | string  | Recalls: when the recall started, `YYYY-MM-DD`.                                                                                                                                                                                                           |
| `reportDate`            | string  | Recalls: when FDA published it (device recalls: date posted), `YYYY-MM-DD`.                                                                                                                                                                               |
| `terminationDate`       | string  | Recalls: when the recall was closed, `YYYY-MM-DD`.                                                                                                                                                                                                        |
| `brandNames`            | array   | Brand names (labels, approvals, and recalls FDA has linked to a product).                                                                                                                                                                                 |
| `genericNames`          | array   | Generic names (labels, approvals, and linked recalls).                                                                                                                                                                                                    |
| `deviceName`            | string  | Device recalls and 510(k)s: the device's name.                                                                                                                                                                                                            |
| `deviceClass`           | string  | Device recalls and 510(k)s: FDA device class, `1`, `2` or `3`.                                                                                                                                                                                            |
| `kNumbers`              | array   | Device recalls: the 510(k) clearances of the recalled device.                                                                                                                                                                                             |
| `safetyReportId`        | string  | Drug reports: the FAERS safety report ID.                                                                                                                                                                                                                 |
| `receiveDate`           | string  | Reports and 510(k)s: when FDA received it, `YYYY-MM-DD`.                                                                                                                                                                                                  |
| `serious`               | boolean | Drug reports: whether the report is serious.                                                                                                                                                                                                              |
| `seriousOutcomes`       | array   | Drug reports: `Death`, `Life threatening`, `Hospitalization`, `Disability`, `Congenital anomaly`, `Other serious`.                                                                                                                                        |
| `reporterQualification` | string  | Drug reports: who reported it, such as `Physician` or `Consumer or non-health professional`.                                                                                                                                                              |
| `reporterCountry`       | string  | Drug reports: the reporter's country code.                                                                                                                                                                                                                |
| `occurCountry`          | string  | Drug reports: where the event happened, as a country code.                                                                                                                                                                                                |
| `patientSex`            | string  | Reports: the patient's sex.                                                                                                                                                                                                                               |
| `patientAge`            | number  | Reports: the patient's age, in `patientAgeUnit`.                                                                                                                                                                                                          |
| `patientAgeUnit`        | string  | Reports: `years`, `months`, `weeks`, `days`, `hours` or `decades`.                                                                                                                                                                                        |
| `patientWeightKg`       | number  | Drug reports: the patient's weight in kilograms.                                                                                                                                                                                                          |
| `drugs`                 | array   | Drug reports: each drug with `name`, `role` (Suspect, Concomitant, Interacting), `indication`, `activeSubstance`, `dosage`, `brandNames`, `genericNames`, `manufacturers`.                                                                                |
| `reactions`             | array   | Drug and food reports: each reaction with its MedDRA `term` and, for drug reports, its `outcome` (such as `Recovered/resolved` or `Fatal`).                                                                                                               |
| `eventDate`             | string  | Food and device reports: when the event happened, `YYYY-MM-DD`.                                                                                                                                                                                           |
| `outcomes`              | array   | Food and device reports: outcomes such as `Hospitalization` or `Required Intervention`.                                                                                                                                                                   |
| `products`              | array   | Food reports: each product with `name`, `role`, `industryCode`, `industryName`. Approvals: each product with `productNumber`, `brandName`, `activeIngredients` (`name`, `strength`), `dosageForm`, `route`, `marketingStatus`, `referenceDrug`, `teCode`. |
| `reportNumber`          | string  | Device reports: the MDR report number.                                                                                                                                                                                                                    |
| `eventType`             | string  | Device reports: `Malfunction`, `Injury`, `Death` or `Other`.                                                                                                                                                                                              |
| `reportSource`          | string  | Device reports: who filed it, such as `Manufacturer report`.                                                                                                                                                                                              |
| `eventLocation`         | string  | Device reports: where it happened, such as `HOSPITAL`.                                                                                                                                                                                                    |
| `manufacturer`          | string  | Device reports, labels and approvals: the manufacturer.                                                                                                                                                                                                   |
| `productProblems`       | array   | Device reports: device problems, such as `Incorrect Measurement`.                                                                                                                                                                                         |
| `devices`               | array   | Device reports: each device with `brandName`, `genericName`, `manufacturer`, `modelNumber`, `catalogNumber`, `lotNumber`, `productCode`, `deviceName`, `deviceClass`, `udi`.                                                                              |
| `eventDescription`      | string  | Device reports: the description of the event or problem.                                                                                                                                                                                                  |
| `manufacturerNarrative` | string  | Device reports: the manufacturer's narrative.                                                                                                                                                                                                             |
| `version`               | string  | Labels: the label version.                                                                                                                                                                                                                                |
| `effectiveDate`         | string  | Labels: the label's effective date, `YYYY-MM-DD`.                                                                                                                                                                                                         |
| `routes`                | array   | Labels: routes of administration, such as `ORAL`.                                                                                                                                                                                                         |
| `substanceNames`        | array   | Labels: active substances.                                                                                                                                                                                                                                |
| `pharmacologicClasses`  | array   | Labels: established pharmacologic classes, such as `GLP-1 Receptor Agonist [EPC]`.                                                                                                                                                                        |
| `productNdcs`           | array   | Labels: product NDC codes.                                                                                                                                                                                                                                |
| `applicationNumbers`    | array   | Labels: the NDA, ANDA or BLA numbers the label belongs to.                                                                                                                                                                                                |
| `boxedWarning`          | string  | Labels: the boxed ("black box") warning.                                                                                                                                                                                                                  |
| `indications`           | string  | Labels: indications and usage.                                                                                                                                                                                                                            |
| `dosage`                | string  | Labels: dosage and administration.                                                                                                                                                                                                                        |
| `contraindications`     | string  | Labels: contraindications.                                                                                                                                                                                                                                |
| `warnings`              | string  | Labels: warnings and precautions.                                                                                                                                                                                                                         |
| `adverseReactions`      | string  | Labels: adverse reactions.                                                                                                                                                                                                                                |
| `drugInteractions`      | string  | Labels: drug interactions.                                                                                                                                                                                                                                |
| `applicationNumber`     | string  | Approvals: NDA, ANDA or BLA number, such as `NDA209637`.                                                                                                                                                                                                  |
| `sponsorName`           | string  | Approvals: the application's sponsor.                                                                                                                                                                                                                     |
| `approvalDate`          | string  | Approvals: when the original application was approved, `YYYY-MM-DD`.                                                                                                                                                                                      |
| `latestSubmissionDate`  | string  | Approvals: the latest submission's status date, `YYYY-MM-DD`.                                                                                                                                                                                             |
| `submissions`           | array   | Approvals: submissions newest first, each with `type`, `number`, `status`, `statusDate`, `classCode`, `classDescription`, `reviewPriority` and `documents` (letters, labels, reviews with `type`, `date`, `url`).                                         |
| `kNumber`               | string  | 510(k)s: the K number, such as `K253470`.                                                                                                                                                                                                                 |
| `applicant`             | string  | 510(k)s: the company that applied.                                                                                                                                                                                                                        |
| `contact`               | string  | 510(k)s: the applicant's contact person.                                                                                                                                                                                                                  |
| `decisionDate`          | string  | 510(k)s: decision date, `YYYY-MM-DD`.                                                                                                                                                                                                                     |
| `decisionCode`          | string  | 510(k)s: decision code, such as `SESE`.                                                                                                                                                                                                                   |
| `decisionDescription`   | string  | 510(k)s: the decision, such as `Substantially Equivalent`.                                                                                                                                                                                                |
| `clearanceType`         | string  | 510(k)s: `Traditional`, `Special` or `Abbreviated`.                                                                                                                                                                                                       |
| `advisoryCommittee`     | string  | 510(k)s: the reviewing panel, such as `Clinical Chemistry`.                                                                                                                                                                                               |
| `regulationNumber`      | string  | 510(k)s: the device regulation number, such as `880.5730`.                                                                                                                                                                                                |

<details><summary>Example output</summary>

```json
{
  "dataset": "drug/enforcement",
  "id": "D-0657-2026",
  "url": "https://open.fda.gov/apis/drug/enforcement/",
  "title": "Synjardy XR Tablets (empagliflozin and metformin hydrochloride extended-release tablets), 12.5/1000 mg, 60 Tablets per…",
  "date": "2026-07-08",
  "recallNumber": "D-0657-2026",
  "eventId": "99233",
  "status": "Ongoing",
  "classification": "Class II",
  "productType": "Drugs",
  "productDescription": "Synjardy XR Tablets (empagliflozin and metformin hydrochloride extended-release tablets), 12.5/1000 mg, 60 Tablets per Bottle, Rx only, Distributed by: Boehringer Ingelheim Pharmaceuticals, Inc., Ridgefield, CT 06877 USA.  NDC: 00597-0300-45",
  "productCode": null,
  "productQuantity": "560 bottles",
  "codeInfo": "Lot 3244413; Exp. 12/31/2028",
  "reasonForRecall": "CGMP Deviations: An incorrect detergent was used and the required swab sampling was not performed on a production hopper that had previously been used for a different product.",
  "rootCause": null,
  "action": null,
  "recallingFirm": "Boehringer Ingelheim Pharmaceuticals, Inc.",
  "city": "Ridgefield",
  "state": "CT",
  "country": "United States",
  "distributionPattern": "OH",
  "voluntaryMandated": "Voluntary: Firm initiated",
  "recallInitiationDate": "2026-06-12",
  "reportDate": "2026-07-08",
  "terminationDate": null,
  "brandNames": [],
  "genericNames": [],
  "deviceName": null,
  "deviceClass": null,
  "kNumbers": [],
  "raw": {
    "status": "Ongoing",
    "city": "Ridgefield",
    "state": "CT",
    "country": "United States",
    "classification": "Class II",
    "openfda": {},
    "product_type": "Drugs",
    "event_id": "99233",
    "recalling_firm": "Boehringer Ingelheim Pharmaceuticals, Inc.",
    "address_1": "900 Ridgebury Rd",
    "address_2": "N/A",
    "postal_code": "06877-1058",
    "voluntary_mandated": "Voluntary: Firm initiated",
    "initial_firm_notification": "Letter",
    "distribution_pattern": "OH",
    "recall_number": "D-0657-2026",
    "product_description": "Synjardy XR Tablets (empagliflozin and metformin hydrochloride extended-release tablets), 12.5/1000 mg, 60 Tablets per Bottle, Rx only, Distributed by: Boehringer Ingelheim Pharmaceuticals, Inc., Ridgefield, CT 06877 USA.  NDC: 00597-0300-45",
    "product_quantity": "560 bottles",
    "reason_for_recall": "CGMP Deviations: An incorrect detergent was used and the required swab sampling was not performed on a production hopper that had previously been used for a different product.",
    "recall_initiation_date": "20260612",
    "center_classification_date": "20260630",
    "report_date": "20260708",
    "code_info": "Lot 3244413; Exp. 12/31/2028"
  }
}
```

</details>

### 💡 Use cases

- **Pharmacovigilance and drug safety** — pull every FAERS report on your products or a competitor's, with seriousness, reactions and outcomes, for signal detection.
- **Recall monitoring** — a daily feed of new Class I drug, device and food recalls, by product, firm or ingredient, for quality, supply-chain and retail compliance.
- **Medical-device surveillance** — track MAUDE malfunction and injury reports and device recalls for a product code or manufacturer.
- **Regulatory and competitive intelligence** — follow Drugs@FDA approvals, label changes, new boxed warnings and 510(k) clearances in a therapy area.
- **Label analysis** — compare indications, dosing, contraindications and warnings across every label of an ingredient.
- **Research and journalism** — build datasets on drug safety, recalls and approvals, and feed FDA text into search, RAG and LLM pipelines.

### ❓ FAQ

- **Is this data reliable enough for medical decisions?** No. openFDA states that its data must not be relied on to make decisions about medical care: treat every record as unvalidated. An adverse-event report does not prove that a product caused the event, and report counts cannot be used to estimate how often an event happens.
- **Do I need an openFDA account or API key?** No. Without a key, openFDA allows 1,000 requests a day per IP address; each request returns up to 1,000 recalls, approvals or 510(k)s, or 50 to 100 labels and reports. For larger runs, get a free key at open.fda.gov and enter it in `apiKey` to raise the limit to 120,000 a day.
- **Do I need a proxy?** No. It runs without one by default.
- **How are results ordered?** Newest first, by the dataset's main date, so `maxItems` keeps the most recent records.
- **Why is `url` the same for every recall or drug report?** FDA publishes no public page per drug or food recall, FAERS report or CAERS report, so those rows link to the dataset's openFDA page. Device recalls, MAUDE reports, labels, approvals and 510(k)s link to their own FDA or DailyMed page.
- **Can I search one field only?** Yes. Leave `searchTerms` empty and write the condition in `searchQuery`, for example `recalling_firm:"Pfizer"` or `patient.drug.openfda.generic_name:"semaglutide"`.
- **Can I paste FDA recall announcements?** No. FDA press releases do not map to a record. Search the recalled product or firm instead, or paste the record page of a device recall, 510(k), MAUDE report, Drugs@FDA application or DailyMed label.
- **Why are brand and generic names empty on some recalls?** FDA links only some recalls to a product listing. The product is always in `productDescription`.

### 🔗 More scrapers by Anyx

- [PubMed Scraper](https://apify.com/anyxsolutions/pubmed-scraper)
- [Federal Register Scraper](https://apify.com/anyxsolutions/federal-register-scraper)
- [SEC EDGAR Scraper](https://apify.com/anyxsolutions/sec-edgar-scraper)
- [USAspending Scraper](https://apify.com/anyxsolutions/usaspending-scraper)

### 🤝 Anyx Solutions

We build custom scrapers and data-extraction pipelines.

- Email: tantosthor@gmail.com

### 🖼 Image credit

Image credit: [open.fda.gov](https://open.fda.gov/)

# Actor input Schema

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

The FDA dataset to search: drug, device or food recalls, drug, device or food adverse-event reports, drug labels, Drugs@FDA approvals, or 510(k) device clearances.

## `searchTerms` (type: `array`):

Words to look for, one search per line, for example metformin or insulin pump. Each is matched as a phrase in the dataset's main text: product, reason and firm for recalls; drug names and reactions for drug reports; brand, generic and manufacturer names for labels and approvals; device names and makers for device reports and 510(k)s; product names and reactions for food reports.

## `searchQuery` (type: `string`):

Optional openFDA query syntax, combined with every search term, for example classification:"Class I" AND state:CA, or patient.patientsex:2 for drug reports. Without search terms it runs as a search of its own.

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

Only records on or after this date, for example 2024-01-01. It applies to the dataset's main date: report date for recalls, date received for adverse events, effective date for labels, submission date for approvals and decision date for 510(k)s.

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

Only records on or before this date, for example 2025-12-31, on the same date field as the from date.

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

Maximum number of records to return per search term, query or start URL, newest first. Leave empty to get every match.

## `startUrls` (type: `array`):

Optional public pages to look up, for example a device recall (https://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfRES/res.cfm?id=30043), a 510(k), a MAUDE report or a Drugs@FDA application on accessdata.fda.gov, or a DailyMed label or search page. Each record page returns that one openFDA record; FDA press releases and recall announcements are not supported.

## `apiKey` (type: `string`):

Optional. Your free openFDA API key from open.fda.gov, for example a 40-character key. Without one openFDA allows 1,000 requests a day per IP address; with one, 120,000 a day.

## `proxyConfiguration` (type: `object`):

Proxy settings. openFDA needs no proxy; the Actor keeps to openFDA's request rate.

## Actor input object example

```json
{
  "dataset": "drug/enforcement",
  "searchTerms": [
    "metformin"
  ],
  "maxItems": 5,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "searchTerms": [
        "metformin"
    ],
    "maxItems": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("anyxsolutions/openfda-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 = {
    "searchTerms": ["metformin"],
    "maxItems": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("anyxsolutions/openfda-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 '{
  "searchTerms": [
    "metformin"
  ],
  "maxItems": 5
}' |
apify call anyxsolutions/openfda-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,anyxsolutions/openfda-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/irjbvXb8vo6nI3y9S/builds/fpnbapfTdswghqfty/openapi.json
