# FDA Drug Labels Scraper - openFDA, NDC & Approvals (`s-r/fda-drug-labels`) Actor

Search FDA drug labels by brand, generic name, NDC, UPC, manufacturer or application number. Export flat SPL sections, warnings, ingredients and Drugs@FDA approval dates with NDC and GTIN join keys, for pharmacovigilance, formulary and compliance teams.

- **URL**: https://apify.com/s-r/fda-drug-labels.md
- **Developed by:** [SR](https://apify.com/s-r) (community)
- **Categories:** Business, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 drug label returneds

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 Drug Labels Scraper: openFDA, NDC and Approval Dates

Search FDA drug labels and export the sections you need as flat rows. This Actor
combines openFDA Structured Product Labeling with Drugs@FDA approval metadata,
so each result can carry the label text, NDC identifiers, GTINs and the original
approval date together.

Use it to build searchable medicine catalogues, compare supplier label
information, prepare pharmacovigilance reviews or monitor newly effective
labels. Search by brand, generic name, ingredient, manufacturer, package code or
application number. Results are available in your Apify dataset as JSON, CSV,
Excel and other dataset export formats.

### FDA drug labels: what each result represents

Each row represents one distinct SPL label set. The stable `label_id` equals the
FDA `set_id`; `spl_id` and `spl_version` describe the document version.
Different repackagers may publish separate labels for the same underlying drug
or application. They remain separate results because their label identifiers and
packaging can differ.

The main sections are flattened into text fields. `indications` describes the
published uses, `dosage` contains the dosing section, and `warnings` combines
the two FDA warning section formats in their original wording. `boxed_warning`
remains a separate field, with `has_boxed_warning` for easy filtering. Other
available sections include contraindications, adverse reactions, drug
interactions, pregnancy, storage, active ingredients and inactive ingredients.
Missing sections remain null. The Actor does not generate missing text or infer
ingredients from an unstructured paragraph.

### Input

Start with a real package lookup:

```json
{ "ndc": ["58151-155-77"] }
```

This package identifies a Lipitor label. To search a brand, use `brand_name`; to
search a generic medicine, use `generic_name`. The broader `drug_name` filter
searches brand names, generic names and harmonized substance names together.
`manufacturer` searches the labeler named in the label annotation. It does not
search the sponsor of an approval application.

The `ndc` list accepts hyphenated product and package identifiers, ten digits
without hyphens, or eleven digits in HIPAA format without hyphens. Ambiguous
digit strings search every valid segmentation. Keep identifiers as strings to
preserve leading zeros. `upc` accepts twelve or thirteen digits and searches the
source's thirteen-digit values. `application_number` accepts NDA, ANDA or BLA
followed by six digits; six digits alone search all three application prefixes.

Different filters are combined with AND. Values within a list use OR. A list can
contain up to one hundred strings. An invalid list entry produces a warning
identifying its position. A request needs at least one valid search criterion.
Text searches accept phrases; a single word followed by an asterisk performs a
prefix search.

Use `product_type: "prescription"` or `"otc"` to restrict product types.
`effective_date_from` and `effective_date_to` accept inclusive YYYY-MM-DD
boundaries for label changes. These dates refer to the effective label version,
which is different from a drug's original approval date.

`max_items` is the total result limit, defaults to fifty, and supports values
from one to ten thousand. Larger searches are collected in bounded pages. On
Apify, the Actor follows continuation pages automatically. API consumers can use
`next_cursor` and resend the original filters and options with that token.

### Output

Results include the stable label identifier, DailyMed URL, brand and generic
names, manufacturer, product and package NDC lists, GTINs, application numbers,
effective date and available SPL text sections. The core fields use consistent
names: `brand_name`, `generic_name`, `manufacturer`, `active_ingredients`,
`application_number`, `approval_date`, `indications`, `dosage` and `warnings`.

By default, `include_approval` adds a Drugs@FDA lookup. `approval_date` is the
earliest original submission with definitive AP approval for the selected
application number. An explicit application filter selects the first matching
source number; otherwise the first source number is used. `application_numbers`
keeps every number in its original order. A tentative TA submission has no definitive approval date.
`approvals` retains details for all application numbers, and `approval_products`
includes available strengths, dosage forms, routes, marketing statuses and
therapeutic equivalence codes. `sponsor_name` describes the approval applicant
and can differ from the label manufacturer. Set `include_approval: false` if you
only need labeling information.

OTC monographs commonly have no Drugs@FDA application record. Their approval
fields remain null without making the result incomplete. If approval data is
temporarily unavailable, the Actor preserves the label rows and reports a
warning. Check the run output for `partial` and `warnings` before treating a
collection as complete.

`max_section_chars` defaults to zero, which keeps complete section text. Set a
positive limit to shorten every text section consistently.
`include_tables: true` adds available original HTML table arrays under their SPL
names ending in `_table`. Tables are omitted by default and are not shortened by
the text limit.

The delivered row for `{"ndc": ["58151-155-77"]}`, cut to the identifier and
approval fields that most workflows start from:

```json
{
  "label_id": "a60cc18b-0631-4cf0-b021-9f52224ece65",
  "url": "https://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=a60cc18b-0631-4cf0-b021-9f52224ece65",
  "brand_name": "Lipitor",
  "generic_name": "ATORVASTATIN CALCIUM",
  "manufacturer": "Viatris Specialty LLC",
  "active_ingredients": ["ATORVASTATIN CALCIUM TRIHYDRATE"],
  "product_ndcs": ["58151-155", "58151-156", "58151-157", "58151-158"],
  "package_ndcs": ["58151-155-77", "58151-156-77", "58151-157-77", "58151-158-77"],
  "gtins": ["0358151155774", "0358151156771", "0358151158775", "0358151157778"],
  "application_number": "NDA020702",
  "sponsor_name": "UPJOHN",
  "approval_date": "1996-12-17",
  "approval_status": "AP",
  "effective_date": "2024-04-15",
  "product_type": "HUMAN PRESCRIPTION DRUG",
  "routes": ["ORAL"],
  "has_boxed_warning": false
}
```

The text sections sit on the same row. That request ran with
`max_section_chars: 1000`, so `indications`, `dosage` and `warnings` each hold
exactly 1000 characters there. Without a limit the whole published section
arrives, as in this complete `indications` field from
`{"generic_name": "ibuprofen", "product_type": "otc", "max_items": 3}`:

```json
"indications": "Uses temporarily relieves minor aches and pains due to: headache toothache backache menstrual cramps the common cold muscular aches minor pain of arthritis temporarily reduces fever"
```

The same row carries 351 characters of `dosage` and 2615 characters of
`warnings`. Sections that the label does not publish stay `null`; they are
never filled in from another document or another product.

### Use cases

Pharmacovigilance screening: keep a watchlist of brand, generic or ingredient
names, collect the current `indications`, `warnings` and `boxed_warning` text
with `label_id` and `effective_date`, and re-run the same request later to see
which labels changed. `has_boxed_warning` makes a safety watchlist filterable
without reading the text first.

Procurement and catalogue work: `package_ndcs` and `gtins` are the join keys
between a medicine in a supplier catalogue and the published label behind it,
and between that label and a recall feed that exposes the same structured NDC.
`manufacturer` names the labeler, so repackaged products stay distinguishable.

Formulary and generics comparison: one search on `generic_name`, or on
`drug_name` when the substance is known under its harmonized name, returns every
marketed label for a substance, each with its `application_number`, approval
date, strengths, routes and therapeutic equivalence codes from
`approval_products`.

Labeling change monitoring: `effective_date_from` and `effective_date_to` select
label versions that became effective inside a window, so a periodic run reports
newly effective wording for a product list instead of the whole index.

### FDA drug labels compared with the alternatives

**The raw drug label endpoint.** One SPL document per result: nested JSON,
section text under a source-specific structure, identifiers only where the
document carries harmonized annotations, and no approval metadata at all.
Requests are limited by the endpoint's own paging rules, and the largest
documents are heavy to carry. This Actor returns one flat row per label set,
the same field names on every row, bounded pages with a cursor, and the
Drugs@FDA approval beside the label.

**DailyMed itself.** The published HTML or PDF document. Accurate, but every
consumer has to parse markup, decide which section is which, and map NDC
formats before comparing two products. Here the sections arrive as named text
fields and the identifiers arrive in one format per field.

**Other label Actors on the Store.** Mirrors of the label endpoint deliver
label text; the approval date from Drugs@FDA and the barcode identifiers are
not on that row, so an approval or retail join needs a second source and a
second key. Coverage of harmonized identifiers also differs per listing, which
is why `Coverage and joins` below states what stays missing.

Every option above reads the same public data. The difference is shape: flat
rows with consistent names, join keys on the row, approval metadata attached,
and pagination that can be stopped and resumed.

### Pricing and result limits

The billable unit is one delivered label row, charged through the `drug_label`
event. Approval enrichment does not create an additional event. An empty search
delivers no rows and incurs no label event charge. Consult the current Pricing
tab for the active price; the requested result limit and your Apify spending
controls determine how much can be collected.

Non-paying Apify users can receive at most ten rows per run. This delivery limit
is not a promise that delivered rows are unbilled. Paying users can request
larger collections up to `max_items`. Retries, duplicate label sets and
continuation tokens are not separate billable label rows.

### Coverage and joins

openFDA harmonized annotations are not available for every label. A label
without these annotations may lack structured names, NDCs, GTINs and application
numbers, even when its text sections exist. Date searches can retrieve these
labels. A missing value stays missing, and an NDC is never converted into an
invented GTIN.

Use `gtins` to match retail catalogues that share a source-provided barcode.
Preserve NDC hyphens and leading zeros when comparing product and package lists
with other sources. A recall feed must actually expose the same structured NDC
before a deterministic NDC join is possible. Similar names alone are not an
identity match.

### FAQ

#### Is the label effective date the approval date?

No. The effective date belongs to a particular label version. The approval date
comes from the original definitive application submission in Drugs@FDA. They
answer different questions and are delivered separately.

#### Why does a medicine have a manufacturer and a different sponsor?

The manufacturer field describes the labeler in the label annotation. The
sponsor is the application holder in Drugs@FDA. Repackaged medicines often have
different companies in those roles, so the Actor preserves both.

#### Why are approval fields empty for an OTC product?

OTC monograph products do not necessarily have individual Drugs@FDA application
records. Missing approval fields can be normal. A failed enrichment request is
distinguished by a warning and an incomplete-result flag.

#### Can I keep the original tables and full warning text?

Yes. Leave `max_section_chars` at zero for complete text and set
`include_tables` to true for published HTML table arrays. Text and tables remain
separate so you can decide how to display them.

#### How do I use this in an existing workflow?

Run the Actor on demand, schedule it in Apify or call it through the Apify API.
Export the dataset or connect its rows to your catalogue, review queue or
monitoring process. Store `label_id`, version and effective date to compare
successive collections.

# Actor input Schema

## `drug_name` (type: `string`):

Search brand, generic name and substance name (OR). Different input filters are combined with AND.

## `brand_name` (type: `string`):

Brand name phrase; a single word ending in \* searches a prefix.

## `generic_name` (type: `string`):

Generic name phrase; a single word ending in \* searches a prefix.

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

Labeler/manufacturer phrase, not the Drugs@FDA sponsor.

## `ndc` (type: `array`):

Product or package NDCs, hyphenated or 10/11 digits. Ambiguous digit strings search all valid segmentations. OR within this list.

## `upc` (type: `array`):

12- or 13-digit UPC/GTINs, searched as 13 digits with a leading zero if needed. OR within this list.

## `application_number` (type: `array`):

NDA, ANDA or BLA plus six digits, or six digits to search all three prefixes. OR within this list.

## `product_type` (type: `string`):

Limit to human prescription or OTC labels, or search any type.

## `effective_date_from` (type: `string`):

Inclusive label effective date boundary (YYYY-MM-DD), not the original approval date.

## `effective_date_to` (type: `string`):

Inclusive label effective date boundary (YYYY-MM-DD), not the original approval date.

## `include_approval` (type: `boolean`):

Join Drugs@FDA by application number for sponsor, original definitive approval date and products. A failed join preserves labels with a warning.

## `include_tables` (type: `boolean`):

Include available SPL \*\_table fields as arrays of original HTML strings.

## `max_section_chars` (type: `integer`):

Maximum Unicode characters per text section. Zero keeps full sections; HTML tables are unaffected.

## `max_items` (type: `integer`):

Maximum distinct label sets over the complete search, including all cursor pages. Non-paying Apify users receive at most 10 rows.

## `cursor` (type: `string`):

Opaque next_cursor from the preceding response. Resend all original filters and options unchanged.

## Actor input object example

```json
{
  "ndc": [
    "58151-155-77"
  ],
  "product_type": "any",
  "include_approval": true,
  "include_tables": false,
  "max_section_chars": 0,
  "max_items": 50
}
```

# Actor output Schema

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

One flat row per distinct FDA SPL label set.

## `output` (type: `string`):

OUTPUT record with the run's counts and status flags.

## `errors` (type: `string`):

Failures with a code and a redacted message. Absent when the run had none.

# 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 = {
    "ndc": [
        "58151-155-77"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("s-r/fda-drug-labels").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 = { "ndc": ["58151-155-77"] }

# Run the Actor and wait for it to finish
run = client.actor("s-r/fda-drug-labels").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 '{
  "ndc": [
    "58151-155-77"
  ]
}' |
apify call s-r/fda-drug-labels --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,s-r/fda-drug-labels"
        }
    }
}
```

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/xnAHyNubuG8IJwrid/builds/ZnGL9MF4WyaCZBS5e/openapi.json
