# US Hospitals Scraper - Ratings, Ownership & Quality (`scrapers_lat/cms-hospitals-scraper`) Actor

Scrape US Medicare-certified hospitals with CMS facility ID, address, phone, hospital type, ownership, emergency services, overall 5-star rating, mortality/safety/readmission measures and EHR status. Filter by state, city, ZIP, type, ownership and rating. Export to JSON, CSV or Excel.

- **URL**: https://apify.com/scrapers\_lat/cms-hospitals-scraper.md
- **Developed by:** [Scrapers Lat](https://apify.com/scrapers_lat) (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 $12.75 / 1,000 results

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

## US Hospitals Scraper - Ratings, Ownership & Quality

> Build complete lists of US Medicare-certified hospitals with the CMS facility ID (CCN), full address and phone, hospital type, ownership, emergency-services flag, Birthing Friendly designation, overall 5-star rating, and mortality, safety of care, readmission, patient-experience and timely-and-effective-care measure results, plus each hospital's certified EHR ID and Promoting Interoperability status. Filter by state, city, ZIP, county, type, ownership, emergency services and rating and export clean structured data for KYB, sales, research and analytics.

**📥 [Input](https://apify.com/scrapers_lat/cms-hospitals-scraper/input-schema) · 📤 [Output](https://apify.com/scrapers_lat/cms-hospitals-scraper/output-schema) · 💰 [Pricing](https://apify.com/scrapers_lat/cms-hospitals-scraper/pricing) · ▶️ [Examples](https://apify.com/scrapers_lat/cms-hospitals-scraper/examples)**

![Apify](https://img.shields.io/badge/Platform-Apify-1CE1CE?logo=apify\&logoColor=white)
![Healthcare data](https://img.shields.io/badge/Data-Healthcare-blue)
![Output](https://img.shields.io/badge/Output-JSON%20%7C%20CSV%20%7C%20Excel-orange)

<table><tr>
<td align="center"><strong>Type, ownership & ER</strong><br>with 5-star rating</td>
<td align="center"><strong>Quality measures & EHR</strong><br>mortality, safety, readmission</td>
<td align="center"><strong>JSON / CSV / Excel</strong><br>output formats</td>
</tr></table>

<br>

### What you get

Each hospital record includes:

- **Identity**: CMS facility ID (CCN), name, full address, city, state, ZIP, county, phone
- **Profile**: hospital type, ownership type, emergency-services flag, Birthing Friendly designation
- **Rating**: overall 5-star rating
- **Quality measure groups**: for mortality, safety of care and readmission, how many measures were reported and how many were better, no different or worse than the national rate; plus the count of patient-experience and timely-and-effective-care measures
- **EHR**: certified EHR technology ID, Promoting Interoperability (meaningful use) status and the reporting period
- A Care Compare profile URL and the timestamp the record was read

### Who is it for

| Use case | Who benefits |
|---|---|
| Sales and outreach | Medical device, pharma, staffing and SaaS teams targeting hospitals by type, ownership and location |
| KYB and market mapping | Analysts profiling hospital ownership and networks across states |
| Research and journalism | Teams comparing quality, safety and ratings across facilities |
| Data enrichment | Teams appending CCN, ratings, ownership and phone to existing hospital records |

### How to use it

1. Choose one or more **states** (and optionally **city**, **ZIP**, **county** or a **name** filter).
2. Narrow by **hospital type**, **ownership type**, **emergency services**, **Birthing Friendly** or an **overall star rating** range.
3. Keep **include EHR status** on if you want the meaningful-use fields, set **Max Hospitals To Scrape** and run. Export as JSON, CSV or Excel, or pull it through the Apify API.

### Frequently Asked Questions

**No result, no charge?**
Correct. You are billed only per real hospital record returned. A run that matches nothing costs you nothing.

**What quality data is included?**
For each hospital you get the overall 5-star rating plus, for the mortality, safety of care and readmission measure groups, how many measures were reported and how many were better, no different or worse than the national benchmark, plus the count of patient-experience and timely-and-effective-care measures.

**Can I get only hospitals with an emergency room?**
Yes. Turn emergency services on to keep only hospitals with an ER, or off to keep only those without.

**Can I filter by rating or type?**
Yes. Set a minimum or maximum overall star rating and pick one or more hospital types or ownership types.

**How fresh is the data?**
Records are read live at run time, so each row reflects the source at the moment of the run (see observedAt).

### Export, API and AI agents (x402 + MCP)

Export the scraped data to **JSON, CSV or Excel**, pull it as a **dataset** through the Apify **API**, or wire it into your app with **no code**. This web scraper and data extractor also works for bulk data extraction and scheduled runs.

For AI agents: this Actor is available on **x402**, Apify's agentic payment standard built with Coinbase. An AI agent can discover, pay for and run it on its own with a funded wallet and a single HTTP request: no account, no subscription, no API key and no human in the loop. It also runs as an **MCP** tool inside Claude, Cursor and other AI clients out of the box. Learn more about [x402 agentic payments on Apify](https://docs.apify.com/platform/integrations/x402).

### Related scrapers

- [US Nursing Homes Scraper - Owners, Ratings & Staffing](https://apify.com/scrapers_lat/cms-nursing-homes-scraper)
- [Medicare Doctors & Clinicians Scraper](https://apify.com/scrapers_lat/medicare-doctors-clinicians-scraper)
- [NPPES NPI Healthcare Provider Data Scraper](https://apify.com/scrapers_lat/nppes-npi-scraper)

### More scrapers at scrapers.lat

This actor is built and maintained by [scrapers.lat](https://scrapers.lat), where we publish scrapers for public platforms: finance, news, real estate, jobs, e-commerce and government data. Browse the full catalog or ask us for a custom scraper at [scrapers.lat](https://scrapers.lat).

***

> This actor is an independent tool and has no affiliation with the US Centers for Medicare & Medicaid Services. It only accesses publicly available provider data. Use the results in accordance with the source's terms.

# Actor input Schema

## `states` (type: `array`):

Filter by 2-letter US state code, for example CA, TX, NY. One run can scan several.

## `cities` (type: `array`):

Optional. Filter by city, for example LOS ANGELES, HOUSTON.

## `zipCodes` (type: `array`):

Optional. Filter by 5-digit ZIP code.

## `counties` (type: `array`):

Optional. Filter by county / parish name, for example LOS ANGELES, HARRIS.

## `nameContains` (type: `string`):

Optional. Keep only hospitals whose name contains this text.

## `hospitalTypes` (type: `array`):

Optional. Filter by hospital type.

## `ownershipTypes` (type: `array`):

Optional. Filter by ownership type.

## `emergencyServices` (type: `boolean`):

Optional. Set on to keep only hospitals WITH emergency services, off to keep only those without. Leave unset to include both.

## `birthingFriendlyOnly` (type: `boolean`):

When on, keep only hospitals that meet the CMS Birthing Friendly designation.

## `minOverallRating` (type: `integer`):

Optional. Keep only hospitals with an overall 5-star rating at or above this value (1-5).

## `maxOverallRating` (type: `integer`):

Optional. Keep only hospitals with an overall 5-star rating at or below this value (1-5).

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

Optional. Look up specific hospitals by their CMS facility ID / CCN.

## `includeEhr` (type: `boolean`):

When on (default), attach each hospital's certified EHR ID and Promoting Interoperability (meaningful use) status.

## `maxHospitals` (type: `integer`):

Maximum number of hospitals to collect.

## Actor input object example

```json
{
  "states": [
    "CA"
  ],
  "birthingFriendlyOnly": false,
  "includeEhr": true,
  "maxHospitals": 10
}
```

# 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 = {
    "states": [
        "CA"
    ],
    "maxHospitals": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapers_lat/cms-hospitals-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 = {
    "states": ["CA"],
    "maxHospitals": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("scrapers_lat/cms-hospitals-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 '{
  "states": [
    "CA"
  ],
  "maxHospitals": 10
}' |
apify call scrapers_lat/cms-hospitals-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/j7tIOkFFdBRnnuRpr/builds/sWYOv0ueJzpmai1bh/openapi.json
