Dataset Viewer

The dataset viewer is not available because its heuristics could not detect any supported data files. You can try uploading some data files, or configuring the data files location manually.

CMS Medicare Physician & Other Supplier Database

Centers for Medicare & Medicaid Services (CMS) published Medicare Part B fee-for-service utilization and payment summaries for calendar years 2013–2024. Use provider-year summaries for provider totals, or provider–procedure–place-of-service–year records to examine published service patterns and average payments. The service table omits cells with fewer than 11 beneficiaries, so summing its payments does not give total Medicare spending. Medicare Advantage, Part A and Part D are outside this dataset, and beneficiaries can appear in multiple service cells.

Start querying

Preview published provider-year payment totals for New York in 2023. The service table is suppressed and cannot establish total Medicare spending.

Rndrng_NPI is the provider's National Provider Identifier (NPI); Tot_Mdcr_Pymt_Amt is the published provider-year Medicare payment amount in U.S. dollars; year is calendar year.

Choose R or Python. Install datapond once: use install.packages("datapond") in R, or run python -m pip install datapond in a terminal.

R

library(datapond)
con <- dp_connect("cms-medicare")
tryCatch({
  DBI::dbExecute(con, "SET threads=1")
  DBI::dbExecute(con, "SET memory_limit='128MiB'")
  DBI::dbExecute(con, "SET max_temp_directory_size='0B'")
  print(DBI::dbGetQuery(con, "SELECT year,Rndrng_NPI,Tot_Mdcr_Pymt_Amt FROM physician_summary WHERE year=2023 AND Rndrng_Prvdr_State_Abrvtn='NY' LIMIT 5"))
}, finally = dp_disconnect(con))

Python

import datapond
con = datapond.connect('cms-medicare')
try:
    con.execute("SET threads=1")
    con.execute("SET memory_limit='128MiB'")
    con.execute("SET max_temp_directory_size='0B'")
    print(con.execute("""SELECT year,Rndrng_NPI,Tot_Mdcr_Pymt_Amt FROM physician_summary WHERE year=2023 AND Rndrng_Prvdr_State_Abrvtn='NY' LIMIT 5""").fetchall())
finally:
    con.close()

Queries run on your computer and read the byte ranges they need. A small result can still require a large scan. These examples limit DuckDB to one thread and a 128 MiB buffer pool with disk spill disabled; that is not a limit on the entire R or Python process. Larger analyses may need more memory or a local download with enough disk space.

Tables and coverage

132,947,347 rows across three tables, calendar years 2013–2024. NPI means National Provider Identifier. HCPCS means Healthcare Common Procedure Coding System; CPT means Current Procedural Terminology. Each service cell is a provider–procedure–place-of-service–year combination.

Table Description Rows
physician_summary Published provider-year summary: one row per NPI and year with service, beneficiary and payment totals across HCPCS codes 13,528,933
physician_services Published Medicare Part B service cells: one row per NPI, HCPCS code, place of service and year 116,190,383
geography_service Geographic aggregate: Medicare utilization and payments by state/national level, HCPCS code, place of service and year 3,228,031

See the data dictionary for column definitions.

Joining tables and interpreting payments

  • Published service cells omit those with fewer than 11 beneficiaries. Historical comparisons show a roughly 17–21% payment undercount against physician_summary; use the summary for published provider totals.
  • Beneficiaries can recur across service cells, so their cell counts are not additive.
  • provider_gender is entirely NULL in every year, after CMS removed it retroactively. Chronic-condition percentages are NULL before 2017 and capped at 75.
  • geography_service mixes National and State rows; filter Rndrng_Prvdr_Geo_Lvl before aggregating.
  • Keep provider IDs, ZIP codes and HCPCS codes as text to retain leading zeros and alphanumeric codes. Rndrng_NPI joins to physician_services.npi; geography HCPCS_Cd joins to physician_services.hcpcs_code.
  • Part B fee-for-service utilization and payments do not cover Medicare Advantage, Part A or Part D, and do not measure clinical quality.

