CMS Medicare Data Scraper - data.cms.gov API avatar

CMS Medicare Data Scraper - data.cms.gov API

Pricing

from $6.23 / 1,000 clinician rows

Go to Apify Store
CMS Medicare Data Scraper - data.cms.gov API

CMS Medicare Data Scraper - data.cms.gov API

Pull any of the 395 Medicare and Medicaid datasets on data.cms.gov: 3.4M clinicians, provider enrollment and ownership, hospital and nursing home quality, Part B/Part D utilisation and drug spending. Server-side filters, no API key.

Pricing

from $6.23 / 1,000 clinician rows

Rating

0.0

(0)

Developer

ParseForge

ParseForge

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Share

ParseForge

CMS Medicare Data Scraper

Pull any of the 395 Medicare and Medicaid datasets published on data.cms.gov — 3.4 million clinicians with their NPI, specialty and practice address; PECOS provider enrollment, ownership and revalidation; CMS star ratings for hospitals, nursing homes, hospices, home health and dialysis; Part B and Part D utilisation and drug spending — as flat rows, filtered on CMS's own servers. No API key, no login, no browser. Export to CSV, JSON, Excel, or XML.

CMS runs two separate open-data systems on the same domain and neither has a bulk client. CMS Data (data.cms.gov) holds 159 datasets behind a query API with 3,102 dated versions going back to 2013; the Provider Data Catalog (data.cms.gov/provider-data) holds the 236 Care Compare files behind a completely different query API. Both are anonymous, both cap a page at a few thousand rows, and both need their own filter syntax. This Actor speaks both, resolves the archives, and returns one flat row per record.

Who uses itWhat they pull from data.cms.gov
Healthcare sales and lead-gen teams3.4M clinicians and 57k equipment suppliers with NPI, specialty, group practice and phone, filtered to a state, city or ZIP
Pharma commercial and market-access analystsPart D prescribing by provider and drug (28M rows), Part B and Part D spending by drug, opioid prescribing rates
Payers, health systems and M&A analystsHospital, SNF, home health, hospice and RHC enrollment plus the full ownership chain, including private-equity and REIT owners
Quality and patient-safety researchersHCAHPS, complications and deaths, infections, readmissions, star ratings, nursing home deficiencies and penalties
Compliance and provider-credentialing teamsOpt-out affidavits, revoked providers, revalidation due dates, Order and Referring eligibility
Health-policy economists and journalistsGeographic variation, market saturation, telehealth trends, cost reports, enrollment counts by county and year

What it does

Pick a dataset, add filters, and get rows. 92 datasets are wired up with named filters that were each measured against the live API; the other 303 are reachable by ID through the same interface.

  • 👩‍⚕️ Clinicians and providers. Doctors and Clinicians National Downloadable File (3.4M), facility affiliations (2.3M), utilisation (635k), Medicare FFS provider enrollment (3.0M), Order and Referring (2.0M), opt-out affidavits (58k), revoked providers (8k), revalidation lists (9.9M across three files), the specialty-to-taxonomy crosswalk.
  • 🏢 Facility enrollment and ownership. Hospital, SNF, home health, hospice, rural health clinic and FQHC enrollments, their complete owner lists (830k owner rows, flagged for private equity, REIT, holding company and chain home office), changes of ownership, opioid treatment programs, home infusion providers and the two Provider of Services files (726k rows, up to 473 columns).
  • 🏥 Facility quality and ratings. Hospital General Information and the whole Care Compare measure set — HCAHPS, complications and deaths, healthcare-associated infections, readmissions, timely and effective care, imaging efficiency, value-based purchasing, maternal health. Nursing home provider information, ownership, health and fire-safety deficiencies (620k), penalties, MDS and claims quality measures, survey summaries. Home health agencies, hospices, dialysis facilities, inpatient rehab, long-term care hospitals, ambulatory surgical centres, inpatient psychiatric facilities, medical equipment suppliers.
  • 📈 Utilisation and payments. Physician and Other Practitioners by provider (1.3M) and by provider and service (9.8M), inpatient and outpatient hospitals by provider and service, DME by supplier and by referring provider, the Physician/Supplier Procedure Summary (14.5M).
  • 💊 Prescribing and drug spending. Part D prescribers by provider (1.4M) and by provider and drug (28.0M), Part D by geography and drug, Part B / Part D / Medicaid spending by drug, discarded drug units, opioid prescribing rates.
  • 💵 Spending, enrollment and geography. Monthly Medicare enrollment (580k), geographic variation (246 columns), market saturation (1.0M), hospital service area, telehealth trends, hospital / SNF / home health cost reports, ACOs and their participants, Quality Payment Program results.
  • 🗂️ Catalog mode. One row per dataset across both catalogs — title, description, theme, keywords, contact, update cadence, next update date, licence, row and column counts, how many archived versions exist, and the data-dictionary link. Optionally the column list and every downloadable file.

