# CMS Provider Data Scraper – Hospitals & Ratings (`unnoted/cms-hospital-data`) Actor

Get Medicare-certified hospitals, nursing homes, home health agencies, hospices, dialysis centers and rehab and long-term care hospitals from CMS Provider Data. Filter by state, city, name or star rating. Address, type, ownership, rating and quality counts. Unofficial.

- **URL**: https://apify.com/unnoted/cms-hospital-data.md
- **Developed by:** [Unnoted](https://apify.com/unnoted) (community)
- **Categories:** AI, Other
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What does CMS Provider Data Scraper – Hospitals & Ratings do?

CMS Provider Data Scraper reads the Medicare provider directories behind Care Compare and returns each hospital, nursing home, home health agency, hospice, dialysis facility, inpatient rehabilitation facility or long-term care hospital as one typed row: name, address, phone, type, ownership, star rating and quality counts, filtered by state, city, name or rating.

Unofficial, not affiliated with CMS.

**Main features:** up to 100,000 records per run, no login needed, export to JSON, CSV or Excel, and full API and scheduling support on Apify.

### What data can you get from CMS?

Each record is one row with these fields:

| Field | Description |
|---|---|
| `facilityId` | CMS Certification Number (CCN), e.g. 050454 (always filled) |
| `name` | Provider name as CMS lists it (always filled) |
| `dataset` | Provider type the record came from (e.g. hospital-general-information, nursing-homes) |
| `address` | Street address |
| `city` | City or town |
| `state` | Two-letter state or territory code |
| `zip` | ZIP code |
| `county` | County or parish |
| `facilityPhone` | The provider's listed main number, e.g. (334) 793-8701 |
| `hospitalType` | Hospital type, e.g. Acute Care Hospitals, Critical Access Hospitals (hospitals only) |
| `ownership` | Ownership as CMS lists it, e.g. Voluntary non-profit - Private, For profit - Corporation |
| `overallRating` | Overall star rating, 1–5 (home health in half stars); empty when CMS has none |
| `emergencyServices` | Whether the hospital provides emergency services (hospitals only) |
| `birthingFriendly` | Whether the hospital meets CMS's birthing-friendly criteria (hospitals only) |
| `mortalityMeasures` | Mortality measures: { total, reported, better, noDifferent, worse } than the national rate (hospitals only) |
| `safetyMeasures` | Safety of care measures: { total, reported, better, noDifferent, worse } (hospitals only) |
| `readmissionMeasures` | Readmission measures: { total, reported, better, noDifferent, worse } (hospitals only) |
| `patientExperienceMeasures` | Patient experience measures: { total, reported } (hospitals only) |
| `timelyCareMeasures` | Timely and effective care measures: { total, reported } (hospitals only) |
| `beds` | Certified beds (nursing homes) or total beds (long-term care hospitals) |
| `certificationDate` | Date first certified for Medicare (YYYY-MM-DD; not given for hospitals) |
| `latitude` | Latitude (nursing homes only) |
| `longitude` | Longitude (nursing homes only) |
| `details` | Every other column of the chosen directory, by its CMS column name (e.g. staffing, inspection and penalty figures for nursing homes, quality measures for dialysis and home health, footnotes); blank values are null |
| `datasetId` | CMS dataset id the record came from (e.g. xubh-q36u) |
| `scrapedAt` | When the record was collected (ISO 8601) |

### How to scrape CMS with CMS Provider Data Scraper – Hospitals & Ratings

1. Open CMS Provider Data Scraper – Hospitals & Ratings on Apify and go to the **Input** tab.
2. In **Provider type**, enter `hospital-general-information`.
3. In **State**, enter `CA`.
4. In **Max records**, enter `20`.
5. Click **Start** and wait for the run to finish. A small run like this one takes under a minute.
6. Open the **Output** tab to see the results, or download them as JSON, CSV, Excel or HTML.

### Input

See the **Input** tab for every option. The fields:

| Field | Name | What it does | Default |
|---|---|---|---|
| `dataset` | Provider type | Which CMS provider directory to read. Each record is one Medicare-certified provider; the fields particular to that directory are under details. Options: `hospital-general-information` (Hospitals (Hospital General Information)), `nursing-homes` (Nursing homes (Provider Information)), `home-health-agencies` (Home health agencies), `hospices` (Hospices (General Information)), `dialysis-facilities` (Dialysis facilities), `inpatient-rehabilitation-facilities` (Inpatient rehabilitation facilities), `long-term-care-hospitals` (Long-term care hospitals). | `"hospital-general-information"` |
| `state` | State | Only providers in this US state or territory: a two-letter code or a name, e.g. CA or California. Several are comma-separated, e.g. CA, NV, AZ. Empty means every state. |  |
| `city` | City | Only providers in this city or town, e.g. Houston. Best combined with a state. |  |
| `name` | Name contains | Only providers whose name contains these words, e.g. Mayo, Kaiser or Memorial. |  |
| `minRating` | Minimum star rating | Only providers with at least this overall star rating (1–5). Hospitals, nursing homes, home health agencies and dialysis facilities have one; unrated providers are left out when this is set. |  |
| `facilityIds` | CMS Certification Numbers | CCNs (facility ids), e.g. `050454`. |  |
| `maxItems` | Max records | Maximum number of provider records. You pay only for records saved. | `100` |

Example input:

```json
{
  "dataset": "hospital-general-information",
  "state": "CA",
  "maxItems": 20
}
```

### Output

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel. One real result:

```json
{
  "facilityId": "050002",
  "name": "ST ROSE HOSPITAL",
  "dataset": "hospital-general-information",
  "address": "27200 CALAROGA AVE",
  "city": "HAYWARD",
  "state": "CA",
  "zip": "94545",
  "county": "ALAMEDA",
  "facilityPhone": "(510) 782-6200",
  "hospitalType": "Acute Care Hospitals",
  "ownership": "Voluntary non-profit - Church",
  "overallRating": 1,
  "emergencyServices": false,
  "birthingFriendly": false,
  "mortalityMeasures": {
    "total": 8,
    "reported": 6,
    "better": 0,
    "noDifferent": 6,
    "worse": 0
  },
  "safetyMeasures": {
    "total": 8,
    "reported": 5,
    "better": 0,
    "noDifferent": 5,
    "worse": 0
  },
  "readmissionMeasures": {
    "total": 11,
    "reported": 5,
    "better": 0,
    "noDifferent": 3,
    "worse": 2
  },
  "patientExperienceMeasures": {
    "total": 15,
    "reported": 15
  },
  "timelyCareMeasures": {
    "total": 10,
    "reported": 6
  },
  "beds": null,
  "certificationDate": null,
  "latitude": null,
  "longitude": null,
  "details": {
    "hospital_overall_rating_footnote": null,
    "mort_group_footnote": null,
    "safety_group_footnote": null,
    "readm_group_footnote": null,
    "pt_exp_group_footnote": null,
    "te_group_footnote": null
  },
  "datasetId": "xubh-q36u",
  "scrapedAt": "2026-10-08T22:34:54.877Z"
}
```

### How much does it cost to scrape CMS?

CMS Provider Data Scraper – Hospitals & Ratings uses pay-per-event pricing: **$2.00 per 1,000 records** (Record). You pay only for records saved to the dataset; platform usage is included in the price. Each run also has Apify's standard start fee of a fraction of a cent.

| Records | Price |
|---|---|
| 100 | $0.20 |
| 1,000 | $2.00 |
| 10,000 | $20.00 |

Set **Max items** (and the run's maximum cost in the run options) to cap what a run can spend. The run stops when either limit is reached.

### Use cases

- **Healthcare sales and market mapping:** list every acute care hospital or nursing home in a territory with its ownership, beds and rating.
- **Quality benchmarking:** compare hospitals' star ratings and their mortality, safety and readmission measures against the national rate, state by state.
- **Senior care research:** shortlist nursing homes or home health agencies of four stars and up in a city, with staffing and inspection figures under details.
- **Payer and network analysis:** find dialysis facilities by chain, or hospitals with emergency services, in the counties you cover.
- **Monitoring:** schedule a monthly run and send changed ratings or new providers to Google Sheets, Slack or email.

### Tips

- Combine filters: provider type nursing homes, state TX, city Houston, minimum star rating 4.
- Several states go in one run: CA, NV, AZ.
- CMS refreshes each directory every few weeks to quarterly; a scheduled run picks up new ratings when they land.
- Each provider type has its own extra columns under details; export to JSON to keep them grouped, or CSV for one column each.
- About 41% of hospitals have no overall star rating (too few measures reported); overallRating is empty for them.

### FAQ

#### Is it legal to scrape CMS?

CMS Provider Data Scraper – Hospitals & Ratings collects only data that CMS shows publicly to every visitor, and it leaves out personal data such as private profiles and contact details. Our Actors are ethical and do not extract private user data. Results could still contain personal data in titles or descriptions written by uploaders. Personal data is protected by the GDPR in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers. You are responsible for how you use the data.

#### Can I use it through an API?

Yes. Every Apify Actor has an API: start runs, pass input and read results over HTTP, or use the JavaScript and Python clients. See the **API** tab on the Actor page for ready-made examples.

#### Can I schedule runs and connect other apps?

Yes. Use Apify **Schedules** to run CMS Provider Data Scraper – Hospitals & Ratings every hour, day or week, and integrations (Make, Zapier, Google Sheets, webhooks and more) to send the results where you need them.

#### Why did I get fewer results than expected?

The run stops at **Max items** or at the run's maximum cost, whichever comes first. CMS may also return fewer results for rare search terms. Duplicates across search terms are saved once. Check the run's `RUN_SUMMARY` record in the key-value store for the inputs that returned nothing.

#### What if it stops working?

Sites change. We run a daily check of our own and fix breakages quickly. If something looks wrong, open an issue in the **Issues** tab with the run link and we'll look at it.

#### Which provider types are covered?

Hospitals (about 5,400), nursing homes (about 14,700), home health agencies (about 12,500), hospices (about 6,700), dialysis facilities (about 7,500), inpatient rehabilitation facilities (about 1,200) and long-term care hospitals (about 300). Doctors and clinicians are not included.

#### How many records can one run get?

A whole directory: set Max records above its size (e.g. 15,000 for every nursing home). You pay only for records saved.

#### Is the data free to reuse?

CMS Provider Data is US government open data. This Actor saves you the download, filtering and typing; check CMS's terms for how to cite it.

#### Why is a field empty?

CMS leaves a value out when it has too few cases to report or the measure does not apply; the matching footnote column under details says why.

### Not included

No personal data: no doctors or clinicians, no owners or managing employees by name, and no patient-level data. The phone number is the provider's listed main line. Measure-by-measure scores beyond the counts and columns listed are not included; each provider's full profile is on Medicare.gov Care Compare.

### More Actors from us

- [AliExpress Search Scraper – Products & Prices](https://apify.com/unnoted/aliexpress-product-search)
- [BBB Scraper – Business Ratings & Accreditation](https://apify.com/unnoted/bbb-business-search)
- [Bilibili Scraper – Video Search & Stats API](https://apify.com/unnoted/bilibili-video-scraper)
- [Bumeran Jobs Scraper – LATAM Job Listings](https://apify.com/unnoted/bumeran-job-listings)
- [Foundit Jobs Scraper – India Job Listings API](https://apify.com/unnoted/foundit-job-listings)
- [Google Jobs Scraper – Job Listings API](https://apify.com/unnoted/google-jobs-listings)
- [Google Play Reviews Scraper – App Reviews API](https://apify.com/unnoted/google-play-reviews-scraper)
- [Google Trends Scraper – Interest & Related Queries](https://apify.com/unnoted/google-trends-data)
- [Idealo Scraper – Price Comparison Data](https://apify.com/unnoted/idealo-price-search)
- [Kleinanzeigen Scraper – Listings & Prices](https://apify.com/unnoted/kleinanzeigen-listings-scraper)
- [Mercari Japan Scraper – Listings & Prices API](https://apify.com/unnoted/mercari-japan-search)
- [Resident Advisor Scraper – RA Event Listings](https://apify.com/unnoted/resident-advisor-events)
- [Sainsbury's Scraper – UK Grocery Prices](https://apify.com/unnoted/sainsburys-grocery-search)
- [Tokopedia Scraper – Product Search & Prices](https://apify.com/unnoted/tokopedia-product-search)
- [Workday Jobs Scraper – Any Careers Site](https://apify.com/unnoted/workday-jobs-scraper)
- [Yandex Maps Scraper – Places & Business Data](https://apify.com/unnoted/yandex-maps-places)

# Actor input Schema

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

Which CMS provider directory to read. Each record is one Medicare-certified provider; the fields particular to that directory are under details.

## `state` (type: `string`):

Only providers in this US state or territory: a two-letter code or a name, e.g. CA or California. Several are comma-separated, e.g. CA, NV, AZ. Empty means every state.

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

Only providers in this city or town, e.g. Houston. Best combined with a state.

## `name` (type: `string`):

Only providers whose name contains these words, e.g. Mayo, Kaiser or Memorial.

## `minRating` (type: `integer`):

Only providers with at least this overall star rating (1–5). Hospitals, nursing homes, home health agencies and dialysis facilities have one; unrated providers are left out when this is set.

## `facilityIds` (type: `array`):

CMS Certification Numbers (CCN, the facility id) to get, one per line, e.g. 050454. They are looked up in the chosen provider type; the other filters still apply.

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

Maximum number of provider records. You pay only for records saved.

## Actor input object example

```json
{
  "dataset": "hospital-general-information",
  "state": "CA",
  "maxItems": 20
}
```

# Actor output Schema

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

One item per record.

## `runSummary` (type: `string`):

Items saved, inputs done, and how complete each field was.

# 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": "hospital-general-information",
    "state": "CA",
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("unnoted/cms-hospital-data").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": "hospital-general-information",
    "state": "CA",
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("unnoted/cms-hospital-data").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": "hospital-general-information",
  "state": "CA",
  "maxItems": 20
}' |
apify call unnoted/cms-hospital-data --silent --output-dataset

```

## MCP server setup

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

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/bxdAC6yVgt3UNMpyO/builds/o8pqH3Yu7CfvlyPPW/openapi.json
