Medicare Part D Drug Spending Scraper avatar

Medicare Part D Drug Spending Scraper

Pricing

$1.00 / 1,000 drug record scrapeds

Go to Apify Store
Medicare Part D Drug Spending Scraper

Medicare Part D Drug Spending Scraper

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

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

Categories

Share

๐Ÿ’Š Medicare Part D Drug Spending: CMS Pricing Data

Overview

Medicare Part D Drug Spending pulls the official CMS Medicare Part D spending dataset as clean structured JSON: total spend, total claims, beneficiary count, average unit cost, and manufacturer for every branded and generic drug in the Medicare program. Filter by drug name, manufacturer, year, or minimum spend threshold. Built for pharma pricing intelligence, formulary analysis, market research, and policy work.

CMS publishes this dataset annually and it covers every drug prescribed to Medicare beneficiaries. Commercial data providers (IQVIA, Symphony Health) charge thousands per year for equivalent data. This actor gives you direct, structured access to the official source at pay-per-record pricing, with pagination and filtering handled internally.

โœ… No API key | โœ… Official CMS open data | โœ… 2013 through 2023 coverage | โœ… First 10 records free | โœ… MCP-ready for AI agents

Features

Every Part D drug (brand and generic) with total spend, total claims, beneficiaries, and average unit cost. Manufacturer field for tracking spending by brand owner. Year-over-year unit cost trends when you leave year blank and sort downstream. Partial-match search on drug name (Ozempic, atorvastatin) and manufacturer. Direct pull from the CMS Provider Data Catalog (Socrata API), so no key, no login, no anti-bot friction.

How it works

The actor queries the CMS Provider Data Catalog's Socrata endpoint for the Medicare Part D Spending dataset, applies your name, manufacturer, year, or spend-threshold filters server-side, and flattens results into one record per drug-year. Pagination is walked internally so a single run can return up to 5,000 records.

Empty pulls (a drug name with no matches, a threshold that filters everything out) are recognized before charging.

๐Ÿงพ Input configuration

{
"drugName": "Ozempic",
"year": 2022,
"maxResults": 100
}

๐Ÿ“ค Output format

{
"year": "2022",
"brand_name": "OZEMPIC",
"generic_name": "SEMAGLUTIDE",
"manufacturer": "NOVO NORDISK INC",
"total_beneficiaries": 1240000,
"total_claims": 8900000,
"total_spending_usd": 5820000000,
"spending_per_beneficiary_usd": 4693.55,
"unit_cost_avg_usd": 847.23,
"scraped_at": "2026-06-15T00:00:00.000Z"
}

Every drug-year record contains these fields:

FieldDescription
๐Ÿ“… yearReporting year (2013 to 2023)
๐Ÿท๏ธ brand_nameBrand name as filed with CMS
๐Ÿ’Š generic_nameGeneric (chemical) name
๐Ÿญ manufacturerManufacturer or brand-name owner
๐Ÿ‘ฅ total_beneficiariesDistinct Medicare beneficiaries who received the drug
๐Ÿ“„ total_claimsTotal claims paid
๐Ÿ’ต total_spending_usdTotal Medicare Part D spending in USD
๐Ÿ“Š spending_per_beneficiary_usdAverage spend per beneficiary
๐ŸŽฏ unit_cost_avg_usdWeighted average cost per unit
๐Ÿ•’ scraped_atISO timestamp of capture

๐Ÿ’ผ Common use cases

Pharma pricing intelligence Track total Medicare spend and unit cost trends for a competitor drug over multiple years. Benchmark your product's unit cost against therapeutic-class peers.

Formulary and payer analysis Compare per-beneficiary spend across drug classes to prioritize formulary decisions. Screen for high-spend generics that indicate switching opportunities.

Investment and market sizing Size the Medicare opportunity for a pipeline drug using peer-drug spend and beneficiary counts. Track manufacturer-level spend shifts as leading indicators of market share change.

Journalism and policy Investigate drug-pricing outliers with authoritative CMS numbers. Model the impact of price-negotiation policies on Medicare spend.

๐Ÿš€ Getting started

  1. Open the actor and enter a Drug name (partial match, e.g. Ozempic, atorvastatin).
  2. Optionally add a Manufacturer, Year, or Minimum total spend threshold.
  3. Set Max results (default 200).
  4. Click Save & Start.
  5. Download as JSON, CSV, or Excel, or pull via API or MCP.

FAQ

What years are available? CMS publishes Part D spending data from 2013 through the most recent release (currently 2023). New years are typically released 18 months after the close of the reporting period.

Does this include generic drugs? Yes. Both brand-name and generic drugs are included, identified separately in the brand_name and generic_name fields.

What is the unit cost field? unit_cost_avg_usd is a weighted average cost per unit (pill, vial, and so on) across all dispensing pharmacies and claim types.

Can I track a drug's spending over multiple years? Yes. Leave the year field blank to retrieve all available years for a given drug name, then sort by year downstream.

How am I charged? Pay per record at $0.004 per record ($4 per 1,000). The first 10 records are free for life on every Apify account. Zero charge on empty runs.

Use in Claude, ChatGPT & any MCP agent

https://mcp.apify.com/?tools=themineworks/medicare-part-d-drug-spending

Or call it programmatically with the Apify client:

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: 100,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

๐Ÿ› ๏ธ Complete your pharma intelligence pipeline

Spending is one layer. Add safety, trials, and literature:

Typical flow: pull Part D spend for a molecule, cross-check FAERS for post-market signals, and pair with the active trials pipeline.

Found a bug or have a feature request? Open an issue on the actor's Apify Console page or reach out through the Apify profile.