Every row carries the columns CMS publishes, unchanged, plus datasetKey, datasetTitle, datasetId, catalog, vintage, sourceUrl and scrapedAt. Where the dataset has one, it also carries a normalised npi, ccn, providerName, lastName, specialty, city, state and zipCode, so rows from different CMS files join on the same key names.

Filters that run on CMS's servers

A filtered run downloads only the rows you asked for, so you pay for matches and not for browsing.

FilterWorks onMatching
State70 datasetsExact, two-letter code
Provider or facility name60 datasetsSubstring, case-insensitive
City56 datasetsSubstring
ZIP code56 datasetsFive-digit prefix
CCN / provider number46 datasetsExact
NPI30 datasetsExact
Clinician last name22 datasetsSubstring
Specialty / provider type17 datasetsSubstring
Geography (state or county)7 datasetsName or code, either spelling
Year7 datasets by column, the rest by archived versionExact
Drug name (brand or generic)6 datasetsSubstring
HCPCS code5 datasetsExact
Full-text searchEvery CMS Data datasetAll columns at once

Beyond those, Custom filters reach any column of any dataset with ten operators — =, !=, >, >=, <, <=, contains, in, not in, between — written one per line as Tot_Clms > 1000 or Prscrbr_State_Abrvtn in CA,NY,TX. Columns narrows the projection, Sort by orders the whole dataset before the limit applies, and Max rows is a hard ceiling on both what is written and what is billed.

What you can do with CMS Medicare data

Build a targeted clinician list.

Set the dataset to Doctors and Clinicians, state: "CA" and specialty: "Cardio", and get 7,002 California cardiologists with NPI, group practice, address and phone — one run, one page of results.

Find the top prescribers of a drug.

Part D Prescribers by Provider and Drug, drugName: "OZEMPIC", state: "NV", sortBy: "Tot_Drug_Cst" descending, maxItems: 200. CMS does the sort across all 28 million rows; you pay for 200.

Trace who owns a nursing home chain.

Nursing Home Ownership by providerName, then SNF All Owners for the same operator, to get the ownership percentages and the private-equity, REIT and chain-home-office flags CMS publishes on each owner.

Screen a provider roster for compliance.

Run Opt Out Affidavits, Revoked Providers and Revalidation Due Date with the same state, and reconcile against your own list of NPIs.

Watch the portal for refreshed data.

Catalog mode with catalogModifiedAfter set to yesterday returns only the datasets CMS republished, with their next scheduled update date.

Compare a facility against its state and the nation.

Pull the hospital-, state- and national-level versions of the same measure file and line them up on measure_id.

Track a market over ten years.

Ask for the same dataset with year set to 2015, 2019 and 2024: the Actor resolves each archived version of the file and stamps every row with the vintage it came from.

Why choose this scraper

What you get
Both CMS catalogs395 datasets behind one input, not just the Care Compare half or just the open-data half
Filters that are proved, not guessedEvery named filter was checked against the live row count. A filter the dataset cannot support stops the run and names the columns it does have — CMS's own API would have silently returned the whole file
Ten-year archives3,102 dated versions in the CMS Data catalog; ask for a year and get that year's file, stamped
The full column setUp to 473 columns per row, exactly as CMS publishes them, plus normalised join keys across datasets
The ZIP+4 trap handledHalf the CMS files store ZIP+4. A five-digit ZIP is matched as a prefix and the near-misses are dropped before they are written or billed
Row counts before you payEvery run logs how many rows match before it starts pulling them
No proxy, no browser, no keydata.cms.gov answers plain HTTP; the run costs what the compute costs

