Medicare & Medicaid Drug Spending Scraper avatar

Medicare & Medicaid Drug Spending Scraper

Pricing

from $3.00 / 1,000 results

Go to Apify Store
Medicare & Medicaid Drug Spending Scraper

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

Compute Edge

Maintained by Community

Actor 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

FieldDescription
programProgram type: partD, partB, or medicaid
brandNameDrug brand name (e.g. Humira, Eliquis)
genericNameGeneric/chemical name (e.g. adalimumab, apixaban)
manufacturerManufacturer name (Part D & Medicaid only)
totalManufacturersNumber of manufacturers for this drug
latestYearLatest year of data detected (e.g. 2024)
totalSpendingTotal Medicare/Medicaid spending in latest year (USD)
totalClaimsTotal number of claims in latest year
totalDosageUnitsTotal dosage units dispensed
totalBeneficiariesTotal beneficiaries covered (Part D & Part B only)
avgSpendPerClaimAverage spending per claim in latest year (USD)
avgSpendPerBeneficiaryAverage spending per beneficiary (Part D & Part B only)
Tot_Spndng_2020Tot_Spndng_2024Raw annual total spending columns
Tot_Clms_2020Tot_Clms_2024Raw annual claims count columns
CAGR_Avg_Spnd_Per_Dsg_Unt_20_24Compound annual growth rate (2020–2024)

How to scrape Medicare drug spending data

Follow these steps to extract CMS drug spending data in minutes:

  1. Open the Actor in Apify Store and click Try for free.
  2. Choose a program from the dropdown: Part D (retail prescriptions), Part B (physician-administered), or Medicaid.
  3. 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.
  4. Set Max Results: default is 500 records. Set up to 50,000 for a full dataset export.
  5. Click Start and wait for the run to complete (typically under 30 seconds for 500 records).
  6. 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.

ScenarioRecordsEstimated Cost
Quick drug lookup500~$0.002
Full Part D dataset50,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:


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.


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.