CMS Medicare Data Scraper - data.cms.gov API
parseforge/cms-medicare-scraper
Lead generationDeveloper tools
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.
- Total runs
- 246
- Bookmarked
- 0
- Last modified
- 8 days ago
This scraper was last updated on .
What does the CMS Medicare Data Scraper - data.cms.gov API return?
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 it | What they pull from data.cms.gov |
|---|---|
| Healthcare sales and lead-gen teams | 3.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 analysts | Part 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 analysts | Hospital, SNF, home health, hospice and RHC enrollment plus the full ownership chain, including private-equity and REIT owners |
| Quality and patient-safety researchers | HCAHPS, complications and deaths, infections, readmissions, star ratings, nursing home deficiencies and penalties |
| Compliance and provider-credentialing teams | Opt-out affidavits, revoked providers, revalidation due dates, Order and Referring eligibility |
| Health-policy economists and journalists | Geographic 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.
| Filter | Works on | Matching |
|---|---|---|
| State | 70 datasets | Exact, two-letter code |
| Provider or facility name | 60 datasets | Substring, case-insensitive |
| City | 56 datasets | Substring |
| ZIP code | 56 datasets | Five-digit prefix |
| CCN / provider number | 46 datasets | Exact |
| NPI | 30 datasets | Exact |
| Clinician last name | 22 datasets | Substring |
| Specialty / provider type | 17 datasets | Substring |
| Geography (state or county) | 7 datasets | Name or code, either spelling |
| Year | 7 datasets by column, the rest by archived version | Exact |
| Drug name (brand or generic) | 6 datasets | Substring |
| HCPCS code | 5 datasets | Exact |
| Full-text search | Every CMS Data dataset | All 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 catalogs | 395 datasets behind one input, not just the Care Compare half or just the open-data half |
| Filters that are proved, not guessed | Every 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 archives | 3,102 dated versions in the CMS Data catalog; ask for a year and get that year's file, stamped |
| The full column set | Up to 473 columns per row, exactly as CMS publishes them, plus normalised join keys across datasets |
| The ZIP+4 trap handled | Half 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 pay | Every run logs how many rows match before it starts pulling them |
| No proxy, no browser, no key | data.cms.gov answers plain HTTP; the run costs what the compute costs |
How it compares
| Feature | ParseForge | Other CMS / Medicare scrapers on Apify |
|---|---|---|
| Datasets covered | 395 | One dataset each (hospitals, or home health, or prescribers) |
| Both CMS catalogs | Yes | One or the other |
| Server-side filters with 10 operators | Yes | Not listed |
| Archived versions back to 2013 | Yes | Not listed |
| Data dictionary and file list per dataset | Yes | Not listed |
| Named filters validated against the live API | Yes | Not 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 sayCalifornia. 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_Flagcolumns; those columns come through as CMS publishes them.
Free users
Free-plan runs return up to 25 rows as a preview. Upgrade your Apify plan to pull whole datasets.
Run it
- Create a free Apify account with $5 in credit.
- Open the CMS Medicare Data Scraper.
- Pick a dataset, add filters, set Max rows, then click Start.
- 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.
What input does the CMS Medicare Data Scraper - data.cms.gov API accept?
| Field | Type | What it does | Default |
|---|---|---|---|
| dataset required | string (94 options) | Which data.cms.gov dataset to pull. 92 datasets are wired up with named filters; every other dataset on the portal is reachable through "Custom". "Catalog" returns the metadata of all 395 datasets instead of data rows. Each group bills its own per-row event, so you only pay for the one you asked for. | doctors-clinicians |
| maxItems | integer | Stop after this many rows. The row limit is the spending ceiling: nothing beyond it is written or billed. Free-plan runs are capped at 25 rows. | 100 |
| state | string | Two-letter state code, e.g. "CA". Applied by CMS on its own server. Available on 70 of the 92 datasets, the ones whose rows carry a state. | CA |
| city | string | City or town, matched as a substring so "SAN" finds San Diego and San Jose. Available on 56 datasets. | not set |
| zipCode | string | Five-digit ZIP. About half the CMS files store ZIP+4, so the query goes out as a prefix match and rows whose ZIP does not actually start with yours are dropped before they are written or billed. Available on 56 datasets. | not set |
| npi | string | A single 10-digit National Provider Identifier, matched exactly. Available on 30 datasets. | not set |
| ccn | string | CMS Certification Number, the six-character facility id used across Care Compare, cost reports and the Provider of Services file. Available on 46 datasets. | not set |
| providerName | string | Substring of the organisation, facility or group name. Case-insensitive. Available on 60 datasets, the person-level files expose the surname as Clinician last name instead. | not set |
| lastName | string | Substring of an individual clinician's surname, for the person-level files. Available on 22 datasets. | not set |
| specialty | string | Substring of the specialty or provider-type column, e.g. "Cardio" or "Nurse Practitioner". Available on 17 datasets. | not set |
| drugName | string | Brand or generic drug name, matched as a substring, on the Part B, Part D and Medicaid drug files. Available on 6 datasets. | not set |
| hcpcsCode | string | A single HCPCS / CPT procedure code, matched exactly, on the service-level utilisation files. Available on 5 datasets. | not set |
| geography | string | For the geography-level files, whose rows are a state or county rather than a provider: the geography description, e.g. "California" or "Los Angeles". Available on 7 datasets. | not set |
| year | integer | Data year. On the 7 datasets that carry a year column this filters the rows; on the rest of the main CMS catalog it switches to that year's published version of the file, the Part D and Physician files go back to 2013. Datasets in the Provider Data Catalog have no archive and reject this. | not set |
| search | string | Free-text search across every column of the dataset, run by CMS. Main CMS catalog only, the Provider Data Catalog has no keyword endpoint and the run stops with a message rather than ignoring this. | not set |
| filters | array | One expression per line, applied on top of the named filters above and ANDed together. Write them as "Column operator value" using = != > >= 1000", "Prscrbr_State_Abrvtn in CA,NY,TX", "Brnd_Name contains OZEMPIC". A column that does not exist stops the run and lists the ones that do. | not set |
| columns | array | Only return these columns. Leave empty for every column. Narrowing the projection makes wide files (up to 473 columns) far faster to pull. | not set |
| sortBy | string | Column to order by, applied by CMS. Combine with Max rows to take the top N: e.g. sort Part D prescribers by Tot_Drug_Cst descending. | not set |
| sortOrder | string (2 options) | Direction for Sort by. | asc |
| catalogSource | string (3 options) | Which of the two catalogs to list in Catalog mode. CMS Data is the 159-dataset open-data portal; the Provider Data Catalog is the 236-dataset Care Compare feed. Ignored unless Dataset is "Catalog". | both |
| catalogSearch | string | Keep only datasets whose title, description, keywords or theme contain this text. | not set |
| catalogTheme | string | Keep only datasets in a theme or keyword, e.g. "Nursing homes", "Hospitals", "Medicare", "Dialysis facilities". | not set |
| catalogModifiedAfter | string | Keep only datasets CMS updated on or after this date (YYYY-MM-DD). Use it to poll the portal for refreshed files. | not set |
| onlyQueryable | boolean | Drop the 28 datasets CMS publishes as ZIP or XLSX only, which this Actor can list but not query row by row. | false |
| includeFields | boolean | Also emit one row per column of the dataset, with its machine name, human label, SQL type and position. Billed as Data dictionary field. Off by default. | false |
| includeResources | boolean | Also emit one row per file CMS attaches to the dataset, the current CSV, every dated archive, and the data-dictionary PDF: with its URL and size. Billed as Dataset file. Off by default. | false |
| customDatasetId | string | Only used when Dataset is "Custom". Either a main-catalog UUID (the id in https://data.cms.gov/data-api/v1/dataset//data) or a Provider Data Catalog id such as xubh-q36u. A full dataset URL works too. | not set |
| customCatalog | string (3 options) | Leave on Auto: a 36-character UUID is looked up in the CMS Data catalog, anything else in the Provider Data Catalog. | auto |
How much does the CMS Medicare Data Scraper - data.cms.gov API cost?
from $6.23 per 1,000 results
| Charged for | What it is | Price each |
|---|---|---|
| Actor Start | Charged when the Actor starts running. Number of events charged depends on Actor memory (one event per GB, minimum one event). | $0.0178 to $0.02 |
| Clinician row | One clinician from the Doctors and Clinicians National Downloadable File: NPI, name, credentials, specialties, group practice and practice address. | $0.00623 to $0.007 |
| Facility affiliation row | One clinician-to-facility affiliation, with the facility type and its CMS certification number. | $0.00623 to $0.007 |
| Prescriber row | One Part D prescribing row: claims, 30-day fills, drug cost, beneficiaries, opioid and antibiotic breakouts, by provider or by provider and drug. | $0.00623 to $0.007 |
| Utilization row | One Medicare utilisation and payment row for a physician, hospital, DME supplier or HCPCS service. | $0.00623 to $0.007 |
| Enrollment row | One Medicare enrollment record for a provider, hospital, SNF, home health agency, hospice, rural health clinic or FQHC. | $0.00623 to $0.007 |
| Ownership row | One owner of a Medicare-enrolled facility, with the ownership percentage and the private-equity, REIT, holding-company and chain flags. | $0.00623 to $0.007 |
| Facility row | One hospital, nursing home, home health agency, hospice, dialysis facility, inpatient rehab or long-term care hospital with its ratings. | $0.00623 to $0.007 |
| Quality measure row | One Care Compare quality or patient-experience measure: HCAHPS, complications, infections, readmissions, timely care, value-based purchasing. | $0.00623 to $0.007 |
| Deficiency row | One nursing home health or fire-safety deficiency, penalty or survey summary. | $0.00623 to $0.007 |
| Spending row | One spending, cost-report, enrollment-count or geographic-variation row. | $0.00623 to $0.007 |
| Supplier row | One medical equipment supplier with its address, specialities, products and contract status. | $0.00623 to $0.007 |
| Order and Referring row | One clinician eligible to order and refer, with the Part B, DME, HHA, PMD and hospice flags. | $0.00623 to $0.007 |
| Opt-out affidavit row | One clinician who has opted out of Medicare, with the effective and end dates and the practice address. | $0.00623 to $0.007 |
| Revoked provider row | One provider or supplier revoked from Medicare, with the reason and the reenrollment bar. | $0.00623 to $0.007 |
| Revalidation row | One revalidation due date, group reassignment or clinic-group record. | $0.00623 to $0.007 |
| Catalog dataset | One dataset in Catalog mode: title, description, theme, keywords, contact, update cadence, licence, row and column counts and the data-dictionary link. | $0.00623 to $0.007 |
| Custom dataset row | One row from a data.cms.gov dataset outside the curated list, reached by ID. | $0.00623 to $0.007 |
| Data dictionary field | Optional. One column definition: machine name, human label, SQL type and position. | $0.00178 to $0.002 |
| Dataset file | Optional. One downloadable file CMS attaches to a dataset, the current CSV, a dated archive or the data-dictionary PDF: with its URL and size. | $0.00178 to $0.002 |
Tiered: the lower figure is the price on a higher Apify plan. Billing and the free credit live on Apify.
How do I call the CMS Medicare Data Scraper - data.cms.gov API API?
One POST returns the dataset directly. Same shape for every scraper in the library, so swapping the slug is the only change.
curl -X POST "https://api.apify.com/v2/acts/parseforge~cms-medicare-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"dataset": "doctors-clinicians",
"maxItems": 100,
"state": "CA",
"sortOrder": "asc",
"catalogSource": "both"
}' What example inputs can I use?
Use these inputs to see how a run is configured.
{
"dataset": "doctors-clinicians",
"maxItems": 100,
"state": "CA",
"sortOrder": "asc",
"catalogSource": "both"
} What do users say about the CMS Medicare Data Scraper - data.cms.gov API?
No reviews yet. Be the first.
How do I report an issue with the CMS Medicare Data Scraper - data.cms.gov API?
We build and maintain this scraper, so a problem with it comes to us. Report it on the Apify listing and the thread stays attached to the scraper where the next person can find it: open an issue.
Broken and urgent, or you would rather not post in public? Write to parseforge@protonmail.com and it reaches the people who wrote it.
What related scrapers can I use?
Run CMS Medicare Data Scraper - data.cms.gov API on Apify All scrapers