How it compares

FeatureParseForgeOther CMS / Medicare scrapers on Apify
Datasets covered395One dataset each (hospitals, or home health, or prescribers)
Both CMS catalogsYesOne or the other
Server-side filters with 10 operatorsYesNot listed
Archived versions back to 2013YesNot listed
Data dictionary and file list per datasetYesNot listed
Named filters validated against the live APIYesNot listed

Configure the run

A first run with the defaults returns California cardiologists:

{
"dataset": "doctors-clinicians",
"state": "CA",
"specialty": "Cardio",
"maxItems": 100
}

Five-star nursing homes in Florida with more than 200 beds:

{
"dataset": "nursing-homes",
"state": "FL",
"filters": ["overall_rating >= 5", "number_of_certified_beds > 200"],
"maxItems": 500
}

Top Ozempic prescribers in Nevada by drug cost:

{
"dataset": "part-d-prescribers-by-drug",
"drugName": "OZEMPIC",
"state": "NV",
"sortBy": "Tot_Drug_Cst",
"sortOrder": "desc",
"maxItems": 200
}

Hospital ownership including the private-equity flags:

{
"dataset": "hospital-owners",
"state": "TX",
"maxItems": 1000
}

A 2015 vintage of the Part D prescriber file:

{
"dataset": "part-d-prescribers",
"state": "WY",
"year": 2015,
"maxItems": 500
}

Everything CMS updated since a date, with the column list and download links:

{
"dataset": "catalog",
"catalogModifiedAfter": "2026-08-01",
"includeFields": true,
"includeResources": true,
"maxItems": 500
}

Any other dataset, by ID:

{
"dataset": "custom",
"customDatasetId": "https://data.cms.gov/provider-data/dataset/yv7e-xc69",
"filters": ["measure_id = OP_18b"],
"maxItems": 200
}

Limits

  • 28 of the 159 CMS Data datasets have no query API. The Prescription Drug Plan Formulary files, the CMS Program Statistics series, the Medicare Current Beneficiary Survey and the Hospital Referral Region file are published as ZIP or XLSX only. Catalog mode lists them with their download URLs; asking for their rows stops the run and says so.
  • Page sizes are CMS's, not ours: 6,500 rows per request on CMS Data and 1,500 on the Provider Data Catalog, and the Actor shrinks the page further on wide files so a 473-column row cannot blow the container. Measured throughput: 20,000 rows in 33 s from CMS Data and 70 s from the Provider Data Catalog.
  • Deep offsets slow the Provider Data Catalog down. Reading past about a million rows costs roughly 10 s per page there, so a filter or a sort beats paging to the end of the 3.4M-row clinician file.
  • Full-text search is CMS Data only. The Provider Data Catalog has no keyword endpoint; the run stops and names the column filters that dataset does support rather than pretending to search.
  • Year is an archive on CMS Data and a column filter where the file has one. The Provider Data Catalog keeps only the current file, so a year there stops the run.
  • CMS spells a state two ways. Geographic Variation and Market Saturation say CA; the opioid, telehealth and COVID files say California. Either spelling is accepted and the run logs when it switched.
  • Apify puts a cost ceiling on every run. When a run reaches it, the platform stops accepting charges. The Actor watches that ceiling and stops there with a warning naming the limit, rather than continuing to deliver rows it cannot bill for. Raise the run's Maximum cost in the run options to pull more in one go.
  • Suppressed cells stay suppressed. CMS blanks counts below 11 in the utilisation and prescriber files and flags them in the *_Sprsn_Flag columns; those columns come through as CMS publishes them.

Pricing

Pay-per-event. $7 per 1,000 rows whichever dataset you pick, plus $0.02 per run start. There is no charge for the row count, the catalog lookup, the archive resolution or any row a filter dropped — only rows that reach your dataset are billed.

