Medicare Part D Drug Spending | 2013-2023, 10 Fields avatar

Medicare Part D Drug Spending | 2013-2023, 10 Fields

Pricing

from $0.60 / 1,000 drug record scrapeds

Go to Apify Store
Medicare Part D Drug Spending | 2013-2023, 10 Fields

Medicare Part D Drug Spending | 2013-2023, 10 Fields

Scrape Medicare Part D drug spending from CMS: total cost, claims, beneficiaries, unit cost & manufacturer for every brand or generic drug. Structured JSON, no API key. An IQVIA style pharma pricing source for Claude, ChatGPT & any MCP agent.

Pricing

from $0.60 / 1,000 drug record scrapeds

Rating

0.0

(0)

Developer

The Mine Works

The Mine Works

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

1

Monthly active users

a day ago

Last modified

Share

Medicare Part D Drug Spending: 2013-2023, 10 Fields

Pay only for results delivered. Browse all Actors.

💰 From $0.60 / 1,000 results.

Pull CMS Medicare Part D drug spending as clean JSON: 10 fields per drug per year including brand name, generic name, manufacturer, total beneficiaries, total claims, total spending in USD, spending per beneficiary and average weighted unit cost. The Actor reads CMS's wide annual release and reshapes it into one tidy row per drug-year, covering the 2013 to 2023 release years.

Pure HTTP against the official CMS data API. No API key, no login, no browser, up to 5,000 drugs per run.

Why use this Medicare Part D scraper

  • Unit cost, not just totals. unit_cost_avg_usd is CMS's weighted average spending per dosage unit, the field that actually supports a pricing comparison between a brand and its generics.
  • The wide file reshaped for you. CMS publishes one row per drug with year-suffixed columns (Tot_Spndng_2023, Tot_Clms_2023 and so on). This Actor picks the year you ask for, or the newest year with data, and emits a tidy row.
  • Substring matching on drug and manufacturer. drugName matches against both brand and generic names, so semaglutide finds Ozempic, Rybelsus and Wegovy without you knowing the brand list.
  • A spend floor. minSpend drops everything below a total-spending threshold, which is how you get to the drugs that actually move the programme.
  • Current endpoint. CMS retired the old Socrata resource route (HTTP 410); this Actor uses the live data-api/v1 dataset endpoint.

Look up spending for one drug

{
"drugName": "Ozempic",
"maxResults": 25
}

Brand and generic names are both searched, so this also surfaces related semaglutide products.

Compare a manufacturer's whole Part D portfolio

{
"manufacturer": "Novo Nordisk",
"year": 2023,
"maxResults": 500
}

Pinning year makes the comparison clean: every row reports the same release year, or is skipped if that drug has no data for it.

Find the highest-spend drugs in the programme

{
"year": 2023,
"minSpend": 1000000000,
"maxResults": 200
}

A one-billion-dollar floor gives you the drugs that dominate Part D spending, with claims and beneficiary counts attached.

Track a generic against its brand

{
"drugName": "atorvastatin",
"maxResults": 100
}

Because the match runs across both Brnd_Name and Gnrc_Name, one query returns the brand and every generic entry, and unit_cost_avg_usd makes them directly comparable.

What data does the Medicare Part D scraper return

{
"year": 2023,
"brand_name": "Ozempic",
"generic_name": "Semaglutide",
"manufacturer": "Novo Nordisk",
"total_beneficiaries": 1854321,
"total_claims": 9123456,
"total_spending_usd": 8765432100.25,
"spending_per_beneficiary_usd": 4726.91,
"unit_cost_avg_usd": 27.44,
"scraped_at": "2026-08-01T16:00:00.000Z"
}
FieldDescription
yearRelease year the metrics belong to
brand_name, generic_nameCMS brand and generic names
manufacturerLabeller as reported to CMS
total_beneficiariesDistinct Part D beneficiaries with at least one claim
total_claimsTotal Part D claims including refills
total_spending_usdGross Part D spending before rebates
spending_per_beneficiary_usdAverage spending per beneficiary
unit_cost_avg_usdWeighted average spending per dosage unit
scraped_atCapture timestamp

CMS spending figures are gross and do not net out manufacturer rebates, which CMS does not publish at drug level. Treat them as list-side spending, not net cost.

How the scraper works without an API key

CMS publishes the "Medicare Part D Spending by Drug" dataset through an open data-api/v1 endpoint. This Actor pages 1,000 rows at a time, applies your drug, manufacturer and spend filters client-side (the endpoint only supports exact-match column filters), picks the requested year's columns or the newest year with data, and emits a tidy row. No key, no login.

What can you build with Part D spending data

Pharma pricing and market analysis. Unit cost and spending trajectory per molecule across the largest single US drug payer.

Payer and PBM benchmarking. Claim volume and per-beneficiary spending as a reference point for formulary work.

Generic erosion tracking. Brand versus generic unit cost and claim share, year over year.

Investment research. A public, citable spending series for a manufacturer's Part D portfolio.

How much does it cost to scrape Medicare Part D data

Pay per drug record delivered: $0.002 on the Apify Free plan, $0.001 on Gold and above. Filter combinations that match nothing are never charged.

How do I use Part D data in Claude or ChatGPT

https://mcp.apify.com/?tools=themineworks/medicare-part-d-drug-spending
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('themineworks/medicare-part-d-drug-spending').call({
drugName: 'Ozempic',
maxResults: 25,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();

Medicare Part D FAQ

Do I need an API key? No. The CMS data API is open.

Which years are available? The Actor reads the year-suffixed columns CMS ships in the current release, covering 2013 through 2023. Pin one with year, or leave it off to get the newest year each drug has data for.

Does spending include rebates? No. CMS publishes gross spending; manufacturer rebates are confidential and not in this dataset.

Why does one drug return several rows? CMS lists a molecule separately per labeller and per brand, so a widely genericised drug legitimately has many entries.

Can I filter by spending? Yes, with minSpend, which applies to total_spending_usd for the selected year.

Complete your pharma intelligence pipeline

Found a bug or want a field added? Open an issue on the Actor's Apify Console page.

Last verified: 2026-08