More example queries

Sum payments represented by published service cells, by year, in billions of U.S. dollars. This excludes suppressed cells and does not establish total Medicare spending.

INSTALL httpfs;
LOAD httpfs;
ATTACH 'https://huggingface.co/datasets/Nason/cms-medicare-database/resolve/main/cms_medicare.duckdb' AS cms (READ_ONLY);

-- Payments represented by published service cells, by year
SELECT year, ROUND(SUM(line_srvc_cnt * avg_medicare_payment_amt) / 1e9, 2) AS published_service_cell_payments_billions
FROM cms.physician_services
GROUP BY year ORDER BY year;

Other ways to connect

Python with DuckDB

import duckdb
con = duckdb.connect()
con.sql("INSTALL httpfs; LOAD httpfs;")
con.sql("""
    ATTACH 'https://huggingface.co/datasets/Nason/cms-medicare-database/resolve/main/cms_medicare.duckdb'
    AS cms (READ_ONLY)
""")
con.sql("SELECT * FROM cms.physician_services LIMIT 5").show()

DuckDB uses HTTP range requests, so only the pages needed for your query are downloaded.

Sources and maintenance

Source and license reference

See the data dictionary for column definitions and the Centers for Medicare & Medicaid Services for the source. License: Public domain (HCPCS descriptions include AMA CPT content).

Data Source

CMS Medicare Physician & Other Practitioners PUF -- maintained by CMS. Updated annually. Public domain U.S. government data. HCPCS descriptions include AMA CPT content used under CMS license.

Build source

Built with cms-medicare-database.

License

Database build code: MIT. Underlying data: public domain (U.S. government work). Note: HCPCS descriptions contain AMA CPT content included as provided by CMS in the PUF.

GitHub

Full source code, build instructions, and data dictionary: github.com/ian-nason/cms-medicare-database

Changelog

2026-07-06 — Full refresh + data-quality audit

Rebuilt from the current CMS PUF releases, adding CY2024, and repaired after an independent SQL-verified audit.

Data changes

  • CY2024 added to all three tables: 132,947,347 rows total (physician_services 116.2M, physician_summary 13.5M, geography_service 3.2M), CY2013-CY2024.

Fixes

  • geography_service.HCPCS_Cd re-ingested as VARCHAR: numeric auto-casting had NULLed all 282,776 alphanumeric codes (G/J/lab codes) and stripped leading zeros from 137,781 anesthesia codes. Geography-level procedure analysis works again, including joins to physician_services.hcpcs_code.
  • physician_summary identifiers re-typed as VARCHAR: Rndrng_NPI (joins to services now work), Rndrng_Prvdr_Zip5 (1.35M leading-zero ZIPs restored), State_FIPS, RUCA.

Known caveats (see README for the full list)

  • CMS suppression makes physician_services a systematic ~17-21% payment undercount vs physician_summary — use the summary table for provider totals.
  • provider_gender is 100% NULL in every year (removed retroactively by CMS); chronic-condition columns are NULL before 2017 and top-coded at 75.
  • geography_service mixes National and State rows — filter Rndrng_Prvdr_Geo_Lvl.

R with DBI and duckdb

Install the dependencies once with install.packages(c("DBI", "duckdb")).

library(DBI)
con <- dbConnect(duckdb::duckdb())
dbExecute(con, "INSTALL httpfs")
dbExecute(con, "LOAD httpfs")
dbExecute(con, "ATTACH 'https://huggingface.co/datasets/Nason/cms-medicare-database/resolve/main/cms_medicare.duckdb' AS cms (READ_ONLY)")
dbGetQuery(con, "SELECT year FROM cms.physician_services LIMIT 5")
dbDisconnect(con, shutdown = TRUE)

DuckDB uses HTTP range requests; queries run on your machine and may need substantial memory or download data. A LIMIT does not guarantee a small scan.

Downloads last month
24,917