# CMS Medicare Data Scraper - data.cms.gov API (`parseforge/cms-medicare-scraper`) Actor

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.

- **URL**: https://apify.com/parseforge/cms-medicare-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Lead generation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.23 / 1,000 clinician rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)](https://apify.com/parseforge?fpr=vmoqkp)

### 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:

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

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

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

Top Ozempic prescribers in Nevada by drug cost:

```json
{
  "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:

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

A 2015 vintage of the Part D prescriber file:

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

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

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

Any other dataset, by ID:

```json
{
  "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.

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

| Run | Approximate 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](https://console.apify.com/sign-up?fpr=vmoqkp) to pull whole datasets.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [CMS Medicare Data Scraper](https://apify.com/parseforge/cms-medicare-scraper?fpr=vmoqkp).
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](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) 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:

```bash
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.

# Actor input Schema

## `dataset` (type: `string`):

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.

## `maxItems` (type: `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.

## `state` (type: `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.

## `city` (type: `string`):

City or town, matched as a substring so "SAN" finds San Diego and San Jose. Available on 56 datasets.

## `zipCode` (type: `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.

## `npi` (type: `string`):

A single 10-digit National Provider Identifier, matched exactly. Available on 30 datasets.

## `ccn` (type: `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.

## `providerName` (type: `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.

## `lastName` (type: `string`):

Substring of an individual clinician's surname, for the person-level files. Available on 22 datasets.

## `specialty` (type: `string`):

Substring of the specialty or provider-type column, e.g. "Cardio" or "Nurse Practitioner". Available on 17 datasets.

## `drugName` (type: `string`):

Brand or generic drug name, matched as a substring, on the Part B, Part D and Medicaid drug files. Available on 6 datasets.

## `hcpcsCode` (type: `string`):

A single HCPCS / CPT procedure code, matched exactly, on the service-level utilisation files. Available on 5 datasets.

## `geography` (type: `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.

## `year` (type: `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.

## `search` (type: `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.

## `filters` (type: `array`):

One expression per line, applied on top of the named filters above and ANDed together. Write them as "Column operator value" using = != > >= < <= contains in "not in" or between, e.g. "Tot\_Clms > 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.

## `columns` (type: `array`):

Only return these columns. Leave empty for every column. Narrowing the projection makes wide files (up to 473 columns) far faster to pull.

## `sortBy` (type: `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.

## `sortOrder` (type: `string`):

Direction for Sort by.

## `catalogSource` (type: `string`):

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".

## `catalogSearch` (type: `string`):

Keep only datasets whose title, description, keywords or theme contain this text.

## `catalogTheme` (type: `string`):

Keep only datasets in a theme or keyword, e.g. "Nursing homes", "Hospitals", "Medicare", "Dialysis facilities".

## `catalogModifiedAfter` (type: `string`):

Keep only datasets CMS updated on or after this date (YYYY-MM-DD). Use it to poll the portal for refreshed files.

## `onlyQueryable` (type: `boolean`):

Drop the 28 datasets CMS publishes as ZIP or XLSX only, which this Actor can list but not query row by row.

## `includeFields` (type: `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.

## `includeResources` (type: `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.

## `customDatasetId` (type: `string`):

Only used when Dataset is "Custom". Either a main-catalog UUID (the id in https://data.cms.gov/data-api/v1/dataset/<uuid>/data) or a Provider Data Catalog id such as xubh-q36u. A full dataset URL works too.

## `customCatalog` (type: `string`):

Leave on Auto: a 36-character UUID is looked up in the CMS Data catalog, anything else in the Provider Data Catalog.

## Actor input object example

```json
{
  "dataset": "doctors-clinicians",
  "maxItems": 100,
  "state": "CA",
  "sortOrder": "asc",
  "catalogSource": "both",
  "onlyQueryable": false,
  "includeFields": false,
  "includeResources": false,
  "customDatasetId": "xubh-q36u",
  "customCatalog": "auto"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "dataset": "doctors-clinicians",
    "maxItems": 100,
    "state": "CA"
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/cms-medicare-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "dataset": "doctors-clinicians",
    "maxItems": 100,
    "state": "CA",
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/cms-medicare-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "dataset": "doctors-clinicians",
  "maxItems": 100,
  "state": "CA"
}' |
apify call parseforge/cms-medicare-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/cms-medicare-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/5VPfEMfGVuH3x7hI6/builds/9urR5SsSeGmLkbWi5/openapi.json
