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
A clean, queryable DuckDB database built from the CMS Medicare Physician & Other Practitioners Public Use Files -- provider-level Medicare Part B claims data from CY2012 through CY2023.
132,947,347 rows across 3 tables covering what every physician billed, what Medicare paid, and how many services and beneficiaries per NPI per HCPCS code.
Built with cms-medicare-database.
Quick Start
DuckDB CLI
INSTALL httpfs;
LOAD httpfs;
ATTACH 'https://huggingface.co/datasets/Nason/cms-medicare-database/resolve/main/cms_medicare.duckdb' AS cms (READ_ONLY);
-- Total Medicare spending by year
SELECT year, ROUND(SUM(line_srvc_cnt * avg_medicare_payment_amt) / 1e9, 2) AS total_spending_billions
FROM cms.physician_services
GROUP BY year ORDER BY year;
Python
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.
Tables
| Table | Description | Rows |
|---|---|---|
physician_services |
Provider-level Medicare Part B claims: one row per NPI per HCPCS code per place | 116,190,383 |
physician_summary |
Provider-level aggregate summary: one row per NPI per year with total services, | 13,528,933 |
geography_service |
Geographic aggregate: Medicare utilization and payment by state/national level, | 3,228,031 |
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.
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_Cdre-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 tophysician_services.hcpcs_code.physician_summaryidentifiers 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_servicesa systematic ~17-21% payment undercount vsphysician_summary— use the summary table for provider totals. provider_genderis 100% NULL in every year (removed retroactively by CMS); chronic-condition columns are NULL before 2017 and top-coded at 75.geography_servicemixes National and State rows — filterRndrng_Prvdr_Geo_Lvl.
- Downloads last month
- 68