Medicare & Medicaid Drug Spending Scraper
Pricing
from $3.00 / 1,000 results
Medicare & Medicaid Drug Spending Scraper
Extract CMS Medicare Part D, Part B, and Medicaid drug spending data. Filter by brand name, generic name, or manufacturer. Includes multi-year spending trends for policy research, pharma analysis, and healthcare intelligence.
Pricing
from $3.00 / 1,000 results
Rating
0.0
(0)
Developer
Compute Edge
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Categories
Share
Medicare & Medicaid Drug Spending Scraper — Part B & Part D
Extract structured drug spending data from the Centers for Medicare & Medicaid Services (CMS) public API — no authentication, no sign-up, no rate limits. This Actor covers three major federal drug spending programs:
- Medicare Part D — Retail prescription drug spending (the largest program by volume)
- Medicare Part B — Physician-administered drugs (infusions, injectables, oncology)
- Medicaid — State/federal prescription drug spending for low-income beneficiaries
Each record includes multi-year spending trends (2020–2024), claims volume, beneficiary counts, and average cost per claim — the exact data used in pharma pricing research, health policy analysis, and drug cost intelligence reports.
Features
- Scrape all three CMS drug spending programs from a single Actor
- Filter by brand name, generic name, or manufacturer (case-insensitive partial match)
- Automatically detects the latest available data year from column names
- Outputs both normalized summary fields (easy to query) and all raw year columns (no data lost)
- Pagination handled automatically — extract up to 50,000 records per run
- Empty input
{}returns 500 Part D records immediately — no configuration required
Output Fields
| Field | Description |
|---|---|
program | Program type: partD, partB, or medicaid |
brandName | Drug brand name (e.g. Humira, Eliquis) |
genericName | Generic/chemical name (e.g. adalimumab, apixaban) |
manufacturer | Manufacturer name (Part D & Medicaid only) |
totalManufacturers | Number of manufacturers for this drug |
latestYear | Latest year of data detected (e.g. 2024) |
totalSpending | Total Medicare/Medicaid spending in latest year (USD) |
totalClaims | Total number of claims in latest year |
totalDosageUnits | Total dosage units dispensed |
totalBeneficiaries | Total beneficiaries covered (Part D & Part B only) |
avgSpendPerClaim | Average spending per claim in latest year (USD) |
avgSpendPerBeneficiary | Average spending per beneficiary (Part D & Part B only) |
Tot_Spndng_2020 … Tot_Spndng_2024 | Raw annual total spending columns |
Tot_Clms_2020 … Tot_Clms_2024 | Raw annual claims count columns |
CAGR_Avg_Spnd_Per_Dsg_Unt_20_24 | Compound annual growth rate (2020–2024) |
How to scrape Medicare drug spending data
Follow these steps to extract CMS drug spending data in minutes:
- Open the Actor in Apify Store and click Try for free.
- Choose a program from the dropdown: Part D (retail prescriptions), Part B (physician-administered), or Medicaid.
- Optionally add filters: enter a brand name (e.g.
Keytruda), generic name (e.g.pembrolizumab), or manufacturer (e.g.Merck). All filters are case-insensitive partial matches — leave blank to retrieve all drugs. - Set Max Results: default is 500 records. Set up to 50,000 for a full dataset export.
- Click Start and wait for the run to complete (typically under 30 seconds for 500 records).
- Download results as JSON, CSV, or Excel from the Dataset tab.
Example: Find all Pfizer drugs in Part D with spending data
Set program to partD, manufacturer to Pfizer, and maxResults to 5000. The Actor will return every Pfizer drug entry across all available years in a single structured dataset.
Pricing
This Actor uses per-result pricing: you are charged $0.003 per record extracted, plus standard Apify compute time.
| Scenario | Records | Estimated Cost |
|---|---|---|
| Quick drug lookup | 500 | ~$0.002 |
| Full Part D dataset | 50,000 | ~$0.15 |
| All three programs (150K) | 150,000 | ~$0.45 |
Apify compute charges are typically under $0.01 per run for this Actor (it uses no browser, only HTTP requests).
Input Example
{"program": "partD","brandName": "Humira","genericName": "","manufacturer": "","maxResults": 100}
Output Example
{"program": "partD","brandName": "Humira","genericName": "Adalimumab","manufacturer": "Overall","totalManufacturers": 3,"latestYear": 2024,"totalSpending": 1234567890.12,"totalClaims": 2345678,"totalDosageUnits": 5678901,"totalBeneficiaries": 345678,"avgSpendPerClaim": 526.14,"avgSpendPerBeneficiary": 3574.22,"Tot_Spndng_2020": 5678901234.56,"Tot_Spndng_2021": 5234567890.12,"Tot_Spndng_2022": 4567890123.45,"Tot_Spndng_2023": 2345678901.23,"Tot_Spndng_2024": 1234567890.12,"CAGR_Avg_Spnd_Per_Dsg_Unt_20_24": "-0.3012"}
Other Scrapers
Need more healthcare and government data? Check out our related Actors:
- Medicare Provider Scraper — Extract Medicare-enrolled providers, their specialties, and billing addresses
- DailyMed Drug Labels Scraper — Full FDA drug label data including dosage, warnings, and indications
- FDA Drug Approvals Scraper — Track new drug approvals, supplemental NDAs, and biosimilar designations
- HHS OIG Exclusions Scraper — List of healthcare providers excluded from federal programs
FAQ
Q: How current is the data? CMS updates these datasets annually. The Actor automatically detects the latest year available in each dataset (currently 2024 for most programs). The data typically lags about 18–24 months behind the current calendar year.
Q: What is the difference between Part B and Part D? Part D covers retail prescriptions that patients fill at a pharmacy. Part B covers drugs administered by a physician or clinic (infusions, injectables, chemotherapy). Many high-cost biologics appear in Part B, not Part D.
Q: Why does the manufacturer filter not work for Part B? Medicare Part B data is structured around HCPCS procedure codes, not manufacturers. The manufacturer field is not present in Part B records. Use brand name or generic name filters instead.
Q: Can I get all records without any filters?
Yes. Leave all filter fields blank and set maxResults to the number of records you need (up to 50,000 per run). Run the Actor three times (once per program) to collect the complete CMS drug spending universe.
Q: What does "Overall" mean in the Manufacturer field?
When Mftr_Name is "Overall", the record represents aggregated spending across all manufacturers of that drug. Manufacturer-specific rows appear separately in the same dataset.
Legal Disclaimer
This Actor retrieves publicly available data from the CMS data API (data.cms.gov) which publishes federal drug spending statistics under an open data policy. All data is aggregate spending information — no personal health information (PHI), no individually identifiable data. Use of this Actor does not involve accessing any protected, login-restricted, or copyrighted data. Users are responsible for ensuring their use of the extracted data complies with applicable laws and CMS data use terms. For questions, contact support via Apify.