# openFDA Drug NDC Directory Scraper (`parseforge/openfda-drug-ndc-scraper`) Actor

Export the National Drug Code (NDC) Directory from openFDA. Search 135k+ marketed products by NDC, brand name, generic name, or manufacturer. Pull product NDC, labeler, dosage form, route, active ingredients, packaging, and pharm class.

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

## Pricing

from $12.00 / 1,000 result items

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.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

![ParseForge Banner](https://github.com/ParseForge/apify-assets/blob/ad35ccc13ddd068b9d6cba33f323962e39aed5b2/banner.jpg?raw=true)

## 🏷️ openFDA Drug NDC Directory Scraper

> 🚀 **Export the official FDA National Drug Code directory in seconds.** Pull **140,000+ marketed drug products** filtered by NDC, brand, generic name, manufacturer, or product type. No login, no daily quota juggling, no schema guesswork.

> 🕒 **Last updated:** 2026-05-22 · **📊 28 fields** per record · **💊 140,000+ products** · **🏷️ NDC, RxCUI, UNII** · **🏭 thousands of labelers**

The **openFDA Drug NDC Directory Scraper** exports the National Drug Code (NDC) Directory and returns **28 fields per record**, including product NDC, brand and generic names, labeler, dosage form, route, active ingredients with strength, packaging, pharmacologic class, and cross-reference identifiers such as RxCUI, UNII, and SPL. The NDC directory is the canonical reference for every drug marketed in the United States.

The catalog covers **prescription drugs, over-the-counter drugs, vaccines, bulk ingredients, plasma derivatives, and allergenics**. This Actor turns the live directory into a downloadable dataset as CSV, Excel, JSON, or XML in under five minutes. Filtering happens at source, so you skip the paging and field-name spelunking entirely.

| 🎯 Target Audience | 💡 Primary Use Cases |
|---|---|
| Pharmacy IT, healthcare apps, EHR vendors, formulary teams, drug-data engineers, claims-processing teams, telehealth platforms | Drug autocomplete, NDC-to-RxCUI mappings, label lookups, formulary builds, OTC vs Rx classification, dosage and route reference data, claims edits |

---

### 📋 What the openFDA Drug NDC Directory Scraper does

Five filtering workflows in a single run:

- 🏷️ **NDC filter.** Pull one product by exact NDC code, e.g. `80489-001`.
- 🏷️ **Brand filter.** Restrict to a brand (proprietary) name, e.g. Tylenol, Lipitor.
- 💊 **Generic filter.** Restrict to a generic (non-proprietary) name, e.g. acetaminophen, atorvastatin.
- 🏭 **Manufacturer filter.** Substring match on the labeler or manufacturer company name.
- 🗂️ **Product-type filter.** Prescription drug, OTC drug, vaccine, bulk ingredient, plasma derivative, cellular therapy, or allergenic.

Each record includes the product NDC and ID, brand name (and brand-name base), generic name, labeler and manufacturer, dosage form, route, marketing category, application number, active ingredients with strength, packaging breakdown, pharmacologic class (broad + EPC + PE), and RxCUI / UNII / NUI cross-reference codes.

> 💡 **Why it matters:** clean NDC reference data is the foundation of every safe prescribing workflow. Building your own parser means handling the directory format, ingredient strength parsing, and packaging hierarchies. This Actor skips that work and keeps the dataset fresh on every run.

---

### 🎬 Full Demo

_🚧 Coming soon: a 3-minute walkthrough showing how to go from sign-up to a downloaded NDC directory feed._

---

### ⚙️ Input

<table>
<thead>
<tr><th>Input</th><th>Type</th><th>Default</th><th>Behavior</th></tr>
</thead>
<tbody>
<tr><td><code>maxItems</code></td><td>integer</td><td><code>10</code></td><td>Records to return. Free plan caps at 10, paid plan at 1,000,000.</td></tr>
<tr><td><code>productNdc</code></td><td>string</td><td><code>""</code></td><td>Exact product NDC, e.g. <code>80489-001</code>.</td></tr>
<tr><td><code>brandName</code></td><td>string</td><td><code>""</code></td><td>Brand (proprietary) name, e.g. Tylenol.</td></tr>
<tr><td><code>genericName</code></td><td>string</td><td><code>""</code></td><td>Generic (non-proprietary) name, e.g. acetaminophen.</td></tr>
<tr><td><code>manufacturer</code></td><td>string</td><td><code>""</code></td><td>Manufacturer or labeler company (substring).</td></tr>
<tr><td><code>productType</code></td><td>string</td><td><code>""</code></td><td>One of 8 FDA product types. Empty = any.</td></tr>
</tbody>
</table>

**Example: 200 OTC products from Johnson & Johnson.**

```json
{
    "maxItems": 200,
    "manufacturer": "Johnson",
    "productType": "HUMAN OTC DRUG"
}
````

**Example: every Lipitor formulation.**

```json
{
    "maxItems": 100,
    "brandName": "Lipitor"
}
```

> ⚠️ **Good to Know:** the NDC directory is the listing source, not a real-time inventory. A product appearing here means the labeler reported it to the FDA, but it may or may not be in active distribution.

***

### 📊 Output

Each NDC record contains **28 fields**. Download the dataset as CSV, Excel, JSON, or XML.

#### 🧾 Schema

| Field | Type | Example |
|---|---|---|
| 🆔 `productNdc` | string | `"50580-449"` |
| 🆔 `productId` | string | `"50580-449_a1b2c3d4-..."` |
| 🏷️ `brandName` | string | `"TYLENOL EXTRA STRENGTH"` |
| 🏷️ `brandNameBase` | string | `"TYLENOL"` |
| 💊 `genericName` | string | `"ACETAMINOPHEN"` |
| 🏭 `labelerName` | string | `"Johnson & Johnson Consumer Inc."` |
| 🏭 `manufacturerName` | array | null | `["Johnson & Johnson Consumer Inc."]` |
| 🗂️ `productType` | string | `"HUMAN OTC DRUG"` |
| 💉 `dosageForm` | string | `"TABLET"` |
| 🚪 `route` | array | `["ORAL"]` |
| 🏛️ `marketingCategory` | string | `"OTC monograph not final"` |
| 🔢 `applicationNumber` | string | null | `"part343"` |
| 🧪 `activeIngredients` | array | `[{"name": "ACETAMINOPHEN", "strength": "500 mg/1"}]` |
| 💊 `pharmClass` | array | null | `["Anti-inflammatory Agents, Non-Steroidal [Chemical/Ingredient]"]` |
| 💊 `pharmClassEpc` | array | null | `[]` |
| 💊 `pharmClassPe` | array | null | `[]` |
| 📦 `packaging` | array | `[{"package_ndc": "50580-449-30", "description": "30 in 1 BOTTLE"}]` |
| 📅 `marketingStartDate` | string | `"20100401"` |
| 📅 `listingExpirationDate` | string | null | `"20261231"` |
| 🆔 `splId` | string | `"a1b2c3d4-..."` |
| 🆔 `splSetId` | string | `"e5f6g7h8-..."` |
| 🔗 `rxcui` | array | null | `["198440"]` |
| 🔗 `unii` | array | null | `["362O9ITL9D"]` |
| 🔗 `nui` | array | null | `["N0000175722"]` |
| ✅ `finished` | boolean | `true` |
| 🕒 `scrapedAt` | ISO 8601 | `"2026-05-22T00:00:00.000Z"` |
| ⚠️ `error` | string | null | `null` |

#### 📦 Sample records

<details>
<summary><strong>💊 OTC pain reliever</strong></summary>

```json
{
    "productNdc": "50580-449",
    "brandName": "TYLENOL EXTRA STRENGTH",
    "brandNameBase": "TYLENOL",
    "genericName": "ACETAMINOPHEN",
    "labelerName": "Johnson & Johnson Consumer Inc.",
    "productType": "HUMAN OTC DRUG",
    "dosageForm": "TABLET",
    "route": ["ORAL"],
    "activeIngredients": [{"name": "ACETAMINOPHEN", "strength": "500 mg/1"}],
    "rxcui": ["198440"],
    "finished": true,
    "scrapedAt": "2026-05-22T00:00:00.000Z"
}
```

</details>

<details>
<summary><strong>💊 Prescription statin</strong></summary>

```json
{
    "productNdc": "0071-0155",
    "brandName": "LIPITOR",
    "genericName": "ATORVASTATIN CALCIUM",
    "labelerName": "Pfizer Laboratories Div Pfizer Inc.",
    "productType": "HUMAN PRESCRIPTION DRUG",
    "dosageForm": "TABLET, FILM COATED",
    "route": ["ORAL"],
    "activeIngredients": [{"name": "ATORVASTATIN CALCIUM TRIHYDRATE", "strength": "10 mg/1"}],
    "pharmClassEpc": ["HMG-CoA Reductase Inhibitor [EPC]"],
    "applicationNumber": "NDA020702",
    "scrapedAt": "2026-05-22T00:00:00.000Z"
}
```

</details>

<details>
<summary><strong>💉 Vaccine product</strong></summary>

```json
{
    "productNdc": "49281-415",
    "brandName": "FLUZONE",
    "genericName": "INFLUENZA VACCINE",
    "labelerName": "Sanofi Pasteur Inc.",
    "productType": "VACCINE",
    "dosageForm": "INJECTION, SUSPENSION",
    "route": ["INTRAMUSCULAR"],
    "applicationNumber": "BLA103914",
    "scrapedAt": "2026-05-22T00:00:00.000Z"
}
```

</details>

***

### ✨ Why choose this Actor

| | Capability |
|---|---|
| 🏷️ | **Full NDC catalog.** 140,000+ marketed drug products with brand, generic, and labeler metadata. |
| 🎯 | **Multi-dimensional filtering.** NDC, brand, generic, manufacturer, and product type compose freely in one run. |
| 🔗 | **Cross-reference codes.** RxCUI, UNII, NUI, SPL on every record for joins with formularies and clinical knowledge bases. |
| 🧪 | **Active ingredients with strength.** Ready for dosage-checking and DDI workflows. |
| ⚡ | **Fast.** 10 products in under 5 seconds, 10,000 in under five minutes. |
| 🔁 | **Always fresh.** Every run pulls the live directory published by the FDA. |
| 🚫 | **No authentication.** Works with the public openFDA dataset. No token or quota required from you. |

> 📊 NDC reference data is the foundation of every modern e-prescribing, claims, and formulary system.

***

### 📈 How it compares to alternatives

| Approach | Cost | Coverage | Refresh | Filters | Setup |
|---|---|---|---|---|---|
| **⭐ openFDA Drug NDC Directory Scraper** *(this Actor)* | $5 free credit, then pay-per-use | **140,000+** products | **Live per run** | NDC, brand, generic, manufacturer, type | ⚡ 2 min |
| Commercial drug-data subscriptions | $50k+/year per seat | Curated, scored | Daily | Many | ⏳ Weeks |
| Manual quarterly NDC downloads | Free | Bulk only | Quarterly | Local parsing | 🐢 Days |
| Building your own ingestion | Engineering cost | Brittle | Breaks on schema drift | Custom | 🕒 Weeks |

Pick this Actor when you want clean structured NDC records, server-side filters, and zero pipeline maintenance.

***

### 🚀 How to use

1. 📝 **Sign up.** [Create a free account with $5 credit](https://console.apify.com/sign-up?fpr=vmoqkp) (takes 2 minutes).
2. 🌐 **Open the Actor.** Go to the openFDA Drug NDC Directory Scraper page on the Apify Store.
3. 🎯 **Set input.** Pick an NDC, brand, generic, manufacturer, or product type, and set `maxItems`.
4. 🚀 **Run it.** Click **Start** and let the Actor collect your data.
5. 📥 **Download.** Grab your results in the **Dataset** tab as CSV, Excel, JSON, or XML.

> ⏱️ Total time from signup to downloaded dataset: **3-5 minutes.** No coding required.

***

### 💼 Business use cases

<table>
<tr>
<td width="50%" valign="top">

#### 💊 Pharmacy and formulary teams

- Build a master formulary with current NDCs
- OTC vs prescription classification at scale
- Identify discontinued products by listing expiry
- Cross-reference labelers for sourcing decisions

</td>
<td width="50%" valign="top">

#### 🩺 EHR and e-prescribing platforms

- Power drug-name autocomplete with verified brand and generic strings
- Map NDC to RxCUI for clinical decision-support joins
- Display dosage form and route on the prescribing screen
- Surface pharmacologic class for category-based alerts

</td>
</tr>
<tr>
<td width="50%" valign="top">

#### 💼 Claims and revenue cycle

- Validate NDC submissions against the live directory
- Build edits for missing or invalid NDC codes
- Track new product launches by labeler
- Compare brand vs generic NDC families

</td>
<td width="50%" valign="top">

#### 🤖 AI and product teams

- Train drug-mention NER models with verified names
- Power chat-based medication lookups
- Feed a search index with structured ingredient data
- Benchmark LLM drug classification against the source

</td>
</tr>
</table>

***

### 🔌 Automating openFDA Drug NDC Directory Scraper

Control the scraper programmatically for scheduled runs and pipeline integrations:

- 🟢 **Node.js.** Install the `apify-client` NPM package.
- 🐍 **Python.** Use the `apify-client` PyPI package.
- 📚 See the [Apify API documentation](https://docs.apify.com/api/v2) for full details.

The [Apify Schedules feature](https://docs.apify.com/platform/schedules) lets you trigger this Actor on any cron interval. Weekly or monthly refreshes keep downstream formularies in sync automatically.

***

### 🌟 Beyond business use cases

Data like this powers more than commercial workflows. The same structured records support research, education, civic projects, and personal initiatives.

<table>
<tr>
<td width="50%">

#### 🎓 Research and academia

- Drug-utilization research on marketed products
- Pharmacy coursework on NDC structure and labeling
- Theses on generic-substitution patterns
- Open-data classroom exercises on reference catalogs

</td>
<td width="50%">

#### 🎨 Personal and creative

- Personal medication dashboards
- Patient-education content on brand vs generic
- Hobby data-viz of new launches per labeler
- Caregiver tools for tracking dosage forms

</td>
</tr>
<tr>
<td width="50%">

#### 🤝 Non-profit and civic

- Free drug-lookup tools for community clinics
- Investigative reporting on labeler concentration
- Public-health dashboards for OTC availability
- Patient-advocacy guides built on canonical data

</td>
<td width="50%">

#### 🧪 Experimentation

- Train classifiers that infer product type from labels
- Prototype agents that summarize a drug profile
- Build LLM tools that resolve free-text to NDC
- Validate medication-NLP pipelines against real records

</td>
</tr>
</table>

***

### 🤖 Ask an AI assistant about this scraper

Open a ready-to-send prompt about this ParseForge actor in the AI of your choice:

- 💬 [**ChatGPT**](https://chat.openai.com/?q=How%20do%20I%20use%20the%20openFDA%20Drug%20NDC%20Directory%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🧠 [**Claude**](https://claude.ai/new?q=How%20do%20I%20use%20the%20openFDA%20Drug%20NDC%20Directory%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🔍 [**Perplexity**](https://perplexity.ai/search?q=How%20do%20I%20use%20the%20openFDA%20Drug%20NDC%20Directory%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🅒 [**Copilot**](https://copilot.microsoft.com/?q=How%20do%20I%20use%20the%20openFDA%20Drug%20NDC%20Directory%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)

***

### ❓ Frequently Asked Questions

#### 🧩 How does it work?

Set an NDC, brand, generic, manufacturer, or product type in the input form, click Start, and the Actor queries the official FDA drug catalog and emits a clean structured record per product. No browser automation, no captchas, no setup.

#### 📏 How accurate is the data?

The dataset is sourced directly from the FDA NDC Directory and reflects what labelers have submitted. Listings can drift if a product is discontinued without an immediate update, so use the `listingExpirationDate` field as a freshness check.

#### 🔁 How often is the dataset refreshed?

The FDA refreshes the directory on an ongoing basis. Every run of this Actor fetches the latest data, so your output reflects current records as of run time.

#### 🔗 What cross-reference identifiers are included?

RxCUI (RxNorm), UNII (substance), NUI (NDF-RT pharmacologic class), SPL set ID, and the FDA application number when available.

#### 💉 Are vaccines and biologics included?

Yes. Set `productType` to `VACCINE`, `PLASMA DERIVATIVE`, or `CELLULAR THERAPY` to scope the result set.

#### ⏰ Can I schedule regular runs?

Yes. Use Apify Schedules to run this Actor on any cron interval (weekly, monthly) and keep a downstream formulary in sync.

#### ⚖️ Is this data legal to use?

Yes. The NDC Directory is published by the U.S. FDA under a permissive open-data policy. Review downstream regulatory requirements for your specific use case.

#### 💼 Can I use this data commercially?

Yes. Open FDA records are publicly available for commercial reuse. You are responsible for any downstream regulatory or labeling obligations.

#### 💳 Do I need a paid Apify plan to use this Actor?

No. The free Apify plan is enough for testing and small runs (10 records per run). A paid plan lifts the limit and gives you access to scheduling, higher concurrency, and larger datasets.

#### 🔁 What happens if a run fails or gets interrupted?

Apify automatically retries transient errors. If a run still fails, you can inspect the log in the Runs tab, fix the input, and re-run. Partial datasets from failed runs are preserved so you never lose progress.

#### 🆘 What if I need help?

Our support team is here to help. Contact us through the Apify platform or use the Tally form linked below.

***

### 🔌 Integrate with any app

openFDA Drug NDC Directory Scraper connects to any cloud service via [Apify integrations](https://apify.com/integrations):

- [**Make**](https://docs.apify.com/platform/integrations/make) - Automate multi-step workflows
- [**Zapier**](https://docs.apify.com/platform/integrations/zapier) - Connect with 5,000+ apps
- [**Slack**](https://docs.apify.com/platform/integrations/slack) - Get run notifications in your channels
- [**Airbyte**](https://docs.apify.com/platform/integrations/airbyte) - Pipe NDC data into your warehouse
- [**GitHub**](https://docs.apify.com/platform/integrations/github) - Trigger runs from commits and releases
- [**Google Drive**](https://docs.apify.com/platform/integrations/drive) - Export datasets straight to Sheets

You can also use webhooks to trigger downstream actions when a run finishes. Push fresh NDC data into your e-prescribing system, or alert your team in Slack on new launches.

***

### 🔗 Recommended Actors

- [**💊 openFDA Drug Adverse Events Scraper**](https://apify.com/parseforge/openfda-drug-events-scraper) - FAERS post-market safety reports
- [**📋 Drugs@FDA Approvals Scraper**](https://apify.com/parseforge/openfda-drugsfda-scraper) - NDA, ANDA, and BLA approval records
- [**🏥 openFDA Medical Device Events Scraper**](https://apify.com/parseforge/openfda-device-event-scraper) - MAUDE post-market device adverse events
- [**🧪 ClinicalTrials.gov Scraper**](https://apify.com/parseforge/clinicaltrials-gov-scraper) - Clinical trial registrations and results
- [**🩺 Florida MQA License Scraper**](https://apify.com/parseforge/florida-mqa-scraper) - U.S. healthcare practitioner license records

> 💡 **Pro Tip:** browse the complete [ParseForge collection](https://apify.com/parseforge) for more healthcare and life-sciences scrapers.

***

**🆘 Need Help?** [**Open our contact form**](https://tally.so/r/BzdKgA) to request a new scraper, propose a custom data project, or report an issue.

***

> **⚠️ Disclaimer:** this Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by the U.S. Food and Drug Administration. All trademarks mentioned are the property of their respective owners. Only publicly available openFDA records are collected.

# Actor input Schema

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

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000

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

Exact product NDC code, e.g. 80489-001.

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

Brand (proprietary) name, e.g. Tylenol, Advil, Lipitor.

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

Generic (non-proprietary) name, e.g. acetaminophen, ibuprofen, atorvastatin.

## `manufacturer` (type: `string`):

Manufacturer or labeler company name (substring match).

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

Filter by FDA product type.

## Actor input object example

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

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

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

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "openFDA Drug NDC Directory Scraper",
        "description": "Export the National Drug Code (NDC) Directory from openFDA. Search 135k+ marketed products by NDC, brand name, generic name, or manufacturer. Pull product NDC, labeler, dosage form, route, active ingredients, packaging, and pharm class.",
        "version": "1.0",
        "x-build-id": "wi0ckpHreCnLKEyYw"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/parseforge~openfda-drug-ndc-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-parseforge-openfda-drug-ndc-scraper",
                "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/parseforge~openfda-drug-ndc-scraper/runs": {
            "post": {
                "operationId": "runs-sync-parseforge-openfda-drug-ndc-scraper",
                "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/parseforge~openfda-drug-ndc-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-parseforge-openfda-drug-ndc-scraper",
                "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",
                "properties": {
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 1,
                        "maximum": 1000000,
                        "type": "integer",
                        "description": "Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000"
                    },
                    "productNdc": {
                        "title": "Product NDC",
                        "type": "string",
                        "description": "Exact product NDC code, e.g. 80489-001."
                    },
                    "brandName": {
                        "title": "Brand Name",
                        "type": "string",
                        "description": "Brand (proprietary) name, e.g. Tylenol, Advil, Lipitor."
                    },
                    "genericName": {
                        "title": "Generic Name",
                        "type": "string",
                        "description": "Generic (non-proprietary) name, e.g. acetaminophen, ibuprofen, atorvastatin."
                    },
                    "manufacturer": {
                        "title": "Manufacturer / Labeler",
                        "type": "string",
                        "description": "Manufacturer or labeler company name (substring match)."
                    },
                    "productType": {
                        "title": "Product Type",
                        "enum": [
                            "",
                            "HUMAN PRESCRIPTION DRUG",
                            "HUMAN OTC DRUG",
                            "VACCINE",
                            "BULK INGREDIENT",
                            "CELLULAR THERAPY",
                            "PLASMA DERIVATIVE",
                            "NON-STANDARDIZED ALLERGENIC",
                            "STANDARDIZED ALLERGENIC"
                        ],
                        "type": "string",
                        "description": "Filter by FDA product type."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