EventPrice per rowWhat it is
clinician-row$0.007Doctors and Clinicians national file
affiliation-row$0.007Clinician facility affiliations
prescriber-row$0.007Part D prescribing and opioid rates
utilization-row$0.007Physician, hospital and DME utilisation
enrollment-row$0.007Provider and facility enrollment
ownership-row$0.007Owners and changes of ownership
facility-row$0.007Facility directories with ratings
quality-row$0.007Quality and patient-experience measures
deficiency-row$0.007Deficiencies, penalties, surveys
spending-row$0.007Spending, cost reports, enrollment counts
supplier-row$0.007Medical equipment suppliers
order-referring-row$0.007Order and Referring eligibility
opt-out-row$0.007Opt-out affidavits
revoked-row$0.007Revoked providers and suppliers
revalidation-row$0.007Revalidation due dates and reassignments
catalog-dataset$0.007One dataset's metadata in Catalog mode
custom-row$0.007A dataset outside the curated list
dataset-field$0.002Optional. One column of the data dictionary
dataset-resource$0.002Optional. One downloadable file
apify-actor-start$0.02 per runCharged once when the run starts
RunApproximate cost
100 California cardiologists$0.72
1,000 nursing homes with ratings$7.02
5,000 Part D prescribers$35.02
The 395-dataset catalog$2.79

The two extras are off by default, so a plain run only ever bills the start fee and the rows it delivers. New Apify accounts start with $5 in free credit.

data.cms.gov needs no proxy and no browser, so the only cost behind these rows is compute: measured on the platform at $0.005 per 1,000 rows on a full run and $0.04 per 1,000 on a 4-row one. The price buys the two-catalog coverage, the measured filter map, the archives and the guarantee that a filter which cannot work stops the run instead of billing you for the whole file.

Free users

Free-plan runs return up to 25 rows as a preview. Upgrade your Apify plan to pull whole datasets.

Run it

  1. Create a free Apify account with $5 in credit.
  2. Open the CMS Medicare Data Scraper.
  3. Pick a dataset, add filters, set Max rows, then click Start.
  4. Export the results as CSV, Excel, JSON, or XML from the Dataset tab, or schedule the run monthly to follow CMS's update cadence.

Run it programmatically through the Apify API (run-sync-get-dataset-items) or the ApifyClient for JavaScript and Python.

Use with AI agents (MCP)

Give an AI agent live access to CMS Medicare data through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

$claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/cms-medicare-scraper"

Then ask: "Which Florida nursing homes have a 5-star overall rating and more than 200 beds, and who owns them?"

FAQ

Is the data public? Yes. CMS publishes every one of these datasets on data.cms.gov for anyone to download; the Actor reads the same public APIs the site's own data viewer uses. No login or API key is involved.

Does it contain patient data? No. These are provider-, facility- and geography-level files. CMS suppresses any cell derived from fewer than 11 beneficiaries before publishing.

How current is it? It depends on the file: enrollment and Care Compare data refresh monthly or quarterly, utilisation and prescriber files annually, and Order and Referring every 3–4 days. Every dataset row in Catalog mode carries CMS's own update cadence and, for the Provider Data Catalog, the next scheduled update date.

How do I find a dataset that is not in the list? Run Catalog mode and search it, then feed the datasetId back in with Dataset set to Custom.

Why did my filter stop the run instead of returning rows? Because the dataset has no column for it. CMS's own API ignores a filter it does not recognise and returns the whole file, which would quietly bill you for rows you never asked for; the Actor refuses instead and lists the columns that dataset does have.

Does it cover PECOS, HCRIS and the MIPS files? Yes. PECOS enrollment is Medicare FFS Public Provider Enrollment plus the per-facility enrollment files; HCRIS is the hospital, SNF and home health cost reports; MIPS results are the Quality Payment Program dataset and the clinician and group public-reporting files in the Provider Data Catalog.

Is this the same as the NPI registry? No, but it is the Medicare-side view of the same providers. NPPES is HHS's registry of every NPI; the Doctors and Clinicians National Downloadable File is CMS's list of clinicians actually enrolled in and billing Medicare, keyed by the same NPI, with their specialty, group practice and Medicare assignment status.

Where do the CMS star ratings come from? The overall hospital rating is in Hospital General Information, the nursing home five-star ratings in Nursing Home Provider Information, and the dialysis five-star in the Dialysis Facility file. Each measure behind them is its own dataset in the list.

Can I get the column definitions? Turn on Include the data dictionary. Provider Data Catalog datasets return a label and SQL type per column; CMS Data datasets return the header row, and the catalog row links CMS's PDF dictionary.