# FDA NDC Directory Scraper - Drug Products (`antishock/fda-ndc-drug-products-scraper`) Actor

Extract US drug products from the FDA National Drug Code directory: brand and generic name, labeler, dosage form, route, active ingredients with strength, marketing category, application number, package NDCs and DailyMed label link. Filter by ingredient, labeler, dosage form and route. No API key.

- **URL**: https://apify.com/antishock/fda-ndc-drug-products-scraper.md
- **Developed by:** [Ryan Zinburg](https://apify.com/antishock) (community)
- **Categories:** Business, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 result exporteds

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

## FDA NDC Directory Scraper - US Drug Product Database

Extract the **National Drug Code directory**, the FDA's list of every drug product marketed in the United States: brand and generic name, labeler, dosage form, route, active ingredients with strength, marketing dates and package codes.

Public openFDA source, no API key required, no proxy needed.

### What you get per product

| Field | Example |
|---|---|
| `productNdc` | 0002-1433 |
| `brandName`, `genericName` | Trulicity, dulaglutide |
| `labelerName` | Eli Lilly and Company |
| `productType` | HUMAN PRESCRIPTION DRUG, HUMAN OTC DRUG |
| `dosageForm` | INJECTION, SOLUTION |
| `routes` | \["SUBCUTANEOUS"] |
| `activeIngredients` | \["DULAGLUTIDE 1.5 mg/0.5mL"] |
| `ingredientNames`, `ingredientCount` | normalised ingredient list |
| `marketingCategory` | NDA, ANDA, OTC monograph |
| `applicationNumber` | NDA125469 |
| `marketingStartDate`, `marketingEndDate`, `listingExpirationDate` | lifecycle dates |
| `packageNdcs`, `packageDescriptions`, `packageCount` | every package size |
| `pharmClasses` | established pharmacologic classes |
| `labelUrl` | link to the DailyMed label |

### Search filters

- **brandName** - e.g. `Trulicity`
- **genericName** - e.g. `dulaglutide`
- **activeIngredient** - ingredient name, e.g. `metformin hydrochloride`
- **labeler** - manufacturer or labeler, e.g. `Teva`
- **dosageForm** - e.g. `TABLET`, `INJECTION, SOLUTION`
- **route** - e.g. `ORAL`, `INTRAVENOUS`
- **productType** - prescription, OTC or other
- **marketingCategory** - e.g. `NDA`, `ANDA`, `OTC MONOGRAPH DRUG`
- **productNdc** - look up one specific product code
- **maxResults** - up to 5000 products per run

### Example input

```json
{
  "genericName": "metformin hydrochloride",
  "productType": "HUMAN PRESCRIPTION DRUG",
  "maxResults": 500
}
```

### Use cases

- **Pharmacy and formulary management** - build a current product list per ingredient with all package codes
- **Generic competition analysis** - see how many labelers market the same molecule and since when
- **Healthcare data integration** - map NDC codes to names, strengths and dosage forms
- **Market entry research** - check which dosage forms and routes already exist for an ingredient
- **Supply chain and procurement** - resolve package NDCs to product details
- **Regulatory research** - trace products back to their NDA or ANDA application number

### Why the NDC directory

Listing a drug product with the FDA is mandatory before it can be marketed in the United States, so the NDC directory is the authoritative product master. openFDA republishes it with normalised fields and daily updates, free for any use.

### Notes

- The directory lists products, not packages. One product can carry several package NDCs, all included in `packageNdcs`.
- `marketingEndDate` is only present for products that have been withdrawn or delisted.
- openFDA refuses offsets beyond 25 000 records; narrow the filters to reach deeper.

# Actor input Schema

## `brandName` (type: `string`):

Marketed brand name, e.g. Trulicity.

## `genericName` (type: `string`):

Generic drug name, e.g. metformin hydrochloride.

## `activeIngredient` (type: `string`):

Active ingredient name.

## `labeler` (type: `string`):

Labeler or manufacturer, e.g. Teva.

## `dosageForm` (type: `string`):

e.g. TABLET, CAPSULE, INJECTION, SOLUTION.

## `route` (type: `string`):

e.g. ORAL, INTRAVENOUS, TOPICAL.

## `productType` (type: `string`):

Prescription, over the counter or other.

## `marketingCategory` (type: `string`):

e.g. NDA, ANDA, OTC MONOGRAPH DRUG, BLA.

## `productNdc` (type: `string`):

Look up one product code, e.g. 0002-1433.

## `maxResults` (type: `integer`):

How many products to save.

## Actor input object example

```json
{
  "genericName": "metformin hydrochloride",
  "productType": "ALL",
  "maxResults": 100
}
```

# Actor output Schema

## `results` (type: `string`):

Scraped records in the default dataset.

# 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 = {
    "genericName": "metformin hydrochloride",
    "maxResults": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("antishock/fda-ndc-drug-products-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 = {
    "genericName": "metformin hydrochloride",
    "maxResults": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("antishock/fda-ndc-drug-products-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 '{
  "genericName": "metformin hydrochloride",
  "maxResults": 100
}' |
apify call antishock/fda-ndc-drug-products-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,antishock/fda-ndc-drug-products-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/hSb9UArfaKDxQAMHU/builds/jLsQio7dD9pascicX/openapi.json
