# Prescription Drug Price Tracker (CMS NADAC) (`scrapemint/drug-price-tracker`) Actor

What pharmacies actually pay for a drug: official CMS NADAC acquisition costs for every US prescription and OTC drug, by name or NDC, plus week-over-week price changes with the reason CMS gives, and weekly price history. No API key.

- **URL**: https://apify.com/scrapemint/drug-price-tracker.md
- **Developed by:** [Ken M](https://apify.com/scrapemint) (community)
- **Categories:** Business, E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## Prescription Drug Price Tracker (CMS NADAC)

What a pharmacy actually pays for a drug. NADAC (National Average Drug Acquisition Cost) is the federal benchmark CMS builds from a monthly survey of retail pharmacy invoices, and it is the number state Medicaid programs reimburse against. It covers every prescription and OTC drug sold in the US, down to the individual package, and CMS republishes it every week.

This actor turns that public data into structured rows: current prices, week over week price moves, and weekly history. No API key, no login, no browser.

### Three modes

**Current prices** - the latest NADAC per unit for each package (NDC) of a drug:

- NDC, full drug label, price per unit, pricing unit (each, ML, GM)
- generic or brand classification, OTC flag, pharmacy type indicator
- the price of the corresponding generic, where CMS publishes one
- effective date, so you know exactly which week the price is from

**Price changes** - the flagship view. Every week over week move CMS published, with old price, new price, percent change, and the reason CMS gives for it:

```json
{
    "mode": "changes",
    "drugName": "insulin",
    "sinceDays": 30,
    "minPercentChange": 10
}
```

Reasons come straight from CMS and are the useful part: `Survey Rate` means the surveyed invoice cost moved, `WAC Adjustment` means the manufacturer changed list price. Rows come back biggest move first, up or down.

Set **newOnly** and schedule the run, and it becomes a price alert: each run reports only the moves it has not already returned.

**Price history** - the weekly price series for one drug or NDC across a year, ready to chart or load into a model.

### Ways to search

- **drugName** - partial match on the NADAC label ("ozempic", "atorvastatin", "insulin"). Labels look like `ATORVASTATIN 20 MG TABLET`, so adding a strength narrows things nicely.
- **ndc** - the exact 11 digit code when you already know the package
- **drugType** - generic only or brand only
- **year** - which NADAC year to read, back to 2020

A drug name or an NDC is required. NADAC lists every drug in the country, so it is filter first by design.

One drug name usually matches several NDCs, one per labeler and package size. That is expected: different manufacturers of the same generic get their own code and can carry different costs.

### Who uses this

- **Independent pharmacies**: NADAC is the reimbursement benchmark. Watching it against your invoice cost is how you spot the products you are dispensing at a loss.
- **PBM and payer analysts**: acquisition cost benchmarking, and early warning on generics whose cost is climbing.
- **Wholesalers and buying groups**: catch WAC adjustments the week CMS publishes them.
- **Health policy researchers and journalists**: drug pricing trends with an official, citable source.
- **Telehealth and cash pay sellers**: sanity check what a drug should cost before you set a price.

Pairs with our Doctor Payments Scraper and Care Facility Ratings Scraper for the wider healthcare data set.

### Pricing

A small fee per row returned. Searches that match nothing are free note rows, and the first 2 rows of every run are free.

### Notes

- Source is the keyless CMS Medicaid data API at `data.medicaid.gov`. Dataset ids are resolved at run time, so new NADAC years work without an update.
- NADAC is an acquisition cost benchmark, not a retail price and not what a patient pays at the counter.
- Every numeric column arrives from the API as text, so this actor does its own number handling. If you query the raw API yourself, be aware that its sorting and its greater than comparisons run alphabetically, which quietly returns the wrong rows.

# Actor input Schema

## `mode` (type: `string`):

Current prices returns the latest NADAC per unit for each package (NDC) of a drug. Price changes returns week-over-week moves with the old price, new price, percent change and CMS's stated reason - the flagship view. Price history returns the weekly series for one year.

## `drugName` (type: `string`):

Brand or generic name ("ozempic", "atorvastatin", "insulin"). Partial match against the NADAC label, which looks like "ATORVASTATIN 20 MG TABLET". Add a strength to narrow it.

## `ndc` (type: `string`):

Exact 11-digit National Drug Code for one specific package, if you already know it. Optional.

## `drugType` (type: `string`):

Limit to generic or brand-name products. NADAC classifies every entry as one or the other.

## `year` (type: `string`):

Which NADAC year to read, for current prices and price history. Ignored in price-changes mode, which spans all years.

## `sinceDays` (type: `integer`):

Price-changes mode only. How far back to look for price moves. NADAC republishes weekly, so 30 days covers about four updates.

## `minPercentChange` (type: `integer`):

Price-changes mode only. Only return moves of at least this size, up or down. 0 returns every change. Use 10 or 25 to surface the ones worth acting on.

## `newOnly` (type: `boolean`):

Price-changes mode only. Remembers what earlier runs already returned and reports only changes it has not seen before, so a scheduled run becomes a price-move alert.

## `maxRows` (type: `integer`):

Maximum rows to return. In price-changes mode the biggest moves are returned first.

## Actor input object example

```json
{
  "mode": "prices",
  "drugName": "atorvastatin",
  "drugType": "any",
  "year": "2026",
  "sinceDays": 30,
  "minPercentChange": 0,
  "newOnly": false,
  "maxRows": 50
}
```

# 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 = {
    "mode": "prices",
    "drugName": "atorvastatin",
    "year": "2026",
    "sinceDays": 30,
    "minPercentChange": 0,
    "maxRows": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapemint/drug-price-tracker").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 = {
    "mode": "prices",
    "drugName": "atorvastatin",
    "year": "2026",
    "sinceDays": 30,
    "minPercentChange": 0,
    "maxRows": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("scrapemint/drug-price-tracker").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 '{
  "mode": "prices",
  "drugName": "atorvastatin",
  "year": "2026",
  "sinceDays": 30,
  "minPercentChange": 0,
  "maxRows": 50
}' |
apify call scrapemint/drug-price-tracker --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/Irevf6KC26pkBlAmy/builds/ZaSQ0MTNOBhhYOGWE/openapi.json
