# CMS Hospital Quality Scraper — Ratings & HCAHPS ✅ (`themineworks/cms-hospital-quality`) Actor

Pull CMS hospital quality data: overall star ratings, patient survey scores and complications for 4,500+ US hospitals by state or city. No API key. Works in Claude, ChatGPT & any MCP-compatible AI agent. MCP server: the-mine-works-mcp.hatchable.site

- **URL**: https://apify.com/themineworks/cms-hospital-quality.md
- **Developed by:** [The Mine Works](https://apify.com/themineworks) (community)
- **Categories:** Developer tools, MCP servers
- **Stats:** 1 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 hospital scrapeds

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/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

## CMS Hospital Quality — Star Ratings, HCAHPS & Complications

Pull **CMS hospital quality data** from Medicare.gov — overall star ratings, patient satisfaction scores (HCAHPS), complication rates, and timely care measures — for 4,500+ US hospitals, as clean structured JSON. Built for **healthcare analytics, site selection, quality benchmarking, and investment due diligence**. No API key required.

**Keywords:** CMS hospital quality, Medicare star ratings, HCAHPS scores, hospital compare, hospital ratings API, CMS provider data.

---

### Why this actor

The Centers for Medicare & Medicaid Services (CMS) publishes the Hospital Compare dataset — the federal government's official hospital quality benchmark. It is the same data that powers Medicare.gov's hospital finder and is used by insurers, health systems, investors, and researchers to compare hospital performance. The underlying Socrata API is open but requires understanding dataset IDs and SODA query syntax. This actor handles that complexity and gives you one clean record per hospital.

- **4,500+ hospitals** covered across all US states.
- **Overall star rating** (1–5 stars) from CMS's composite methodology.
- **Filter by state, city, or hospital name** for targeted pulls.
- **No API key** — official CMS Provider Data Catalog.

---

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `state` | string | `CA` | 2-letter US state code. Leave blank for all states. |
| `city` | string | — | Filter by city name. |
| `hospitalName` | string | — | Partial name match. |
| `minStars` | integer | — | Minimum overall star rating (1–5). |
| `maxResults` | integer | 200 | Maximum hospitals to return. |

#### Example

```json
{ "state": "NY", "minStars": 4, "maxResults": 100 }
````

***

### Output

```json
{
  "hospital_name": "Cedars-Sinai Medical Center",
  "facility_id": "050625",
  "address": "8700 BEVERLY BLVD",
  "city": "LOS ANGELES",
  "state": "CA",
  "zip_code": "90048",
  "county_name": "LOS ANGELES",
  "phone_number": "3104230141",
  "hospital_type": "Acute Care Hospitals",
  "hospital_ownership": "Voluntary non-profit - Private",
  "overall_star_rating": "4",
  "emergency_services": "Yes",
  "scraped_at": "2026-06-15T00:00:00.000Z"
}
```

A final `{"_type":"summary"}` record reports total hospitals returned.

***

### Pricing

**First 25 hospitals free per account**, then **$0.004 per hospital** ($4 per 1,000). Zero charge on empty runs.

***

### FAQ

**Do I need an API key?** No — the CMS Provider Data Catalog is fully open.

**How current is the data?** CMS updates the Hospital Compare dataset quarterly. The actor always queries the live endpoint.

**How many hospitals are covered?** Approximately 4,500 Medicare-certified acute care hospitals across all 50 states.

**Can I get HCAHPS patient satisfaction scores?** The overall star rating incorporates HCAHPS. For raw HCAHPS survey scores by domain (communication with nurses, responsiveness, etc.), contact us — we can build a companion actor on the HCAHPS-specific CMS dataset.

**What is the star rating based on?** CMS calculates the overall star rating from up to 5 care areas: mortality, safety of care, readmission, patient experience, and timely and effective care. Hospitals with fewer than 3 scored groups receive no rating.

**Can I filter to high-performing hospitals only?** Yes — set `minStars` to 4 or 5 to retrieve only top-rated hospitals in your target state or city.

**Who uses this data?** Healthcare investors benchmarking acquisition targets; health system consultants comparing regional performance; insurers building network adequacy models; researchers studying hospital quality variation; journalists covering healthcare.

**How far back does the data go?** The live endpoint reflects the most recent CMS release. Historical data is not available via this actor — CMS archives prior releases at data.cms.gov if you need longitudinal comparison.

**Can I automate regular refreshes?** Yes — schedule this actor quarterly on Apify to stay current with CMS updates.

# Actor input Schema

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

Filter by US state code (e.g. CA, NY, TX). Leave blank for all states.

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

Filter by city name.

## `hospitalName` (type: `string`):

Filter by hospital name — partial matches work.

## `minStars` (type: `integer`):

Return only hospitals with this overall star rating or higher (1-5).

## `maxResults` (type: `integer`):

Maximum hospitals to return.

## Actor input object example

```json
{
  "state": "CA",
  "maxResults": 25
}
```

# 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 = {
    "state": "CA",
    "maxResults": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("themineworks/cms-hospital-quality").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 = {
    "state": "CA",
    "maxResults": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("themineworks/cms-hospital-quality").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 '{
  "state": "CA",
  "maxResults": 25
}' |
apify call themineworks/cms-hospital-quality --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "CMS Hospital Quality Scraper — Ratings & HCAHPS ✅",
        "description": "Pull CMS hospital quality data: overall star ratings, patient survey scores and complications for 4,500+ US hospitals by state or city. No API key. Works in Claude, ChatGPT & any MCP-compatible AI agent. MCP server: the-mine-works-mcp.hatchable.site",
        "version": "0.1",
        "x-build-id": "hJ71tebcfm1O7p9xB"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/themineworks~cms-hospital-quality/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-themineworks-cms-hospital-quality",
                "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/themineworks~cms-hospital-quality/runs": {
            "post": {
                "operationId": "runs-sync-themineworks-cms-hospital-quality",
                "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/themineworks~cms-hospital-quality/run-sync": {
            "post": {
                "operationId": "run-sync-themineworks-cms-hospital-quality",
                "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": {
                    "state": {
                        "title": "State (2-letter)",
                        "type": "string",
                        "description": "Filter by US state code (e.g. CA, NY, TX). Leave blank for all states."
                    },
                    "city": {
                        "title": "City",
                        "type": "string",
                        "description": "Filter by city name."
                    },
                    "hospitalName": {
                        "title": "Hospital name (partial match)",
                        "type": "string",
                        "description": "Filter by hospital name — partial matches work."
                    },
                    "minStars": {
                        "title": "Minimum star rating",
                        "minimum": 1,
                        "maximum": 5,
                        "type": "integer",
                        "description": "Return only hospitals with this overall star rating or higher (1-5)."
                    },
                    "maxResults": {
                        "title": "Max hospitals",
                        "minimum": 1,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Maximum hospitals to return.",
                        "default": 200
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
