Medicare & Medicaid Drug Spending

Yearly government spending on each drug in Medicare Part D, Medicare Part B or Medicaid, from CMS: brand, generic name, manufacturer, total spending, claims, beneficiaries, dosage units and average spending per claim, beneficiary and unit, one row per drug and year.

$0.50 per 1,000 records

You pay only for the records you get. Zero records cost zero. 10,000 free records of this API to start (5,000 at the base price of $1 per 1,000), no card.

Try it
Ready-made, maintained by usRecords, 19 fieldsv1.0

Data from data.cms.gov/summary-statistics-on-use-and-payments/medicare-medicaid-spending-by-drug

Get this data

Try it here with a few records, download the sample, fill a Google Sheet, or call it from your own code.

Try it

Programoptional
part_d (Medicare drugs patients take themselves), part_b (drugs given in doctors' offices and outpatient settings) or medicaid.
Drugoptional
Brand or generic name, such as Ozempic or semaglutide; for Part B also a HCPCS code such as J9271. Leave empty for every drug in the program.
Example: Ozempic
Manufactureroptional
Only rows whose manufacturer name contains these words, such as Novo Nordisk. Part D and Medicaid only.
Example: Novo Nordisk
Leveloptional
all rows, only the overall total of each drug, or only the rows per manufacturer (Part D and Medicaid). Part B rows count as overall.
Yearoptional
Only this year, such as 2024. Leave empty for every year in the current release.
Example: 2024

Run it on this page, or call it from your code with the endpoint in the developer section. A free key covers 10,000 records of this API, no card. Create a free key

For developers: the API and MCPThe endpoint, code in curl, JavaScript and Python, every input, and files for your tools
Endpoint
POSThttps://pullrow.dev/v1/apis/medicare-medicaid-drug-spending/run
  • Small runs answer in the same request; longer ones answer 202 with a run to poll.
  • fields returns only the fields you name. The examples send the ones picked on this page.
  • Idempotency-Key is optional. A retry with it is never charged twice.
  • You pay for records returned. Zero records cost zero.

Every run option, explained

Calling it needs a key
10,000 free records of this API to start. No card.
curl
curl -X POST "https://pullrow.dev/v1/apis/medicare-medicaid-drug-spending/run" \
  -H "Authorization: Bearer $PULLROW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{"program":"part_d"},"max_items":50}'

Inputs

Send them as input in the request body. Leave one out to use its default.

programtext
part_d (Medicare drugs patients take themselves), part_b (drugs given in doctors' offices and outpatient settings) or medicaid.
default: part_dexample: part_done of: part_d, part_b, medicaid
drugtext
Brand or generic name, such as Ozempic or semaglutide; for Part B also a HCPCS code such as J9271. Leave empty for every drug in the program.
example: Ozempic
manufacturertext
Only rows whose manufacturer name contains these words, such as Novo Nordisk. Part D and Medicaid only.
example: Novo Nordisk
leveltext
all rows, only the overall total of each drug, or only the rows per manufacturer (Part D and Medicaid). Part B rows count as overall.
default: allexample: manufacturerone of: all, overall, manufacturer
yearnumber
Only this year, such as 2024. Leave empty for every year in the current release.
example: 2024

What's in each record

19 fields: 18 here, 1 technical one under Technical details.

Basics

  • Program

    Medicare Part D, Medicare Part B or Medicaid.

    Example Medicare Part D

  • Brand name

    Brand name of the drug.

    Example Ozempic

  • Generic name

    Generic name of the drug.

    Example Semaglutide

  • Manufacturer

    The manufacturer; null on total rows and in Part B.

    Example Novo Nordisk

  • Overall

    Whether the row totals all manufacturers of the drug.

    Example No

  • Manufacturers count

    Number of manufacturers of the drug.

    Example 1

  • Total claims

    Number of claims that year.

    Example 1,204,138

  • Total beneficiaries

    Number of patients who received the drug that year (Medicare only).

    Example 269,663

  • Dosage units

    Dosage units dispensed or given that year, such as pills, milliliters or billing units.

    Example 3,813,091.786

  • Change in average spend per unit

    CMS's change in average spending per unit from the year before into the latest year, as a fraction (0.05 is 5% higher); on the latest year's row only.

    Example -0.138872

  • Annual growth rate

    CMS's compound annual growth rate of average spending per unit over the years shown, as a fraction; the same on every year of the drug.

    Example -0.083123

  • Outlier

    Whether CMS flags that year's average spending per unit as an outlier; use those values with care.

    Example No

Prices

  • Total spending

    Total spending on the drug that year; the currency is in currency.

    Example $1,455,812,267.10

  • Currency

    Currency of the money fields: USD.

    Example USD

  • Average spend per claim

    Average spending per claim that year.

    Example $1,209.01

  • Average spend per beneficiary

    Average spending per patient that year (Medicare only).

    Example $5,398.64

  • Average spend per unit

    Average spending per dosage unit that year (weighted across products in Part D and Medicaid).

    Example $433.67

Dates

  • Year

    The calendar year the spending is for.

    Example 2020

Technical detailsField names and types for developers, and the 1 field hidden above

Hidden by default

This field comes with each record too. It is an internal code, a note about how the record was read or a copy of what was searched for, so the lists above leave it out.

  • ID idThis row's key: program, brand, generic name, billing code or manufacturer, and year.

Field names and types

The names your code reads in each record. "Filled" counts how many of the 3 sample records carry the field.

Field nameTypeShown on this page asFilled
idtextID (hidden)3 of 3
programtextProgram3 of 3
brand_nametextBrand name3 of 3
generic_nametextGeneric name3 of 3
manufacturertextManufacturer3 of 3
is_overallyes or noOverall3 of 3
manufacturers_countnumberManufacturers count3 of 3
yearnumberYear3 of 3
total_spendingmoneyTotal spending3 of 3
currencytextCurrency3 of 3
total_claimsnumberTotal claims3 of 3
total_beneficiariesnumberTotal beneficiaries3 of 3
dosage_unitsnumberDosage units3 of 3
avg_spend_per_claimmoneyAverage spend per claim3 of 3
avg_spend_per_beneficiarymoneyAverage spend per beneficiary3 of 3
avg_spend_per_unitmoneyAverage spend per unit3 of 3
change_in_avg_spend_per_unitnumberChange in average spend per unit0 of 3
annual_growth_ratenumberAnnual growth rate3 of 3
is_outlieryes or noOutlier3 of 3

How it reads the site

Runs on a reader we built and maintain by hand for this site.

Sample records

Sample records
RecordProgramBrand nameGeneric nameManufacturerOverallManufacturers countTotal claimsTotal beneficiariesDosage unitsChange in average spend per unitAnnual growth rateOutlierTotal spendingCurrencyAverage spend per claimAverage spend per beneficiaryAverage spend per unitYear
1Medicare Part DOzempicSemaglutideNovo NordiskNo11,204,138269,6633,813,091.786—-0.083123No$1,455,812,267.10USD$1,209.01$5,398.64$433.672020
2Medicare Part DOzempicSemaglutideNovo NordiskNo12,016,177458,6436,617,457.857—-0.083123No$2,621,694,348.30USD$1,300.33$5,716.20$452.722021
3Medicare Part DOzempicSemaglutideNovo NordiskNo13,410,839780,25311,314,543.293—-0.083123No$4,628,160,643.40USD$1,356.90$5,931.62$468.242022

Sample records from the example output this API publishes. Email addresses and phone numbers in them are masked. Hover over a column name to see the field name your code reads.

Reliability

Counted from real runs. Our own health checks are left out. A run succeeded when it finished and the site neither blocked it nor broke it.

Incidents and repairs

How it is kept working What a repair can't do

A ready-made API, maintained by us. It is not part of the daily check or the automatic rebuild yet.

  • You pay only for records returned. A run that returns none costs nothing.
Known limits
  • Data as the Centers for Medicare & Medicaid Services publishes it in its Spending by Drug datasets, updated once a year; the current release covers 2020 to 2024. CMS does not endorse this API.
  • Part D and Medicaid spending is gross: before manufacturer rebates, which CMS does not publish, so net spending is lower. Part B spending is the full payment, Medicare's share plus the patient's.
  • Part B lists one row per drug billing code (HCPCS) and has no manufacturer; the billing code itself is not returned, but it works as the drug search, such as J9271.
  • Medicaid rows have no beneficiary counts.
  • change_in_avg_spend_per_unit is CMS's published change into the latest year and sits on that year's row only; compare earlier years through avg_spend_per_unit.
  • drug matches words anywhere in a row, including the manufacturer name, so a broad word such as insulin also finds syringes and pen needles.
  • At most 100,000 rows per run, enough for a whole program (Medicaid has about 18,500 drug rows, up to five years each).
  • Public domain U.S. government data.

Version history

A run uses the live version unless the request names another one with version.