# Prescription Drug Prices Scraper — Cost Plus Drugs & NADAC (`muhammadafzal/prescription-drug-prices-scraper`) Actor

Look up US prescription drug prices by drug name, strength, form, NDC or treatment category: Cost Plus Drugs per-unit and per-fill prices with fees and stock, plus optional Medicaid NADAC pharmacy acquisition cost per NDC.

- **URL**: https://apify.com/muhammadafzal/prescription-drug-prices-scraper.md
- **Developed by:** [Muhammad Afzal](https://apify.com/muhammadafzal) (community)
- **Categories:** E-commerce
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.60 / 1,000 drug price records

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

## Prescription Drug Prices Scraper — Cost Plus Drugs & NADAC

Prescription Drug Prices Scraper looks up US prescription drug prices by drug name, NDC, strength, dosage form or treatment category. It returns the Cost Plus Drugs price list (price per unit, price per pack, price per fill, dispensing fee, shipping, stock) and, when you ask for it, the Medicaid NADAC acquisition cost per NDC, as JSON, CSV or Excel. It costs **USD 2 per 1,000 price records** plus a USD 0.005 start fee per run, and searches without a match are free.

It is built for pharmacy and benefits analysts who compare medication prices, health-tech and price-transparency tools that need a drug price lookup, researchers who track generic drug prices over time, and AI assistants that answer "how much does metformin cost".

### What prescription drug prices does it return?

One dataset record per price. The `source` field says where it comes from, and the two kinds of price are never mixed in one field:

| `source` | What the record is | Price fields |
|---|---|---|
| `costplusdrugs` | One product of the Cost Plus Drugs mail-order price list (about 2,400 products) | `pricePerUnitUsd`, `packPriceUsd`, `fillPriceUsd`, `fillPriceWithDispensingUsd`, `fillTotalWithShippingUsd` |
| `nadac` | One NDC in the latest weekly NADAC file from data.medicaid.gov | `nadacPerUnitUsd` |

NADAC (National Average Drug Acquisition Cost) is what US retail pharmacies pay on average to buy a drug, per unit. It is a cost benchmark, not a price a patient pays.

| Field | What it means |
|---|---|
| `drugName`, `brandName`, `brandOrGeneric` | Medication name, the brand it corresponds to, and generic or brand |
| `strength`, `form`, `treatmentCategories` | Strength, dosage form and treatment categories (Cost Plus Drugs) |
| `ndc` | The 11-digit NDC of a NADAC record |
| `equivalentNdcs`, `equivalentNdcCount`, `rxnormId` | NDCs a Cost Plus Drugs product can be dispensed for, and its RxNorm ID |
| `unit`, `pricePerUnitUsd` | Unit and Cost Plus Drugs price per unit |
| `packSize`, `packCount`, `packPriceUsd`, `splittable` | Manufacturer pack size, and the price of one full pack (unit price times pack size) |
| `fillQuantity`, `fillLabel`, `fillPriceUsd` | The default fill (30 count for most pills) and its medication price |
| `dispensingFeeUsd`, `shippingUsd`, `expeditedShippingUsd` | Fees stated by Cost Plus Drugs |
| `fillPriceWithDispensingUsd`, `fillTotalWithShippingUsd` | Default fill with the dispensing fee, and with standard shipping added |
| `inStock`, `specialHandling`, `url` | Stock status, handling note such as cold-chain, and the product page |
| `nadacPerUnitUsd`, `nadacPricingUnit` | NADAC per unit and its unit (EA, ML or GM) |
| `nadacEffectiveDate`, `nadacAsOfDate` | When the rate took effect and which weekly file it comes from |
| `nadacClassification`, `nadacPharmacyType`, `nadacExplanationCodes`, `otc` | NADAC rate-setting details |
| `correspondingGenericNadacPerUnitUsd`, `correspondingGenericEffectiveDate` | For brand NDCs, the NADAC of the generic equivalent |
| `matchedDrugName`, `matchedNdc` | Which of your search values found the record |
| `currency`, `scrapedAt` | Always USD, and when the price was read |

Every price is taken from the source or computed only from source fields. A value the source does not give is `null`, never estimated. The run also writes one `OUTPUT` record with the outcome, records saved per source, stop reason and warnings.

### How do I look up a drug price by name?

Put generic or brand names in `drugNames`. Case does not matter and part of a name is enough.

```json
{
  "drugNames": ["atorvastatin", "metformin"],
  "strengths": ["20mg", "500mg"],
  "maxResults": 50
}
```

To compare the pharmacy price with the acquisition cost, ask for both sources:

```json
{
  "drugNames": ["lipitor"],
  "source": "both",
  "maxResults": 20
}
```

| Input | What it does |
|---|---|
| `drugNames` | Up to 50 generic or brand names, partial and case-insensitive |
| `ndcs` | Up to 200 NDC codes, 10 or 11 digits, with or without hyphens |
| `strengths` | Keep only these strengths, for example 20mg or 500 mg |
| `forms` | Keep only these dosage forms, for example tablet or cream |
| `treatmentCategories` | Keep only these Cost Plus Drugs categories, for example Diabetes |
| `brandOrGeneric` | `any`, `generic` or `brand` |
| `inStockOnly` | Leave out Cost Plus Drugs products that are out of stock |
| `source` | `costPlusDrugs` (default), `nadac` or `both` |
| `maxResults` | Records to save per source, default 50, limit 5,000 |

Drug names and NDCs select drugs (a record matching either is kept); the other filters narrow the selection. With no filter at all, the Actor exports the Cost Plus Drugs price list up to `maxResults`.

### How do I do an NDC lookup with prices?

Put the codes in `ndcs`. `00093-1174-01`, `00093117401`, `0093-1174-01` and `0093117401` all find the same drug: 10-digit codes are padded to the 11-digit form, and a 10-digit code without hyphens is tried in its three possible readings.

```json
{
  "ndcs": ["00093-1174-01", "67877-0511-10"],
  "source": "both"
}
```

On Cost Plus Drugs an NDC matches the product whose `equivalentNdcs` contains it, so a manufacturer's NDC finds the generic product that would be dispensed. On NADAC the NDC matches its own row.

### What does the output look like?

A Cost Plus Drugs record (the remaining NADAC fields, all `null` here, are left out for brevity):

```json
{
  "source": "costplusdrugs",
  "priceType": "mail_order_pharmacy_price",
  "recordId": "d0b9ba0ae3ab9143200cfbce6ecb7a6a",
  "drugName": "Atorvastatin",
  "brandName": "Lipitor",
  "brandOrGeneric": "generic",
  "strength": "10mg",
  "form": "Tablet",
  "treatmentCategories": ["Heart Health", "High Cholesterol"],
  "ndc": null,
  "equivalentNdcs": ["00904-6290-61", "68084-0097-01", "67877-0511-10"],
  "equivalentNdcCount": 3,
  "rxnormId": "617312",
  "unit": "ea",
  "pricePerUnitUsd": 0.00834,
  "packSize": 1000,
  "packCount": 1,
  "packPriceUsd": 8.34,
  "splittable": true,
  "fillQuantity": 30,
  "fillLabel": "30 count",
  "fillPriceUsd": 0.25,
  "dispensingFeeUsd": 5,
  "fillPriceWithDispensingUsd": 5.25,
  "shippingUsd": 5.25,
  "expeditedShippingUsd": 15,
  "fillTotalWithShippingUsd": 10.5,
  "inStock": true,
  "specialHandling": null,
  "nadacPerUnitUsd": null,
  "currency": "USD",
  "matchedDrugName": "atorvastatin",
  "matchedNdc": null,
  "url": "https://www.costplusdrugs.com/medications/atorvastatin-10mg-tablet/?utm_source=api&utm_content=pricing-api",
  "scrapedAt": "2026-11-11T02:30:00.000Z"
}
```

A NADAC record (shortened: the Cost Plus Drugs fields are present and `null`):

```json
{
  "source": "nadac",
  "priceType": "pharmacy_acquisition_cost_benchmark",
  "recordId": "nadac:58151015577",
  "drugName": "LIPITOR 10 MG TABLET",
  "brandOrGeneric": "brand",
  "ndc": "58151-0155-77",
  "pricePerUnitUsd": null,
  "nadacPerUnitUsd": 13.4182,
  "nadacPricingUnit": "EA",
  "nadacEffectiveDate": "2026-10-21",
  "nadacAsOfDate": "2026-11-11",
  "nadacClassification": "B",
  "nadacPharmacyType": "C/I",
  "nadacExplanationCodes": ["1"],
  "otc": false,
  "correspondingGenericNadacPerUnitUsd": 0.02301,
  "correspondingGenericEffectiveDate": "2026-10-21",
  "currency": "USD",
  "matchedDrugName": "lipitor",
  "scrapedAt": "2026-11-11T02:30:00.000Z"
}
```

### How much does drug price data cost?

You pay per price record saved to the dataset, plus a small start fee. Searches without a match, rejected inputs and failed lookups are never charged. Platform usage is included in the price.

| Apify plan tier | Per price record | Per 1,000 price records | Start fee per run |
|---|---|---|---|
| Free | USD 0.002 | USD 2.00 | USD 0.005 |
| Bronze (2.5% off) | USD 0.00195 | USD 1.95 | USD 0.005 |
| Silver (5% off) | USD 0.0019 | USD 1.90 | USD 0.005 |
| Gold, Platinum, Diamond (20% off) | USD 0.0016 | USD 1.60 | USD 0.005 |

The start fee is charged once per started GB of allocated memory; the default 256 MB run pays it once. Worked totals on the Free tier: one drug name with 15 records costs USD 0.035, and the whole Cost Plus Drugs price list (about 2,400 records) costs about USD 4.79. Set a maximum cost on the run and the Actor stops saving records when it is reached.

### How do I compare generic drug prices with NADAC?

Run a drug name with `source` set to `both`. Take `pricePerUnitUsd` from the `costplusdrugs` records and `nadacPerUnitUsd` from the `nadac` records of the same drug and strength. The NADAC description carries the strength and form (for example METFORMIN HCL 500 MG TABLET), and many NDCs of one drug share one NADAC rate, so group NADAC records by `drugName`. Schedule the same input weekly to follow medication prices over time: NADAC is refreshed weekly and the Cost Plus Drugs list changes as its costs change.

### When should I use it, and when not?

Use it when you need a US cash price list for prescription medications from one mail-order pharmacy, the national acquisition-cost benchmark, or both side by side.

Do not use it for:

- **Prices at local pharmacies or coupon prices.** It reads the Cost Plus Drugs mail-order price list and NADAC only.
- **Drugs Cost Plus Drugs does not sell.** Its list has about 2,400 products, mostly generics; a drug that is not listed returns no Cost Plus Drugs record.
- **Reading NADAC as a retail price.** NADAC is the average cost pharmacies pay, before any dispensing fee or margin.
- **NADAC history.** Only the latest weekly NADAC file is read.
- **The whole NADAC file in one run.** NADAC needs a drug name or an NDC.
- **Medical advice or ordering medication.** The Actor only reads published prices.
- **Prices outside the United States.**

### Can I use it from an AI assistant?

Yes. Claude, ChatGPT, Cursor and any other MCP client can run it through Apify's MCP server at `https://mcp.apify.com/?tools=muhammadafzal/prescription-drug-prices-scraper`. Connect that URL, then ask something like: "What does a 30-day supply of atorvastatin 20mg cost at Cost Plus Drugs, and what is its NADAC per tablet?" The assistant sees the input fields, the price per record and the output fields before it runs.

### How do I call it from code?

JavaScript:

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('muhammadafzal/prescription-drug-prices-scraper').call({
    drugNames: ['atorvastatin'],
    strengths: ['20mg'],
    source: 'both',
    maxResults: 50,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

Python:

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("muhammadafzal/prescription-drug-prices-scraper").call(run_input={
    "treatmentCategories": ["Diabetes"],
    "brandOrGeneric": "generic",
    "maxResults": 200,
})
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item["drugName"], item["strength"], item["pricePerUnitUsd"], item["fillTotalWithShippingUsd"])
```

### FAQ

**How much does metformin cost?**
Run the Actor with `drugNames: ["metformin"]`. Each strength and form is one record with the price per unit and the price of a default 30-count fill, with and without fees.

**What is NADAC pricing?**
NADAC is the National Average Drug Acquisition Cost published weekly by Medicaid on data.medicaid.gov. It is the average invoice cost retail pharmacies pay per unit of a drug, listed per NDC.

**Is there a Cost Plus Drugs price list I can download?**
Yes. Leave every filter empty and set `maxResults` to 5,000 to export the whole Cost Plus Drugs price list as JSON, CSV or Excel.

**What is the difference between the unit price, the pack price and the fill price?**
`pricePerUnitUsd` is the price of one tablet, capsule, mL or gram. `packPriceUsd` is that price times the manufacturer pack size. `fillPriceUsd` is the price of the default fill, usually 30 units; `fillTotalWithShippingUsd` adds the dispensing fee and standard shipping.

**Why is a price field null?**
The source does not give that value for the record. NADAC records have no retail price, and Cost Plus Drugs records have no NADAC. Nothing is estimated.

**Why did my drug return nothing?**
Cost Plus Drugs does not list it, or the spelling differs. Try the generic name, a shorter part of the name, or the NDC. NADAC descriptions are abbreviated (for example HCL, ER), so a shorter name works better there.

**How current are the prices?**
Both sources are read live on every run. `scrapedAt` is the lookup time and `nadacAsOfDate` is the date of the weekly NADAC file.

**What happens if a source does not answer?**
The Actor retries a few times. With `source: both`, records from the source that answered are still saved and the `OUTPUT` record lists the failed lookup. Nothing is charged for a failed lookup.

Last verified: 2026-11-11

# Actor input Schema

## `drugNames` (type: `array`):

Use this to search by drug name, one per row, for example atorvastatin, metformin or Lipitor. Generic and brand names both work, upper or lower case, and part of a name is enough (at least 3 letters). Up to 50 names per run.

## `ndcs` (type: `array`):

Use this to look up drugs by National Drug Code, one per row, for example 00093-1174-01. 10-digit and 11-digit codes work, with or without hyphens. On Cost Plus Drugs an NDC matches the product that can be dispensed as its equivalent. Up to 200 codes per run.

## `strengths` (type: `array`):

Use this to keep only certain strengths, one per row, for example 20mg, 500 mg or 0.05%. Spaces and case do not matter; 500mg does not match 1500mg.

## `forms` (type: `array`):

Use this to keep only certain dosage forms, one per row, for example tablet, capsule, cream or solution. Part of the form name is enough.

## `treatmentCategories` (type: `array`):

Use this to keep only drugs in a treatment category of the Cost Plus Drugs price list, one per row, for example High Cholesterol, Diabetes, High Blood Pressure or Infection. Part of the category name is enough. NADAC records have no categories.

## `brandOrGeneric` (type: `string`):

Use this to keep only generic drugs or only brand-name drugs. The default keeps both.

## `inStockOnly` (type: `boolean`):

Use this to leave out Cost Plus Drugs products that are currently out of stock. NADAC records have no stock status.

## `source` (type: `string`):

Use this to choose the price source. Cost Plus Drugs is a mail-order pharmacy price list (price per unit, price per fill, dispensing fee, shipping). NADAC is the Medicaid National Average Drug Acquisition Cost from data.medicaid.gov: what pharmacies pay per unit, per NDC, not a retail price. Both returns the two record types side by side; NADAC needs a drug name or an NDC.

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

Use this to cap the number of price records saved from each price source. Each saved record is one billed result. The default is 50 and the limit is 5,000.

## Actor input object example

```json
{
  "drugNames": [
    "atorvastatin"
  ],
  "brandOrGeneric": "any",
  "inStockOnly": false,
  "source": "costPlusDrugs",
  "maxResults": 50
}
```

# Actor output Schema

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

One record per Cost Plus Drugs product price or per NADAC NDC cost.

## `summary` (type: `string`):

Outcome, records saved per source, stop reason, warnings, request counts and charges.

# 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 = {
    "drugNames": [
        "atorvastatin"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("muhammadafzal/prescription-drug-prices-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 = { "drugNames": ["atorvastatin"] }

# Run the Actor and wait for it to finish
run = client.actor("muhammadafzal/prescription-drug-prices-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 '{
  "drugNames": [
    "atorvastatin"
  ]
}' |
apify call muhammadafzal/prescription-drug-prices-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,muhammadafzal/prescription-drug-prices-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/RzxiRODIq7F8kC8tN/builds/mDzeDYfCPlPTYXvaL/openapi.json
