# FDA Drug Intelligence (`foxk1996/fda-drug-intel`) Actor

Export openFDA drug intelligence records for recalls/enforcement, adverse events, and FDA approvals by drug name, company, and date range. Public API, no login, no proxies.

- **URL**: https://apify.com/foxk1996/fda-drug-intel.md
- **Developed by:** [Kronos Fox](https://apify.com/foxk1996) (community)
- **Categories:** Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$20.00 / 1,000 record scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are 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.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.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/platform/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

## FDA Drug Intelligence

FDA Drug Intelligence is an Apify actor for exporting structured openFDA drug records without logins, proxies, or scraping brittle web pages. It queries the public api.fda.gov endpoints and turns recalls, adverse event reports, and Drugs@FDA approval applications into flat dataset rows that are ready for regulatory monitoring, QA triage, competitive intelligence, and spreadsheet workflows.

### Drug enforcement and recall intelligence

Use the `enforcement` dataset to monitor FDA drug recalls and enforcement records by product term, recalling firm, and report date range. Each output row includes recall status, classification, recall number, report date, product description, reason for recall, recalling firm, geography, product quantity, and openFDA brand/generic/manufacturer fields when present. This is useful for QA teams, pharma regulatory operations, supplement sellers, distributors, and ecommerce operators who need to know when a product category or supplier appears in FDA enforcement activity.

### Adverse event reports by drug name

Use the `adverse_events` dataset to export FAERS-style openFDA drug event reports. Search by medicinal product name, optional company term, and receipt date. Rows include safety report ID, seriousness flags, country, patient age/sex fields when provided, primary drug name, active substances, brand/generic/manufacturer names, reaction terms, and drug counts. These reports are public safety reports, not proof of causation; treat them as signals for review rather than medical conclusions.

### FDA approval and application records

Use the `approvals` dataset for Drugs@FDA application records. Search by brand/generic drug name, sponsor name, and submission status date. Rows include application number, sponsor, product brand/generic fields, dosage form, route, marketing status, reference drug/standard indicators, latest submission status, product count, and submission count. This mode helps market researchers and regulatory teams compare sponsors, product forms, and approval history.

### What you get

Every run writes clean Apify dataset rows with a consistent `dataset`, `type`, `recordId`, source label, and normalized fields for the selected mode. The actor uses only HTTP public endpoints, adds a descriptive User-Agent for the government API, applies request timeouts, waits politely between paged requests, pushes error rows instead of crashing on one bad record, and enforces `maxResults` exactly.

### How to use

Choose one `dataset`: `enforcement`, `adverse_events`, or `approvals`. Add a drug name such as `aspirin`, `metformin`, `ibuprofen`, or a brand name like `Advil`. Optionally add a company or sponsor and a start/end date in `YYYY-MM-DD` format. The default input is intentionally small and should finish in under five minutes. An openFDA API key is optional and only needed for higher rate limits.

### Pricing

This actor is designed for Apify pay-per-event monetization. Configure one paid event named `record-scraped` at $0.02 per output record. Local or non-PPE runs are capped to protect free usage.

### FAQ

**Does this process payments or private medical data?** No. It only reads public openFDA API records.

**Can I search all datasets at once?** No. Pick one dataset per run so results have a predictable schema.

**Are adverse events medical proof?** No. They are public reports and should be reviewed by qualified staff before action.

**Why did I get no results?** openFDA search terms are literal. Try a broader drug name, remove the company filter, or widen the date range.

# Actor input Schema

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

Which openFDA drug dataset to export: enforcement recalls, adverse event reports, or FDA approval records.
## `drugName` (type: `string`):

Drug name or product term to search for, such as aspirin, metformin, ibuprofen, or Advil. Leave empty to search only by company and date filters.
## `company` (type: `string`):

Optional company, labeler, manufacturer, recall firm, or sponsor name filter. Examples: Pfizer, Teva, Johnson, or Bayer.
## `startDate` (type: `string`):

Optional start date in YYYY-MM-DD or YYYYMMDD format. Applies to report_date for recalls, receiptdate for adverse events, and submission_status_date for approvals.
## `endDate` (type: `string`):

Optional end date in YYYY-MM-DD or YYYYMMDD format. Must be on or after Start date when both are provided.
## `maxResults` (type: `integer`):

Maximum number of records to output. The actor enforces this cap exactly even if openFDA returns more records.
## `apiKey` (type: `string`):

Optional openFDA API key for higher rate limits. The actor works without a key for small runs.

## Actor input object example

```json
{
  "dataset": "enforcement",
  "drugName": "aspirin",
  "startDate": "2024-01-01",
  "endDate": "2024-12-31",
  "maxResults": 25
}
````

# 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 = {
    "dataset": "enforcement",
    "drugName": "aspirin",
    "company": "",
    "startDate": "2024-01-01",
    "endDate": "2024-12-31",
    "maxResults": 25,
    "apiKey": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("foxk1996/fda-drug-intel").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 = {
    "dataset": "enforcement",
    "drugName": "aspirin",
    "company": "",
    "startDate": "2024-01-01",
    "endDate": "2024-12-31",
    "maxResults": 25,
    "apiKey": "",
}

# Run the Actor and wait for it to finish
run = client.actor("foxk1996/fda-drug-intel").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 '{
  "dataset": "enforcement",
  "drugName": "aspirin",
  "company": "",
  "startDate": "2024-01-01",
  "endDate": "2024-12-31",
  "maxResults": 25,
  "apiKey": ""
}' |
apify call foxk1996/fda-drug-intel --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=foxk1996/fda-drug-intel",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "FDA Drug Intelligence",
        "description": "Export openFDA drug intelligence records for recalls/enforcement, adverse events, and FDA approvals by drug name, company, and date range. Public API, no login, no proxies.",
        "version": "0.1",
        "x-build-id": "CMR2NXhkwRoSrtxSh"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/foxk1996~fda-drug-intel/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-foxk1996-fda-drug-intel",
                "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/foxk1996~fda-drug-intel/runs": {
            "post": {
                "operationId": "runs-sync-foxk1996-fda-drug-intel",
                "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/foxk1996~fda-drug-intel/run-sync": {
            "post": {
                "operationId": "run-sync-foxk1996-fda-drug-intel",
                "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": [
                    "dataset",
                    "maxResults"
                ],
                "properties": {
                    "dataset": {
                        "title": "Dataset",
                        "enum": [
                            "enforcement",
                            "adverse_events",
                            "approvals"
                        ],
                        "type": "string",
                        "description": "Which openFDA drug dataset to export: enforcement recalls, adverse event reports, or FDA approval records.",
                        "default": "enforcement"
                    },
                    "drugName": {
                        "title": "Drug name",
                        "type": "string",
                        "description": "Drug name or product term to search for, such as aspirin, metformin, ibuprofen, or Advil. Leave empty to search only by company and date filters."
                    },
                    "company": {
                        "title": "Company / sponsor",
                        "type": "string",
                        "description": "Optional company, labeler, manufacturer, recall firm, or sponsor name filter. Examples: Pfizer, Teva, Johnson, or Bayer."
                    },
                    "startDate": {
                        "title": "Start date",
                        "type": "string",
                        "description": "Optional start date in YYYY-MM-DD or YYYYMMDD format. Applies to report_date for recalls, receiptdate for adverse events, and submission_status_date for approvals."
                    },
                    "endDate": {
                        "title": "End date",
                        "type": "string",
                        "description": "Optional end date in YYYY-MM-DD or YYYYMMDD format. Must be on or after Start date when both are provided."
                    },
                    "maxResults": {
                        "title": "Maximum records",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum number of records to output. The actor enforces this cap exactly even if openFDA returns more records.",
                        "default": 25
                    },
                    "apiKey": {
                        "title": "openFDA API key",
                        "type": "string",
                        "description": "Optional openFDA API key for higher rate limits. The actor works without a key for small runs."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
