# CMS Open Data Scraper (`parseforge/data-cms-gov-scraper`) Actor

Export healthcare datasets from the Centers for Medicare & Medicaid Services Open Data portal. Pull provider directories, hospital quality, drug spending, Medicare enrollment, and 3,000+ other CMS datasets with metadata and row-level data.

- **URL**: https://apify.com/parseforge/data-cms-gov-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Business, Other, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.75 / 1,000 result items

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Banner](https://github.com/ParseForge/apify-assets/blob/ad35ccc13ddd068b9d6cba33f323962e39aed5b2/banner.jpg?raw=true)

## 🏥 CMS Open Data Scraper

> 🚀 **Export the U.S. Medicare and Medicaid data catalog in seconds.** Search **5,000+ healthcare datasets** by keyword, theme, or publisher, and pull the rows behind each one. No registration, no manual CSV wrangling.

> 🕒 **Last updated:** 2026-05-21 · **📊 13 fields** per catalog record · **🏥 5,000+ datasets** · **🇺🇸 CMS national catalog** · **2 modes**

The **CMS Open Data Scraper** exports the official Centers for Medicare & Medicaid Services open data catalog. Each catalog record returns **13 fields**, including dataset identifier, title, description, publisher, contact, keyword and theme tags, modified date, access level, landing page, and download link. Switch to dataset mode and the same Actor returns the rows behind any catalog entry.

The catalog covers **every public CMS dataset**: hospital cost reports, Medicare Part B and Part D drug spending, provider directories, Medicaid enrollment, nursing-home compare, marketplace open enrollment, hospital quality indicators, and thousands more. Coverage spans every state, every Medicare Administrative Contractor region, and every measurement program CMS publishes.

| 🎯 Target Audience | 💡 Primary Use Cases |
|---|---|
| Healthcare analysts, hospital finance teams, payer pricing teams, policy researchers, health-tech founders, journalists | Provider directory enrichment, drug-spend benchmarking, hospital cost analysis, quality-score lookups, payer comparison, claims research |

---

### 📋 What the CMS Open Data Scraper does

Two run modes in a single Actor:

- 🗂️ **Catalog mode.** List every CMS dataset matching your search term, with metadata, tags, and the download link for each one.
- 📥 **Dataset mode.** Pull the rows behind a specific dataset slug straight into your dataset.
- 🏷️ **Multi-dimensional filtering.** Restrict by keyword, theme, publisher, access level, or last-modified date.
- 🔁 **Always current.** Every run fetches the live catalog state, so your downstream dataset reflects what CMS published today.

Each catalog record carries identifiers, descriptive metadata (title, description, contact), classification tags (keyword, theme), provenance (modified date, access level), and ready-to-use links (landing page, download URL).

> 💡 **Why it matters:** the CMS catalog is one of the richest open datasets in U.S. healthcare, but the listing surface is fragmented and the per-dataset download formats vary widely. This Actor gives you a single clean shape for both the catalog and the rows underneath it.

---

### 🎬 Full Demo

_🚧 Coming soon: a 3-minute walkthrough showing how to go from sign-up to a downloaded CMS dataset._

---

### ⚙️ Input

<table>
<thead>
<tr><th>Input</th><th>Type</th><th>Default</th><th>Behavior</th></tr>
</thead>
<tbody>
<tr><td><code>maxItems</code></td><td>integer</td><td><code>10</code></td><td>Records to return. Free plan caps at 10, paid plan at 1,000,000.</td></tr>
<tr><td><code>mode</code></td><td>string</td><td><code>"catalog"</code></td><td><code>catalog</code> lists datasets. <code>dataset</code> pulls rows from a specific slug.</td></tr>
<tr><td><code>searchQuery</code></td><td>string</td><td><code>"hospital"</code></td><td>Catalog keyword search. Example: <code>medicare</code>, <code>drug spending</code>, <code>nursing home</code>.</td></tr>
<tr><td><code>keyword</code></td><td>string</td><td><code>""</code></td><td>Match a value in the dataset's keyword tags (for example <code>quality</code>, <code>physician</code>).</td></tr>
<tr><td><code>theme</code></td><td>string</td><td><code>""</code></td><td>Match the dataset's theme or category (for example <code>Medicare</code>, <code>Hospitals</code>).</td></tr>
<tr><td><code>publisher</code></td><td>string</td><td><code>""</code></td><td>Match the publishing organization name.</td></tr>
<tr><td><code>accessLevel</code></td><td>string</td><td><code>""</code></td><td><code>public</code>, <code>restricted public</code>, or <code>non-public</code>.</td></tr>
<tr><td><code>modifiedSince</code></td><td>string</td><td><code>""</code></td><td>Keep only datasets modified on or after this ISO date.</td></tr>
<tr><td><code>datasetSlug</code></td><td>string</td><td><code>""</code></td><td>CMS dataset identifier for <code>dataset</code> mode. Find it in catalog output.</td></tr>
</tbody>
</table>

**Example: list every hospital-quality dataset modified since 2024.**

```json
{
    "maxItems": 100,
    "mode": "catalog",
    "searchQuery": "hospital",
    "keyword": "quality",
    "modifiedSince": "2024-01-01"
}
````

**Example: pull rows from a specific dataset slug.**

```json
{
    "maxItems": 500,
    "mode": "dataset",
    "datasetSlug": "9wzi-peqs"
}
```

> ⚠️ **Good to Know:** CMS dataset coverage varies by program. Some entries are continuously refreshed, others are quarterly or annual releases. Check the `modified` field on each catalog record to confirm freshness before pulling rows.

***

### 📊 Output

Each catalog record contains **13 fields**. Download the dataset as CSV, Excel, JSON, or XML.

#### 🧾 Schema

| Field | Type | Example |
|---|---|---|
| 🆔 `identifier` | string | catalog ID URL (e.g. `/dataset/7cf9662e-7c5c-4fe0-a8c6-828edf81a23c`) |
| 📝 `title` | string | `"AHRQ Patient Safety Indicator 11 (PSI-11) Measure Rates"` |
| 📄 `description` | string | full dataset summary |
| 🏢 `publisher` | string | `"Centers for Medicare & Medicaid Services"` |
| 📇 `contactPoint` | object | `{ "name": "...", "email": "..." }` |
| 🏷️ `keyword` | array | `["Medicare","Hospitals & Facilities","Safety of Care"]` |
| 🗂️ `theme` | array | `["Medicare"]` |
| 📅 `modified` | string | `"2020-12-08"` |
| 🔓 `accessLevel` | string | `"public"` |
| 🔗 `landingPage` | string | `"https://data.cms.gov/quality-of-care/..."` |
| 📥 `downloadUrl` | string | null | direct CSV or JSON download |
| 📊 `rows` | array | sample rows (dataset mode only) |
| 🕒 `scrapedAt` | ISO 8601 | `"2026-05-21T22:14:33.381Z"` |
| ❗ `error` | string | null | populated only on failure |

#### 📦 Sample records

<details>
<summary><strong>🏥 Catalog entry: AHRQ Patient Safety Indicator 11 Measure Rates</strong></summary>

```json
{
    "identifier": "7cf9662e-7c5c-4fe0-a8c6-828edf81a23c",
    "title": "Agency for Healthcare Research and Quality (AHRQ) Patient Safety Indicator 11 (PSI-11) Measure Rates",
    "description": "Provider-level measure rates regarding postoperative respiratory failure for Medicare fee-for-service discharges.",
    "publisher": "Centers for Medicare & Medicaid Services",
    "contactPoint": {
        "name": "Deficit Reduction Act Hospital Acquired Conditions - CCSQ",
        "email": "drahac@mathematica-mpr.com"
    },
    "keyword": ["Medicare", "Original Medicare", "Hospitals & Facilities", "Inpatient", "Health Care Use & Payments", "Safety of Care"],
    "theme": ["Medicare"],
    "modified": "2020-12-08",
    "accessLevel": "public",
    "landingPage": "https://data.cms.gov/quality-of-care/agency-for-healthcare-research-and-quality-ahrq-patient-safety-indicator-11-psi-11-measure-rates",
    "downloadUrl": "https://data.cms.gov/sites/default/files/2020-09/Provider-Level_Measure_Rates_for_AHRQ_Patient_Safety_Indicator_11__PSI-11___-_2016.csv",
    "scrapedAt": "2026-05-21T22:14:33.381Z"
}
```

</details>

<details>
<summary><strong>💊 Catalog entry: Medicare Part D drug spending</strong></summary>

```json
{
    "identifier": "medicare-part-d-spending-by-drug",
    "title": "Medicare Part D Spending by Drug",
    "publisher": "Centers for Medicare & Medicaid Services",
    "keyword": ["Medicare", "Part D", "Drug Spending", "Prescription Drugs"],
    "theme": ["Medicare"],
    "modified": "2025-06-15",
    "accessLevel": "public",
    "landingPage": "https://data.cms.gov/summary-statistics-on-use-and-payments/medicare-medicaid-spending-by-drug/medicare-part-d-spending-by-drug",
    "scrapedAt": "2026-05-20T22:14:33.381Z"
}
```

</details>

<details>
<summary><strong>🏥 Dataset mode: rows from a hospital-quality dataset</strong></summary>

```json
{
    "identifier": "9wzi-peqs",
    "title": "Hospital General Information",
    "rows": [
        {
            "facility_id": "010001",
            "facility_name": "SOUTHEAST HEALTH MEDICAL CENTER",
            "state": "AL",
            "county_name": "HOUSTON",
            "hospital_type": "Acute Care Hospitals",
            "hospital_ownership": "Government - Hospital District or Authority"
        }
    ],
    "scrapedAt": "2026-05-20T22:14:33.381Z"
}
```

</details>

***

### ✨ Why choose this Actor

| | Capability |
|---|---|
| 🏥 | **Full CMS catalog.** Every dataset CMS publishes, queryable by keyword, theme, publisher, or modified date. |
| 🔀 | **Two run modes.** Catalog mode for discovery, dataset mode for row-level pulls. |
| 🏷️ | **Multi-dimensional filtering.** Combine keyword, theme, publisher, and access level in a single run. |
| ⚡ | **Fast.** 10 catalog entries in under 5 seconds, 1,000 in under a minute. |
| 🔁 | **Always fresh.** Every run pulls the live catalog state, so your dataset reflects current CMS publications. |
| 🇺🇸 | **Official U.S. source.** Maintained by the Centers for Medicare & Medicaid Services and used by every major healthcare analyst. |
| 🚫 | **No keys to manage.** No personal token required for the default run. |

> 📊 The CMS catalog is the backbone of U.S. healthcare data: provider directories, drug spend, hospital quality, and Medicare and Medicaid program metrics all live here.

***

### 📈 How it compares to alternatives

| Approach | Cost | Coverage | Refresh | Filters | Setup |
|---|---|---|---|---|---|
| **⭐ CMS Open Data Scraper** *(this Actor)* | $5 free credit, then pay-per-use | **5,000+** datasets | **Live per run** | search, keyword, theme, publisher, access, date | ⚡ 2 min |
| Build your own pipeline | Free, but engineering hours | Full catalog if you build it | Manual | DIY | 🐢 Days |
| Commercial healthcare data vendors | $1,000+/month | Vendor-curated subset | Vendor cadence | Vendor's | ⏳ Hours |
| Manual CSV downloads | Free | Stale snapshots | Quarterly at best | None | 🕒 Variable |

Pick this Actor when you want every CMS dataset in a single normalized shape, with row-level pulls available on demand.

***

### 🚀 How to use

1. 📝 **Sign up.** [Create a free account with $5 credit](https://console.apify.com/sign-up?fpr=vmoqkp) (takes 2 minutes).
2. 🌐 **Open the Actor.** Go to the CMS Open Data Scraper page on the Apify Store.
3. 🎯 **Set input.** Choose `catalog` or `dataset` mode, type a search term, set `maxItems`.
4. 🚀 **Run it.** Click **Start** and let the Actor collect your data.
5. 📥 **Download.** Grab your results in the **Dataset** tab as CSV, Excel, JSON, or XML.

> ⏱️ Total time from signup to downloaded dataset: **3-5 minutes.** No coding required.

***

### 💼 Business use cases

<table>
<tr>
<td width="50%" valign="top">

#### 🏥 Hospital Finance & Strategy

- Hospital cost-report benchmarking
- Medicare wage-index lookups
- Disproportionate-share hospital analysis
- Service-line revenue modeling

</td>
<td width="50%" valign="top">

#### 💊 Payer & PBM Pricing

- Part D drug-spend trend tracking
- Brand-vs-generic substitution research
- Provider directory enrichment
- Network-adequacy analysis

</td>
</tr>
<tr>
<td width="50%" valign="top">

#### 📊 Healthcare Analytics & BI

- Quality-score dashboards by facility
- Readmission and complication tracking
- Cross-state Medicaid enrollment comparison
- Long-term-care utilization analysis

</td>
<td width="50%" valign="top">

#### 📰 Policy Research & Journalism

- CMS rule-change impact modeling
- Investigative reporting on provider outliers
- Federal-program transparency research
- Public-health surveillance datasets

</td>
</tr>
</table>

***

### 🔌 Automating CMS Open Data Scraper

Control the scraper programmatically for scheduled runs and pipeline integrations:

- 🟢 **Node.js.** Install the `apify-client` NPM package.
- 🐍 **Python.** Use the `apify-client` PyPI package.
- 📚 See the [Apify API documentation](https://docs.apify.com/api/v2) for full details.

The [Apify Schedules feature](https://docs.apify.com/platform/schedules) lets you trigger this Actor on any cron interval. Weekly refreshes keep your downstream healthcare warehouse in sync as CMS publishes new datasets and updates existing ones.

***

### 🌟 Beyond business use cases

Healthcare open data powers more than commercial workflows. The same structured records support research, education, civic projects, and personal initiatives.

<table>
<tr>
<td width="50%">

#### 🎓 Research and academia

- Health-services research with cited reference values
- Policy analysis for Medicare and Medicaid program design
- Coursework in health informatics, biostatistics, and public health
- Reproducible studies with versioned dataset pulls

</td>
<td width="50%">

#### 🎨 Personal and creative

- Hobby data-journalism projects
- Indie health-tech prototypes
- Educational content for healthcare educators
- Visualizations and explainer dashboards

</td>
</tr>
<tr>
<td width="50%">

#### 🤝 Non-profit and civic

- Patient-advocacy organizations tracking provider quality
- Community-health needs assessments
- Investigative reporting on Medicare fraud or quality outliers
- Civic-data hackathons and transparency projects

</td>
<td width="50%">

#### 🧪 Experimentation

- Train healthcare-classification models
- Prototype agent pipelines that summarize dataset catalogs
- Build cost-of-care comparison dashboards
- Validate provider directory matching rules

</td>
</tr>
</table>

***

### 🤖 Ask an AI assistant about this scraper

Open a ready-to-send prompt about this ParseForge actor in the AI of your choice:

- 💬 [**ChatGPT**](https://chat.openai.com/?q=How%20do%20I%20use%20the%20CMS%20Open%20Data%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🧠 [**Claude**](https://claude.ai/new?q=How%20do%20I%20use%20the%20CMS%20Open%20Data%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🔍 [**Perplexity**](https://perplexity.ai/search?q=How%20do%20I%20use%20the%20CMS%20Open%20Data%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)
- 🅒 [**Copilot**](https://copilot.microsoft.com/?q=How%20do%20I%20use%20the%20CMS%20Open%20Data%20Scraper%20by%20ParseForge%20on%20Apify%3F%20Show%20me%20input%20examples%2C%20output%20fields%2C%20common%20use%20cases%2C%20and%20how%20to%20integrate%20it%20into%20a%20workflow.)

***

### ❓ Frequently Asked Questions

#### 🧩 How does it work?

Pick `catalog` mode to list datasets matching your search term, or `dataset` mode and pass a slug to pull the rows from a specific dataset. The Actor returns a single clean shape per record, ready to download as CSV, Excel, JSON, or XML.

#### 📏 How fresh is the data?

CMS updates its catalog continuously. Every run of this Actor pulls the latest state, so your dataset reflects current CMS publications as of run time. Use the `modified` field on each catalog record to verify freshness per dataset.

#### 🏥 Does it include hospital cost reports?

Yes. Search for `cost report` in catalog mode to surface every cost-report dataset CMS publishes, including hospital, skilled-nursing, hospice, and home-health.

#### 💊 Can I pull Medicare Part D drug spend?

Yes. Use catalog mode with `searchQuery: "drug spending"` to find the latest Part D spending dataset, then run dataset mode with that slug to pull the rows.

#### 🔓 What does `accessLevel` mean?

`public` means anyone can download. `restricted public` requires registration or data-use agreement. `non-public` is metadata only. Filter on this field if you only want fully open data.

#### ⏰ Can I schedule regular runs?

Yes. Use Apify Schedules to run this Actor on any cron interval (daily, weekly, monthly) and keep a downstream healthcare warehouse in sync.

#### ⚖️ Is this data legal to use?

CMS publishes its catalog as U.S. government open data. Public-access datasets are free to use, including for commercial products. Review CMS terms for any project-specific obligations.

#### 💼 Can I use this data commercially?

Yes. Public-access CMS data is published as open data and is free for commercial use. You are responsible for complying with the dataset-specific terms and any downstream regulatory requirements.

#### 💳 Do I need a paid Apify plan to use this Actor?

No. The free Apify plan is enough for testing and small runs (10 records per run). A paid plan lifts the limit and gives you access to scheduling, higher concurrency, and larger datasets.

#### 🔁 What happens if a run fails or gets interrupted?

Apify automatically retries transient errors. If a run still fails, you can inspect the log in the Runs tab, fix the input, and re-run. Partial datasets from interrupted runs are preserved so you never lose progress.

#### 🆘 What if I need help?

Our support team is here to help. Contact us through the Apify platform or use the Tally form linked below.

***

### 🔌 Integrate with any app

CMS Open Data Scraper connects to any cloud service via [Apify integrations](https://apify.com/integrations):

- [**Make**](https://docs.apify.com/platform/integrations/make) - Automate multi-step workflows
- [**Zapier**](https://docs.apify.com/platform/integrations/zapier) - Connect with 5,000+ apps
- [**Slack**](https://docs.apify.com/platform/integrations/slack) - Get run notifications in your channels
- [**Airbyte**](https://docs.apify.com/platform/integrations/airbyte) - Pipe healthcare data into your warehouse
- [**GitHub**](https://docs.apify.com/platform/integrations/github) - Trigger runs from commits and releases
- [**Google Drive**](https://docs.apify.com/platform/integrations/drive) - Export datasets straight to Sheets

You can also use webhooks to trigger downstream actions when a run finishes. Push fresh CMS data into your analytics backend, or alert your team in Slack.

***

### 🔗 Recommended Actors

- [**🥦 USDA FoodData Central Scraper**](https://apify.com/parseforge/usda-fooddata-central-scraper) - Official U.S. food and nutrient catalog
- [**📈 Indexmundi Scraper**](https://apify.com/parseforge/indexmundi-scraper) - Global demographic and economic indicators
- [**🔍 FINRA BrokerCheck Scraper**](https://apify.com/parseforge/finra-brokercheck-scraper) - U.S. licensed-broker reference data
- [**🗺️ Nominatim OSM Scraper**](https://apify.com/parseforge/nominatim-osm-scraper) - Geocode addresses via OpenStreetMap
- [**✈️ OurAirports Scraper**](https://apify.com/parseforge/ourairports-scraper) - Global airport reference dataset

> 💡 **Pro Tip:** browse the complete [ParseForge collection](https://apify.com/parseforge) for more reference-data scrapers.

***

**🆘 Need Help?** [**Open our contact form**](https://tally.so/r/BzdKgA) to request a new scraper, propose a custom data project, or report an issue.

***

> **⚠️ Disclaimer:** this Actor is an independent tool and is not affiliated with, endorsed by, or sponsored by the Centers for Medicare & Medicaid Services or the U.S. Department of Health and Human Services. All trademarks mentioned are the property of their respective owners. Only publicly available CMS open data is collected.

# Actor input Schema

## `maxItems` (type: `integer`):

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000

## `mode` (type: `string`):

Catalog mode lists CMS datasets matching the search term. Dataset mode pulls rows from a specific dataset slug.

## `searchQuery` (type: `string`):

Keyword to filter the CMS dataset catalog. Used when Mode = Catalog. Example: 'hospital', 'medicare', 'drug spending'.

## `keyword` (type: `string`):

Match a value in the dataset's keyword tags. Example: 'quality', 'physician', 'cost report'.

## `theme` (type: `string`):

Match a value in the dataset's theme/category. Example: 'Medicare', 'Hospitals'.

## `publisher` (type: `string`):

Match the publishing organization name. Example: 'Centers for Medicare & Medicaid Services'.

## `accessLevel` (type: `string`):

Filter by data access level.

## `modifiedSince` (type: `string`):

Keep only datasets modified on or after this ISO date. Example: '2024-01-01'.

## `datasetSlug` (type: `string`):

CMS dataset identifier when Mode = Dataset. Find it in the catalog mode output as the 'identifier' field. Example: '9wzi-peqs'.

## Actor input object example

```json
{
  "maxItems": 10,
  "mode": "catalog",
  "searchQuery": "hospital"
}
```

# Actor output Schema

## `overview` (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 = {
    "maxItems": 10,
    "mode": "catalog",
    "searchQuery": "hospital"
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/data-cms-gov-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 = {
    "maxItems": 10,
    "mode": "catalog",
    "searchQuery": "hospital",
}

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

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

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

```

## CLI example

```bash
echo '{
  "maxItems": 10,
  "mode": "catalog",
  "searchQuery": "hospital"
}' |
apify call parseforge/data-cms-gov-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=parseforge/data-cms-gov-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "CMS Open Data Scraper",
        "description": "Export healthcare datasets from the Centers for Medicare & Medicaid Services Open Data portal. Pull provider directories, hospital quality, drug spending, Medicare enrollment, and 3,000+ other CMS datasets with metadata and row-level data.",
        "version": "1.0",
        "x-build-id": "l7GcXJuQdmm0vJv9k"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/parseforge~data-cms-gov-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-parseforge-data-cms-gov-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/parseforge~data-cms-gov-scraper/runs": {
            "post": {
                "operationId": "runs-sync-parseforge-data-cms-gov-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/parseforge~data-cms-gov-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-parseforge-data-cms-gov-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 1,
                        "maximum": 1000000,
                        "type": "integer",
                        "description": "Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000"
                    },
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "catalog",
                            "dataset"
                        ],
                        "type": "string",
                        "description": "Catalog mode lists CMS datasets matching the search term. Dataset mode pulls rows from a specific dataset slug."
                    },
                    "searchQuery": {
                        "title": "Catalog Search",
                        "type": "string",
                        "description": "Keyword to filter the CMS dataset catalog. Used when Mode = Catalog. Example: 'hospital', 'medicare', 'drug spending'."
                    },
                    "keyword": {
                        "title": "Keyword Filter",
                        "type": "string",
                        "description": "Match a value in the dataset's keyword tags. Example: 'quality', 'physician', 'cost report'."
                    },
                    "theme": {
                        "title": "Theme Filter",
                        "type": "string",
                        "description": "Match a value in the dataset's theme/category. Example: 'Medicare', 'Hospitals'."
                    },
                    "publisher": {
                        "title": "Publisher Filter",
                        "type": "string",
                        "description": "Match the publishing organization name. Example: 'Centers for Medicare & Medicaid Services'."
                    },
                    "accessLevel": {
                        "title": "Access Level",
                        "enum": [
                            "public",
                            "restricted public",
                            "non-public"
                        ],
                        "type": "string",
                        "description": "Filter by data access level."
                    },
                    "modifiedSince": {
                        "title": "Modified Since",
                        "type": "string",
                        "description": "Keep only datasets modified on or after this ISO date. Example: '2024-01-01'."
                    },
                    "datasetSlug": {
                        "title": "Dataset Slug",
                        "type": "string",
                        "description": "CMS dataset identifier when Mode = Dataset. Find it in the catalog mode output as the 'identifier' field. Example: '9wzi-peqs'."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
