# CMS Nursing Home - Ratings & Inspections (`pink_comic/cms-nursing-home-compare`) Actor

Search CMS Nursing Home Compare. Find nursing homes by name, city, or state with star ratings, inspections, and staffing. For eldercare consultants, healthcare investors, insurance analysts, and family caregivers. Pay per result.

- **URL**: https://apify.com/pink\_comic/cms-nursing-home-compare.md
- **Developed by:** [Ava Torres](https://apify.com/pink_comic) (community)
- **Categories:** Automation, Developer tools, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.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.

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 Nursing Home Compare

Search CMS Nursing Home Compare quality data for 14,700+ Medicare- and Medicaid-certified nursing facilities across the United States. Filter by state, facility name, star rating, ownership type, or CMS Certification Number. Returns structured quality ratings, staffing levels, fine history, and contact data. No API key required.

---

### Data Source

CMS Nursing Home Compare via the CMS Care Compare API. Official federal data maintained by the Centers for Medicare & Medicaid Services and updated on a regular basis.

---

### Output Fields

| Field | Type | Description |
|---|---|---|
| `ccn` | string | CMS Certification Number (unique facility identifier) |
| `providerName` | string | Facility name |
| `city` | string | City |
| `state` | string | State abbreviation |
| `overallRating` | string | Overall star rating (1-5) |
| `healthInspectionRating` | string | Health inspection star rating (1-5) |
| `staffingRating` | string | Staffing star rating (1-5) |
| `qualityRating` | string | Quality measures star rating (1-5) |
| `ownershipType` | string | For Profit, Non-Profit, or Government |
| `certifiedBeds` | string | Number of CMS-certified beds |
| `totalFinesInDollars` | string | Total federal fines assessed in dollars |
| `phone` | string | Facility phone number |

---

### Use Cases

- **Healthcare lead generation** -- build prospect lists of nursing facilities by state, rating tier, or ownership type for B2B sales targeting (medical supplies, staffing, software, food service).
- **Market research** -- analyze facility density, rating distribution, and ownership concentration by geography.
- **Compliance and due diligence** -- screen facilities for deficiency history, fine totals, and rating trends prior to partnership, acquisition, or referral.
- **Consumer guidance tools** -- surface quality and staffing data for families researching care options.
- **Competitive analysis** -- map competitor networks by chain affiliation, ownership, or geographic footprint.
- **Policy and advocacy research** -- examine staffing and quality disparities across ownership types or states.

---

### How to Use

Set the input fields and run the actor. Results are pushed to the Apify dataset and can be exported as JSON, CSV, or Excel.

#### Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `searchType` | string | `state` | `state`, `name` (facility name keyword), `rating` (minimum star rating), or `ccn` (direct lookup) |
| `state` | string | | Two-letter state code (e.g., `CA`, `TX`, `NY`, `FL`) |
| `facilityName` | string | | Partial facility name to search. Used with `name` search type |
| `minOverallRating` | integer | `0` | Minimum overall star rating (1-5). Used with `rating` search type |
| `ownershipType` | string | | Filter by `For profit`, `Non profit`, or `Government`. Leave empty for all |
| `ccn` | string | | CMS Certification Number for a direct facility lookup |
| `maxResults` | integer | `100` | Maximum facility records to return (1-15000) |

#### Example -- All Facilities in California

```json
{
  "searchType": "state",
  "state": "CA",
  "maxResults": 1500
}
````

#### Example -- 5-Star Facilities in Texas

```json
{
  "searchType": "rating",
  "state": "TX",
  "minOverallRating": 5,
  "maxResults": 500
}
```

#### Example -- For-Profit Facilities in New York

```json
{
  "searchType": "state",
  "state": "NY",
  "ownershipType": "For profit",
  "maxResults": 500
}
```

#### Example -- Direct Lookup by CCN

```json
{
  "searchType": "ccn",
  "ccn": "555038",
  "maxResults": 1
}
```

***

### Cost

- **Actor start fee:** ~$0.10 per run
- **Compute:** minimal -- typical runs complete in seconds to under a minute for large state queries
- **Data cost:** $0.005 per result

Pulling all 14,700+ facilities costs approximately $0.84 in data fees plus the start fee.

***

### Output Formats

Results are available in the Apify dataset viewer and can be exported as:

- JSON
- CSV
- Excel (XLSX)
- XML
- RSS

***

### FAQ

**Do I need a CMS account or API key?**
No. The CMS Care Compare API is fully public and requires no authentication.

**How often is the data updated?**
CMS updates Nursing Home Compare data quarterly. Health inspection and staffing data may update on different schedules.

**Can I retrieve all 14,700+ facilities in one run?**
Yes. Set `maxResults` to 15000 and use a broad search (e.g., by state without other filters, or multiple state runs). Each facility record costs $0.005.

**What is the CCN?**
The CMS Certification Number is the unique federal identifier for each nursing facility. It is used across CMS datasets and is stable across name changes.

**Does the data include chain/corporate affiliation?**
The output fields shown above represent the core CMS fields returned. Chain affiliation is available in the raw CMS dataset and may be present depending on CMS API response structure.

**What does the total fines field represent?**
`totalFinesInDollars` reflects the cumulative federal fines assessed against the facility through CMS enforcement actions. It does not include state-level penalties.

# Actor input Schema

## `searchType` (type: `string`):

How to search for nursing homes.

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

Two-letter state code (e.g. "CA", "TX", "NY", "FL"). Used for state and name searches.

## `facilityName` (type: `string`):

Facility name keyword to search for. Partial matches supported.

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

Minimum overall star rating (1-5). Only return facilities with this rating or higher.

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

Filter by ownership type.

## `ccn` (type: `string`):

Look up a specific facility by CMS Certification Number (e.g. "555038").

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

Maximum number of facility results to return.

## Actor input object example

```json
{
  "searchType": "state",
  "state": "CA",
  "facilityName": "",
  "minOverallRating": 0,
  "ownershipType": "",
  "ccn": "",
  "maxResults": 100
}
```

# 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 = {
    "searchType": "state",
    "state": "CA",
    "facilityName": "",
    "minOverallRating": 0,
    "ownershipType": "",
    "ccn": "",
    "maxResults": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("pink_comic/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 = {
    "searchType": "state",
    "state": "CA",
    "facilityName": "",
    "minOverallRating": 0,
    "ownershipType": "",
    "ccn": "",
    "maxResults": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("pink_comic/cms-nursing-home-compare").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 '{
  "searchType": "state",
  "state": "CA",
  "facilityName": "",
  "minOverallRating": 0,
  "ownershipType": "",
  "ccn": "",
  "maxResults": 100
}' |
apify call pink_comic/cms-nursing-home-compare --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "CMS Nursing Home - Ratings & Inspections",
        "description": "Search CMS Nursing Home Compare. Find nursing homes by name, city, or state with star ratings, inspections, and staffing. For eldercare consultants, healthcare investors, insurance analysts, and family caregivers. Pay per result.",
        "version": "0.1",
        "x-build-id": "u32nffm2odlhqHTxh"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/pink_comic~cms-nursing-home-compare/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-pink_comic-cms-nursing-home-compare",
                "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/pink_comic~cms-nursing-home-compare/runs": {
            "post": {
                "operationId": "runs-sync-pink_comic-cms-nursing-home-compare",
                "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/pink_comic~cms-nursing-home-compare/run-sync": {
            "post": {
                "operationId": "run-sync-pink_comic-cms-nursing-home-compare",
                "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": {
                    "searchType": {
                        "title": "Search Type",
                        "enum": [
                            "state",
                            "name",
                            "rating",
                            "ccn"
                        ],
                        "type": "string",
                        "description": "How to search for nursing homes.",
                        "default": "state"
                    },
                    "state": {
                        "title": "State",
                        "type": "string",
                        "description": "Two-letter state code (e.g. \"CA\", \"TX\", \"NY\", \"FL\"). Used for state and name searches.",
                        "default": "CA"
                    },
                    "facilityName": {
                        "title": "Facility Name",
                        "type": "string",
                        "description": "Facility name keyword to search for. Partial matches supported.",
                        "default": ""
                    },
                    "minOverallRating": {
                        "title": "Minimum Overall Rating",
                        "minimum": 0,
                        "maximum": 5,
                        "type": "integer",
                        "description": "Minimum overall star rating (1-5). Only return facilities with this rating or higher.",
                        "default": 0
                    },
                    "ownershipType": {
                        "title": "Ownership Type",
                        "enum": [
                            "",
                            "For profit",
                            "Non profit",
                            "Government"
                        ],
                        "type": "string",
                        "description": "Filter by ownership type.",
                        "default": ""
                    },
                    "ccn": {
                        "title": "CCN (CMS Certification Number)",
                        "type": "string",
                        "description": "Look up a specific facility by CMS Certification Number (e.g. \"555038\").",
                        "default": ""
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 15000,
                        "type": "integer",
                        "description": "Maximum number of facility results to return.",
                        "default": 100
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
