Medicare Part D Drug Spending Scraper
Pricing
$1.00 / 1,000 drug record scrapeds
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
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
1
Monthly active users
a day ago
Last modified
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:
| Field | Description |
|---|---|
๐
year | Reporting year (2013 to 2023) |
๐ท๏ธ brand_name | Brand name as filed with CMS |
๐ generic_name | Generic (chemical) name |
๐ญ manufacturer | Manufacturer or brand-name owner |
๐ฅ total_beneficiaries | Distinct Medicare beneficiaries who received the drug |
๐ total_claims | Total claims paid |
๐ต total_spending_usd | Total Medicare Part D spending in USD |
๐ spending_per_beneficiary_usd | Average spend per beneficiary |
๐ฏ unit_cost_avg_usd | Weighted average cost per unit |
๐ scraped_at | ISO 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
- Open the actor and enter a Drug name (partial match, e.g.
Ozempic,atorvastatin). - Optionally add a Manufacturer, Year, or Minimum total spend threshold.
- Set Max results (default 200).
- Click Save & Start.
- 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:
- openFDA Scraper: FAERS adverse events, drug labels, recalls, and device data.
- ClinicalTrials.gov Scraper: active trials for any drug or condition.
- CMS Hospital Quality: 4,500+ US hospitals with star ratings.
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.