# Healthcare Provider Data API - CMS Hospital & Nursing Home (`captainhandsome/cms-healthcare-provider-search`) Actor

Query official CMS provider data for hospitals, nursing homes, dialysis facilities, hospices, home health agencies and rehab centers. Filter by state, city, ZIP or county for star ratings, hospital data and hospice records, with no API key.

- **URL**: https://apify.com/captainhandsome/cms-healthcare-provider-search.md
- **Developed by:** [Joseph McRell](https://apify.com/captainhandsome) (community)
- **Categories:** Business, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $14.00 / 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/actors/running/actors-in-store.md#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

## CMS Healthcare Provider Search

Search official CMS healthcare provider datasets by provider type, state, city, ZIP, county or name. Export normalized facility records without an API key. This Actor turns official CMS Provider Data Catalog APIs into bounded, structured datasets for analysis, enrichment, monitoring, and AI-agent workflows.

### What data can I extract?

65 flat columns per provider, normalized across seven CMS directories that do not share a column vocabulary:

- **Identity and contact** - `ccn`, `name`, `legal_name`, `address`, `city`, `state`, `zip`, `county`, `phone`, `latitude`, `longitude`, `urban_location`, `cms_region`, `esrd_network`.
- **Classification** - `provider_type`, `subtype`, `ownership`, `certification_date`, `data_processing_date`.
- **Corporate structure** - `chain`, `chain_owned`, `chain_facility_count`, `chain_average_star_rating`, `ownership_changed_last_12_months`, `resides_in_hospital`, `continuing_care_retirement_community`.
- **Capacity and services** - `beds`, `stations`, `average_daily_residents`, `services_offered`, `emergency_services`, `late_shift`, `birthing_friendly`.
- **Ratings** - `star_rating` plus the nursing-home components `health_inspection_rating`, `staffing_rating`, `quality_measure_rating`, `longstay_quality_rating`, `shortstay_quality_rating`.
- **Inspections and enforcement** - `last_health_inspection_date`, `inspection_over_2_years_ago`, `health_deficiencies`, `weighted_health_survey_score`, `infection_control_citations`, `abuse_flag`, `special_focus_status`, `number_of_fines`, `total_fines_usd`, `number_of_payment_denials`.
- **Staffing** - `nurse_staffing_hours_per_resident_day`, `rn_staffing_hours_per_resident_day`, `nursing_staff_turnover_pct`, `rn_turnover_pct`, `administrator_departures`.
- **Comparative outcomes** - `timely_care_pct`, `readmission_performance`, `hospitalization_performance`, `patient_survival_performance`, `patient_infection_performance`, and the hospital measure counts `mortality_measures_better` / `_worse`, `safety_measures_better` / `_worse`, `readmission_measures_better` / `_worse`.

Every row carries every column, so the dataset exports as one rectangular CSV. A column CMS does not publish for a given directory is null rather than absent. Download results as JSON, CSV, Excel, XML, or access them through the Apify API.

### Input example

```json
{
  "provider_types": "hospital",
  "state": "TX",
  "city": "Houston",
  "max_items": 100
}
```

`max_items` is a hard output and billing ceiling. The default input is intentionally limited to 10 records so Store tests and first runs stay inexpensive.

### Output example

One real record from the input above, with the columns CMS does not publish for hospitals omitted for brevity:

```json
{
  "provider_type": "hospital",
  "ccn": "450068",
  "name": "MEMORIAL HERMANN - TEXAS MEDICAL CENTER",
  "address": "6411 FANNIN",
  "city": "HOUSTON",
  "state": "TX",
  "zip": "77030",
  "county": "HARRIS",
  "phone": "(713) 704-3700",
  "ownership": "Voluntary non-profit - Private",
  "subtype": "Acute Care Hospitals",
  "star_rating": 4.0,
  "emergency_services": "Yes",
  "birthing_friendly": "Y",
  "mortality_measures_better": 1,
  "mortality_measures_worse": 0,
  "safety_measures_better": 4,
  "safety_measures_worse": 0,
  "readmission_measures_better": 2,
  "readmission_measures_worse": 2
}
```

Nursing-home rows additionally carry staffing hours, turnover, fines, inspection dates and the five-star components; dialysis and home-health rows carry `services_offered` and the comparative outcome columns. The dataset schema documents every field with a title, type, description, and example so humans and AI tools can inspect the contract before running it.

### Use with AI agents and MCP

Apify's hosted MCP server can discover and call this Actor. A suitable agent request is:

> Find up to 100 hospitals in Houston, Texas with CMS identifiers, addresses, phone numbers and facility attributes.

Use this exact Actor input:

```json
{
  "provider_types": "hospital",
  "state": "TX",
  "city": "Houston",
  "max_items": 100
}
```

The Actor succeeds with a nonempty default dataset and exposes its default dataset through the top-level Output schema.

### Pricing and cost control

Output is billed per result at **$0.02 per result** (about $20.00 per 1,000 results), plus a $0.0005 Actor-start charge billed once per gigabyte of memory at run start. Use `max_items` to cap both output volume and charges. The price shown on the Apify Store listing is authoritative.

Use `max_items` to cap returned and billable records. Invalid input is rejected before unnecessary work wherever possible.

### Common use cases

- Source-specific research and market intelligence
- Structured exports for spreadsheets, warehouses and BI systems
- Entity enrichment and monitoring pipelines
- Retrieval and data collection by AI agents

### Reliability

The Actor uses bounded pagination, retries transient upstream failures, deduplicates records where the source exposes stable identifiers, and fails explicitly when the source cannot provide usable output. Production default-input canaries verify a nonempty structured dataset in under five minutes.

### Limitations and responsible use

- Coverage, field availability and update timing are controlled by the upstream public source.
- Optional fields can be null or absent when the source does not publish them.
- This Actor does not bypass authentication, access controls, CAPTCHAs, or source rate limits.
- Customers remain responsible for lawful use, applicable source terms, and restrictions on downstream decisions.

### FAQ

#### What is the best way to run this CMS healthcare provider search Actor?

Start with the 10-record default, inspect the dataset, then increase `max_items` and narrow the available filters for your use case.

#### Do I need my own API key?

No external API key is required unless the Input tab explicitly says otherwise. Apify credentials are used normally when invoking the Actor through Apify APIs or MCP.

#### Can an AI agent call it?

Yes. The strict input schema acts as the tool signature, and the dataset plus Output schemas describe the returned records.

#### Can I export the results?

Yes. Apify datasets support JSON, CSV, Excel, XML and API retrieval.

### Support and changes

Open an issue on the Actor page with a redacted input and run ID. See [CHANGELOG.md](./CHANGELOG.md) for contract and maintenance updates.

# Actor input Schema

## `provider_types` (type: `array`):

One or more CMS dataset types: hospital, nursing\_home, home\_health, hospice, or dialysis.

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

Two-letter US state or territory abbreviation.

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

Provider city filter; matching is source-dependent.

## `zip` (type: `string`):

Five-digit US postal code.

## `county` (type: `string`):

County name used to filter healthcare providers.

## `name_contains` (type: `string`):

Case-insensitive text expected in the provider or facility name.

## `max_items` (type: `integer`):

Hard maximum number of dataset records returned and billed.

## Actor input object example

```json
{
  "provider_types": [
    "hospital"
  ],
  "state": "CA",
  "max_items": 10
}
```

# Actor output Schema

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

One flat row per Medicare-certified provider.

# 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"
};

// Run the Actor and wait for it to finish
const run = await client.actor("captainhandsome/cms-healthcare-provider-search").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" }

# Run the Actor and wait for it to finish
run = client.actor("captainhandsome/cms-healthcare-provider-search").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 '{
  "state": "CA"
}' |
apify call captainhandsome/cms-healthcare-provider-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,captainhandsome/cms-healthcare-provider-search"
        }
    }
}

```

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/wscn89LfDd6qmKW6l/builds/VFawxPZiOel3GjAL1/openapi.json
