# Medicare Nursing Home Compare Scraper (`brightpath-data/cms-nursing-home-compare`) Actor

Search CMS Nursing Home Compare data by state, city, county, name or rating and export clean nursing home records.

- **URL**: https://apify.com/brightpath-data/cms-nursing-home-compare.md
- **Developed by:** [Nick Randall](https://apify.com/brightpath-data) (community)
- **Categories:** AI, Business, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 nursing home 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

## Medicare Nursing Home Compare Scraper

Search CMS Nursing Home Compare by state, city, county, name or star rating and export clean, flat facility records.

Get clean, structured nursing home records from the CMS Provider Data Catalog as JSON, CSV or Excel, or call it as a tool from Claude, Cursor, ChatGPT or any MCP client. Pay only for the results you receive.

### What you get

One record per Medicare-certified nursing home: certification number (CCN), name, address, city, state, zip, phone, county and SSA county code, ownership type, certified bed count and average daily residents, provider type, whether it is hospital-based, continuing care retirement community and special focus status flags, the abuse icon flag, all five CMS star ratings (overall, health inspection, quality measures, long-stay QM, short-stay QM, staffing), staff turnover rates, fines and payment denial counts, latitude and longitude, the CMS processing date, and a direct link to the facility's page on medicare.gov/care-compare.

Every result is a flat record with stable field names, so it drops straight into a spreadsheet, a database or an AI agent's context.

### Why use this instead of the website

- Filter by state, city, county, name and minimum star rating in one call
- Pagination handled for you, with automatic retries and polite rate limiting
- Results in JSON, CSV, Excel or via API, or piped into Zapier, Make, n8n and Google Sheets
- Works as an MCP tool, so AI agents can look up nursing homes on demand
- No browser, no proxies, no personal data: fast runs and a tiny cost per result

### Input

| Field | Type | Default | Meaning |
|-------|------|---------|---------|
| `state` | string | | Two-letter state or territory code, e.g. "AZ". Strongly recommended. |
| `city` | string | | City or town name, matched exactly (case-insensitive). |
| `county` | string | | County name. |
| `nameContains` | string | | Only facilities whose name contains this text. |
| `minOverallRating` | integer | | Minimum overall Medicare star rating, 1 to 5. |
| `ownershipType` | string | any | Exact CMS ownership category, e.g. "For profit - Corporation". |
| `maxResults` | integer | 100 | Cap on facilities saved. You are charged per facility, so this caps your cost. |

Example input:

```json
{ "state": "AZ", "minOverallRating": 4, "maxResults": 40 }
```

### Output

Example result:

```json
{
  "ccn": "035003",
  "providerName": "The Terraces of Phoenix",
  "address": "7550 NORTH 16TH STREET",
  "city": "PHOENIX",
  "state": "AZ",
  "zipCode": "85020",
  "phone": "6029444455",
  "countyName": "Maricopa",
  "ssaCountyCode": "0140",
  "ownershipType": "Non profit - Corporation",
  "certifiedBeds": 64,
  "averageResidentsPerDay": 51.5,
  "providerType": "Medicare and Medicaid",
  "residesInHospital": "N",
  "continuingCareRetirementCommunity": "N",
  "specialFocusStatus": null,
  "abuseIcon": "N",
  "overallRating": 5,
  "healthInspectionRating": 4,
  "qmRating": 5,
  "longStayQmRating": 5,
  "shortStayQmRating": 4,
  "staffingRating": 5,
  "totalNursingStaffTurnover": 20.6,
  "registeredNurseTurnover": 14.3,
  "numberOfFines": 0,
  "totalAmountOfFinesInDollars": 0,
  "numberOfPaymentDenials": 0,
  "latitude": 33.577,
  "longitude": -112.061,
  "processingDate": "2026-08-01",
  "careCompareUrl": "https://www.medicare.gov/care-compare/details/nursing-home/035003"
}
```

Field reference: `ccn`, `providerName`, `address`, `city`, `state`, `zipCode`, `phone`, `countyName`, `ssaCountyCode`, `ownershipType`, `certifiedBeds`, `averageResidentsPerDay`, `providerType`, `residesInHospital`, `continuingCareRetirementCommunity`, `specialFocusStatus`, `abuseIcon`, `overallRating`, `healthInspectionRating`, `qmRating`, `longStayQmRating`, `shortStayQmRating`, `staffingRating`, `totalNursingStaffTurnover`, `registeredNurseTurnover`, `numberOfFines`, `totalAmountOfFinesInDollars`, `numberOfPaymentDenials`, `latitude`, `longitude`, `processingDate`, `careCompareUrl`. Numbers are parsed from the source; empty CMS values become `null`.

### Pricing

Pay per event. You are charged **$2.00 per 1,000 results** saved to the dataset, plus a fraction of a cent per run start. Nothing is charged for results you do not receive. Set "Max total charge per run" in the run options to cap spending on any run. When a run reaches your cap it stops cleanly and keeps everything it already saved.

Rough guide: 1,000 results cost $2.00 and take about 15 seconds.

### Use it from an AI agent (MCP)

This Actor is available as an MCP tool through the Apify MCP server. Add it to your client, then ask the agent for the data in plain language.

Claude Desktop, Claude Code or Cursor (`mcp.json` / `claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com/?actors=brightpath-data/cms-nursing-home-compare",
      "headers": { "Authorization": "Bearer YOUR_APIFY_TOKEN" }
    }
  }
}
```

ChatGPT and other clients that support remote MCP servers: add `https://mcp.apify.com/?actors=brightpath-data/cms-nursing-home-compare` as a connector with your Apify token.

Example prompt once connected: "Find 5-star nursing homes in Maricopa County, Arizona and list their ownership type and staffing rating."

### Use it from code

```bash
curl -X POST "https://api.apify.com/v2/acts/brightpath-data~cms-nursing-home-compare/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"state":"AZ","minOverallRating":4,"maxResults":40}'
```

Python:

```python
from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("brightpath-data/cms-nursing-home-compare").call(run_input={"state": "AZ", "minOverallRating": 4, "maxResults": 40})
items = client.dataset(run["defaultDatasetId"]).list_items().items
```

### Limits and fair use

- Up to 10,000 facilities per run. For larger exports, split by state or city.
- Requests are paced at one per 250 ms and fetch up to 500 records per request.
- `careCompareUrl` is built from the CCN and omitted when a facility has no CCN.
- `minOverallRating` is applied after fetching each page, so very narrow filters on a huge unfiltered run (no state) can take longer than the item count suggests. Set a state for fast runs.

### Data source and legal

Data comes from the CMS Provider Data Catalog (data.cms.gov), the official public API behind Medicare Care Compare, published by the Centers for Medicare & Medicaid Services. The data is public and free to use. This Actor collects public, non-personal data only and does not bypass logins, paywalls or access controls. You are responsible for how you use the data.

### Support

Found a problem or need a field added? Open an issue on the Actor's Issues tab. Fixes for broken runs are prioritized.

# Actor input Schema

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

Two-letter US state or territory code, e.g. "AZ". Strongly recommended: without it the run pages through the entire national dataset.

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

City or town name, e.g. "Phoenix". Matched exactly (case-insensitive) against the provider's city field.

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

County name, e.g. "Maricopa".

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

Only include facilities whose name contains this text, e.g. "MEMORIAL".

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

Only include facilities with an overall Medicare star rating at or above this value (1 to 5).

## `ownershipType` (type: `string`):

Exact ownership category as published by CMS.

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

Maximum number of nursing homes to save. You are charged per facility saved, so this also caps the cost of a run.

## Actor input object example

```json
{
  "state": "AZ",
  "ownershipType": "",
  "maxResults": 100
}
```

# Actor output Schema

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

The dataset with one flat record per result. Append ?format=csv or ?format=xlsx to the URL for other formats.

## `summary` (type: `string`):

OUTPUT record in the key-value store: counts of results pushed and charged, requests, retries and duration.

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

// Run the Actor and wait for it to finish
const run = await client.actor("brightpath-data/cms-nursing-home-compare").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": "AZ" }

# Run the Actor and wait for it to finish
run = client.actor("brightpath-data/cms-nursing-home-compare").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": "AZ"
}' |
apify call brightpath-data/cms-nursing-home-compare --silent --output-dataset

```

## MCP server setup

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

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/lXedVCqR6AKrn0kQp/builds/6o25huNHag1JmCDG5/openapi.json
