# Hospital Leads - CMS Ratings, Ownership & Quality Flags (`flash_scraper/hospital-leads`) Actor

Scrape all 5,400+ Medicare-certified US hospitals from official CMS data: name, phone, address, hospital type, ownership, emergency department, CMS overall star rating, and how many mortality, safety and readmission measures beat or trail the national benchmark. No API key.

- **URL**: https://apify.com/flash\_scraper/hospital-leads.md
- **Developed by:** [Flash Scrape](https://apify.com/flash_scraper) (community)
- **Categories:** Lead generation, Business, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.50 / 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

## Hospital Leads — CMS Ratings, Ownership & Quality Flags

**Every Medicare-certified hospital in the US — 5,400+ — as a qualified B2B list.** One row per
hospital with the **phone number**, address, county, hospital type, ownership, whether it runs an
**emergency department**, the CMS **overall star rating**, and the per-domain quality counts CMS
publishes: how many mortality, safety and readmission measures came out **better or worse than
the national benchmark**.

**No API key, no login, no proxy.** Official CMS Hospital General Information file.

### What you can do with it

- 📞 **Reach the whole segment** — every row carries a phone number straight from CMS.
- 🎯 **Find quality-improvement buyers** — `worseThanNationalOnly` returns hospitals trailing the
  national benchmark, the natural list for consultants, safety software and staffing help.
- 🏥 **Segment the way you sell** — by `hospitalType` (acute care, critical access, psychiatric,
  children's, rural emergency, VA, DoD) and by `ownership` (non-profit, for-profit, government).
- ⭐ **Target by performance** — a rating *window*, so you can reach 4–5★ flagships or 1–2★
  hospitals under pressure.
- 🚑 **Filter on emergency departments** — relevant for anything sold into the ED.
- 📊 **Benchmark a market** — pull a state and compare ratings, ownership mix and measure counts.

### Input

| Field | Type | Description |
|---|---|---|
| `states` | array | Two-letter state codes, e.g. `["TX","CA"]`. Empty = all 5,400+ hospitals. |
| `hospitalType` | select | Acute care, critical access, psychiatric, children's, rural emergency, VA, DoD, or any. |
| `ownership` | select | Voluntary non-profit, for profit (proprietary), government, VA, or any. |
| `minOverallRating` | integer | Minimum CMS stars (1–5). `0` = no filter. |
| `maxOverallRating` | integer | Maximum CMS stars. Set `2` for hospitals under quality pressure. |
| `emergencyServicesOnly` | boolean | Only hospitals with an emergency department. |
| `worseThanNationalOnly` | boolean | Only hospitals with ≥1 mortality/safety/readmission measure worse than national. |
| `maxItems` | integer | Max hospitals (1–6000). |

#### Examples

Quality-improvement targets in Texas:

```json
{ "states": ["TX"], "worseThanNationalOnly": true, "maxOverallRating": 2, "maxItems": 200 }
```

Every children's hospital in the country:

```json
{ "states": [], "hospitalType": "childrens", "maxItems": 300 }
```

### Output (one row per hospital)

`facility_id`, `name`, `phone`, `address`, `city`, `state`, `zip_code`, `county`,
`hospital_type`, `ownership`, `emergency_services`, `birthing_friendly`, `overall_rating`,
`mortality_measures_worse`, `mortality_measures_better`, `safety_measures_worse`,
`safety_measures_better`, `readmission_measures_worse`, `readmission_measures_better`,
`patient_experience_measures`, `timely_care_measures`, `measures_worse_than_national`,
`measures_better_than_national`, `quality_tags`, `cms_profile_url`.

#### Sample row

```json
{
  "facility_id": "450002",
  "name": "THE HOSPITALS OF PROVIDENCE - MEMORIAL CAMPUS",
  "phone": "(915) 577-6011",
  "city": "EL PASO",
  "state": "TX",
  "county": "EL PASO",
  "hospital_type": "Acute Care Hospitals",
  "ownership": "Proprietary",
  "emergency_services": true,
  "overall_rating": 2,
  "safety_measures_worse": 0,
  "readmission_measures_worse": 1,
  "measures_worse_than_national": 1,
  "measures_better_than_national": 4,
  "quality_tags": [
    "low overall rating",
    "1 measure(s) worse than national"
  ]
}
```

Every `quality_tags` entry traces to one named CMS field — no hidden scoring.

### Honest notes

- **Many hospitals carry no CMS star rating at all.** Children's, psychiatric, VA and other
  specialty hospitals are largely unrated — a national children's-hospital run returns **0 rated
  facilities**. `overall_rating` is therefore null for them, and any `minOverallRating` filter
  excludes them by design. The `quality_tags` list flags this as "not rated by CMS" rather than
  implying a bad score.
- **Filters are applied to the data, not by the API — deliberately.** Every numeric column in the
  CMS datastore is declared `type=text`, so the API's `>=` compares *lexically* ("57" ranks above
  "100"). This actor pages and filters in code, so rating and count filters are exact.
- **`measures_worse_than_national` sums three domains** — mortality, safety and readmission —
  and each domain is also exposed separately so you can see which one is the problem.
- **`ownership` and `hospital_type` are CMS's own wording**, passed through verbatim
  ("Voluntary non-profit - Private", "Critical Access Hospitals") rather than re-bucketed.
- Data refreshes when CMS publishes; this actor always reads the current file.

# Actor input Schema

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

Two-letter state codes, e.g. \['TX','CA']. Empty = all 5,400+ hospitals.

## `hospitalType` (type: `string`):

CMS hospital category.

## `ownership` (type: `string`):

Who owns the hospital.

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

CMS overall rating 1-5. 0 = no filter. Note: many specialty hospitals carry no rating and are excluded by any minimum.

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

0 = no filter. Set 2 to find hospitals under quality pressure.

## `emergencyServicesOnly` (type: `boolean`):

Excludes hospitals CMS records as having no emergency services.

## `worseThanNationalOnly` (type: `boolean`):

Keep only hospitals with at least one mortality, safety or readmission measure worse than the national average - the quality-improvement target list.

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

Maximum number of hospitals to return.

## Actor input object example

```json
{
  "states": [
    "TX"
  ],
  "hospitalType": "any",
  "ownership": "any",
  "minOverallRating": 0,
  "maxOverallRating": 0,
  "emergencyServicesOnly": false,
  "worseThanNationalOnly": false,
  "maxItems": 100
}
```

# 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": [
        "TX"
    ],
    "hospitalType": "any",
    "ownership": "any",
    "minOverallRating": 0,
    "maxOverallRating": 0,
    "emergencyServicesOnly": false,
    "worseThanNationalOnly": false,
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("flash_scraper/hospital-leads").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": ["TX"],
    "hospitalType": "any",
    "ownership": "any",
    "minOverallRating": 0,
    "maxOverallRating": 0,
    "emergencyServicesOnly": False,
    "worseThanNationalOnly": False,
    "maxItems": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("flash_scraper/hospital-leads").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": [
    "TX"
  ],
  "hospitalType": "any",
  "ownership": "any",
  "minOverallRating": 0,
  "maxOverallRating": 0,
  "emergencyServicesOnly": false,
  "worseThanNationalOnly": false,
  "maxItems": 100
}' |
apify call flash_scraper/hospital-leads --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

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