# RxNorm NDC Identifiers Scraper (`plainkitbin/rxnorm-ndc-identifiers`) Actor

Turn a drug name into NDC rows with RxCUI, labeler, packaging and marketing status from the public RxNorm REST API as structured JSON. Not affiliated with National Library of Medicine RxNorm REST API.

- **URL**: https://apify.com/plainkitbin/rxnorm-ndc-identifiers.md
- **Developed by:** [PlainKit bin](https://apify.com/plainkitbin) (community)
- **Categories:** Business, Developer tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.48 / 1,000 rxnorm ndc rows

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

Learn more: https://docs.apify.com/actors/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

## RxNorm NDC Identifiers Scraper

Pharmacy software teams, healthcare data engineers, drug database maintainers, and medical billing analysts need National Drug Code (NDC) rows tied to RxNorm concepts, without writing their own client for the RxNorm REST API. Give this Scraper a drug name and one run returns structured NDC rows from the public RxNorm REST API: 9, 10 and 11 digit NDC codes, the RxCUI, the concept name, labeler, packaging text, marketing category, marketing status and the SPL set id where the API holds them.

This Actor is an independent tool and is not affiliated with National Library of Medicine RxNorm REST API.

### Data source

This product uses publicly available data from the U.S. National Library of Medicine (NLM), National Institutes of Health, Department of Health and Human Services; NLM is not responsible for the product and does not endorse or recommend this or any other product.

The rows are fetched live from the public RxNorm REST API at the time of each run. A saved dataset is a snapshot of that moment and may not reflect the most current or accurate data available from NLM.

### Introduction

Use this Scraper to map a drug name or brand name to the NDC codes that RxNorm lists for it.
Typical jobs: matching a product catalog to NDC codes, building a lookup table of NDC to RxCUI, checking which labeler sells a strength, and feeding NDC rows into a data pipeline.

One run does this:

1. It asks the RxNorm `drugs` endpoint for the concepts that match your drug name.
2. For each concept, in the order the API lists them, it asks the `ndcproperties` endpoint for the NDC entries of that RxCUI.
3. It pushes one dataset row per NDC entry and stops at your row limit.

The values are copied as the API returns them. Rows from the `RXNORM` source often hold only the codes and the concept; rows from the `Hybrid` source also carry labeler, packaging and marketing fields.

### Tutorial

1. Open the Actor and type a drug name into **Drug Name**, for example `lipitor`.
2. Set **Maximum Items** to the number of NDC rows you want (default `10`, at most `1000`).
3. Start the run and open the **Output** tab, or read the dataset through the Apify API.

The Actor needs no API key and no login. A run with a name the API does not know ends with zero rows and zero charges.

### Pricing

The price is **$0.005** per delivered NDC row under the `FREE` tier on Apify Pay-Per-Event (event name: `ndc-row`).

- Event name: `ndc-row`
- Pricing model: Apify Pay-Per-Event
- Tier prices:
  - FREE: $0.005 per event
  - BRONZE: $0.0045 per event
  - SILVER: $0.004 per event
  - GOLD: $0.003484 per event
  - PLATINUM: $0.003484 per event
  - DIAMOND: $0.003334 per event

Each row is pushed to the dataset first and charged right after a successful push.
A refused charge stops the run and that row stays delivered and uncharged; a reached spending limit stops the run after that row was charged.
Failed requests produce 0 charges and push no data.
If the API refuses a call with HTTP 401, 403 or 429, the run ends with one reason-code row (`STATUS_RATE_LIMIT_OR_UNAVAILABLE` in `concept_name`) that is not charged.
Restart safety: if the platform restarts a run, rows already in the dataset are recognized and never pushed or charged twice.

### Input and output examples

#### Input parameters

| Field | Type | Description | Default |
| --- | --- | --- | --- |
| `search` | String (required) | Drug name or brand name, for example `lipitor`. | `lipitor` |
| `max_items` | Integer (1-1000) | Maximum number of NDC rows to output. | `10` |

#### Example input

```json
{
  "search": "lipitor",
  "max_items": 5
}
```

#### Output row fields

- `ndc10`, `ndc11`, `ndc9`: the NDC in 10 digit (with dashes), 11 digit and 9 digit labeler-product form
- `rxcui`: the RxNorm concept unique identifier of the entry
- `concept_name`, `concept_tty`: name and term type of the matched concept
- `labeler`, `label_type`: the labeler and the label type, when the API holds them
- `packaging`: packaging text, several package lines are joined with `|`
- `marketing_category`, `marketing_status`, `marketing_effective_time_low`, `marketing_effective_time_high`, `application_number`: marketing data, when present
- `spl_set_id`: the SPL set id, when present
- `source`: the API source of the entry, for example `RXNORM` or `Hybrid`

#### Example output

```json
{
  "application_number": "NDA050733",
  "concept_name": "",
  "concept_tty": "",
  "label_type": "HUMAN PRESCRIPTION DRUG",
  "labeler": "Pfizer Laboratories Div Pfizer Inc",
  "marketing_category": "NDA",
  "marketing_effective_time_high": "",
  "marketing_effective_time_low": "20140307",
  "marketing_status": "ACTIVE",
  "ndc10": "0069-0400-01",
  "ndc11": "00069040001",
  "ndc9": "0069-0400",
  "packaging": "5 mL in 1 VIAL",
  "rxcui": "1668240",
  "source": "Hybrid",
  "spl_set_id": "8d24bacb-feff-4c6a-b8df-625e1435387a"
}
```

### Actor recommendations

- Run a short search first with `max_items` set to 5 to see the row shape, then raise the limit.
- Use a specific drug name or brand name. A broad ingredient name matches many concepts and spends your row limit on the first concepts the API lists.
- The API changes over time. Run again later to refresh the rows you keep.

### FAQ and support

**Does it need an API key?** No. The Actor calls the public RxNorm REST API without a key.

**How fast does it call the API?** About 10 requests per second at most, half of the 20 requests per second per IP address that the RxNav terms of service ask for. A refusal ends the run; there is no retry loop.

**Does it follow redirects?** No. A redirect ends the run without a row and without a charge.

**Why are some fields empty?** The Actor copies what the API returns. Entries from the `RXNORM` source often hold only the codes.

**Is the data medical advice?** No. Check NDC and labeler data against the label of the product before you use it for patient care.

**Support:** open an issue on the Actor page in Apify Console. Do not put patient data or personal contact details into the input.

### Use as an MCP Tool (AI Agents)

AI agents and MCP clients (such as Claude Desktop or Cursor) can invoke `plainkitbin/rxnorm-ndc-identifiers` directly via `@apify/actors-mcp-server` over `stdio`:

```bash
APIFY_TOKEN=<YOUR_APIFY_TOKEN> npx -y @apify/actors-mcp-server --actors plainkitbin/rxnorm-ndc-identifiers
```

Hosted (Streamable HTTP): connect to `https://mcp.apify.com?tools=plainkitbin/rxnorm-ndc-identifiers` using OAuth or the header `Authorization: Bearer <YOUR_APIFY_TOKEN>`.

Example MCP client configuration (`mcpServers`):

```json
{
  "mcpServers": {
    "rxnorm-ndc-identifiers": {
      "command": "npx",
      "args": [
        "-y",
        "@apify/actors-mcp-server",
        "--actors",
        "plainkitbin/rxnorm-ndc-identifiers"
      ],
      "env": {
        "APIFY_TOKEN": "<YOUR_APIFY_TOKEN>"
      }
    }
  }
}
```

Example JSON tool call matching `.actor/input_schema.json`:

```json
{
  "search": "lipitor",
  "max_items": 5
}
```

Catalog and registry: browse all Actors at [PlainKitBin](https://plainkitbin.com/) or discover the multi-Actor server `com.plainkitbin/public-data-actors` in the MCP Registry.

# Actor input Schema

## `search` (type: `string`):

Drug name or brand name to look up, for example 'lipitor' or 'metformin'. Each matching RxNorm concept is expanded into its NDC rows.

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

Maximum number of NDC rows to output (prefilled default 10, at most 1000).

## Actor input object example

```json
{
  "search": "lipitor",
  "max_items": 10
}
```

# Actor output Schema

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

Dataset items produced by this run.

# 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 = {
    "search": "lipitor",
    "max_items": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("plainkitbin/rxnorm-ndc-identifiers").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 = {
    "search": "lipitor",
    "max_items": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("plainkitbin/rxnorm-ndc-identifiers").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 '{
  "search": "lipitor",
  "max_items": 10
}' |
apify call plainkitbin/rxnorm-ndc-identifiers --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,plainkitbin/rxnorm-ndc-identifiers"
        }
    }
}
```

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/HmoouPhT1oerdnzsP/builds/JterBOmAOSR353Ho7/openapi.json
