# Nursing Home Inspection & Ratings Scraper (`spry_frame/nursing-home-inspection-scraper`) Actor

Pulls CMS Care Compare data for Medicare/Medicaid-certified nursing homes by state — star ratings, staffing levels and turnover, ownership/chain info, fines and penalties, and health-inspection deficiency citations. No API key required.

- **URL**: https://apify.com/spry\_frame/nursing-home-inspection-scraper.md
- **Developed by:** [COSENT GROUP](https://apify.com/spry_frame) (community)
- **Categories:** Lead generation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.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/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

## Nursing Home Inspection & Ratings Scraper

Pulls CMS Care Compare data for every Medicare/Medicaid-certified nursing home in a state:
overall 5-star rating and sub-ratings (health inspection, staffing, quality measures),
staffing hours and turnover, ownership/chain info, fines and penalties, and full
health-inspection deficiency citation history.

No API key required. Uses CMS's public, open Provider Data Catalog API
(`data.cms.gov/provider-data`) directly — no scraping, no browser, no rate-limit fights.

### Use Cases

- **Senior living investment due diligence** — screen facilities by star rating, staffing
  turnover, and fine history before acquisition or lending decisions
- **Broker/M\&A deal sourcing** — pull every facility in a target state or chain for
  market mapping
- **Compliance & risk monitoring** — track abuse-icon flags, Special Focus Facility status,
  and recent deficiency citations across a portfolio
- **Healthcare consulting research** — compare staffing ratios and turnover across chains
  or regions
- **Family/advocacy research** — find lower-rated facilities in an area worth flagging

### Input

| Field | Type | Description |
|-------|------|-------------|
| `state` | String | **Required.** Two-letter US state code, e.g. `TX`, `CA`, `FL`. One state per run — run it again with a different code for another state. |
| `includeDeficiencies` | Boolean | Attach each facility's health-inspection citation history (survey date, tag, description, scope/severity, correction status). Default `true`. |
| `includeOwnership` | Boolean | Attach each facility's reported owners/operators (name, role, ownership %, association date). Default `true`. |
| `ratingAtMost` | Integer | Only return facilities with an overall star rating at or below this value (1-5). Leave blank for all. |
| `maxResults` | Integer | Maximum facilities to return. `0` = no limit (default). |

### Output

One record per facility, including:

| Field | Description |
|-------|-------------|
| `ccn` | CMS Certification Number — unique facility identifier |
| `providerName`, `address`, `city`, `state`, `zipCode`, `county`, `phone` | Location/contact |
| `ownershipType`, `chainName`, `numberOfFacilitiesInChain` | Ownership structure |
| `overallRating`, `healthInspectionRating`, `staffingRating`, `qmRating` | CMS 5-star ratings |
| `rnStaffingHoursPerResidentPerDay`, `totalNurseStaffingHoursPerResidentPerDay` | Staffing levels |
| `totalNursingStaffTurnoverPct`, `registeredNurseTurnoverPct` | Annual turnover |
| `abuseIcon`, `specialFocusStatus` | Risk flags |
| `numberOfFines`, `totalFinesAmount`, `numberOfPaymentDenials`, `totalNumberOfPenalties` | Penalty history |
| `healthDeficiencies` | Array of inspection citations (if `includeDeficiencies`), newest first |
| `owners` | Array of ownership records (if `includeOwnership`) |
| `latitude`, `longitude` | Geocoordinates |
| `scrapedAt` | Timestamp when the record was collected |

### Example Input

**All Texas facilities, full detail:**

```json
{
  "state": "TX",
  "includeDeficiencies": true,
  "includeOwnership": true
}
```

**Only 1-2 star facilities in Florida (risk screening):**

```json
{
  "state": "FL",
  "ratingAtMost": 2
}
```

### Notes

- Data source: [CMS Provider Data Catalog](https://data.cms.gov/provider-data/topics/nursing-homes)
  (Provider Information, Health Deficiencies, and Ownership datasets), refreshed periodically
  by CMS — the `processingDate` field on each record reflects the underlying dataset's
  last update.
- No API key, no rate limit encountered in testing; a small delay is built in between
  paginated requests as good API citizenship.
- Nationwide coverage = run once per state (50 runs), not a single combined run.
- Only "unique competitor with zero direct Apify Store matches found" as of 2026-08-22 — see
  `../MAINTENANCE_PLAN.md` and `../README.md` for portfolio-wide context.

# Actor input Schema

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

Two-letter US state code (e.g. TX, CA, FL). One state per run.

## `includeDeficiencies` (type: `boolean`):

Attach each facility's health-inspection citation history (survey date, deficiency tag, description, scope/severity, correction status) from the CMS Health Deficiencies dataset.

## `includeOwnership` (type: `boolean`):

Attach each facility's reported owners/operators (name, role, ownership %, association date) from the CMS Ownership dataset.

## `ratingAtMost` (type: `integer`):

Only return facilities with an overall CMS star rating at or below this value (1-5). Useful for screening for lower-rated facilities. Leave blank for all ratings.

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

Maximum number of facilities to return. 0 = no limit (all facilities in the state).

## Actor input object example

```json
{
  "state": "TX",
  "includeDeficiencies": true,
  "includeOwnership": true,
  "maxResults": 0
}
```

# Actor output Schema

## `providerName` (type: `string`):

Facility name.

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

CMS Certification Number — unique facility identifier.

## `address` (type: `string`):

Street address.

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

City.

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

State.

## `zipCode` (type: `string`):

ZIP code.

## `overallRating` (type: `string`):

CMS overall 5-star rating.

## `healthInspectionRating` (type: `string`):

CMS health inspection sub-rating.

## `staffingRating` (type: `string`):

CMS staffing sub-rating.

## `qmRating` (type: `string`):

CMS quality measure sub-rating.

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

For-profit, non-profit, or government ownership category.

## `chainName` (type: `string`):

Parent chain, if part of one.

## `totalNursingStaffTurnoverPct` (type: `string`):

Annual total nursing staff turnover percentage.

## `totalFinesAmount` (type: `string`):

Total dollar amount of CMS fines.

## `abuseIcon` (type: `string`):

Y/N — flagged for abuse citation.

## `specialFocusStatus` (type: `string`):

CMS Special Focus Facility program status, if applicable.

## `healthDeficiencies` (type: `string`):

Health inspection citation history, if requested (array in the actual dataset record).

## `owners` (type: `string`):

Ownership records, if requested (array in the actual dataset record).

## `scrapedAt` (type: `string`):

ISO timestamp when this record was collected.

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

// Run the Actor and wait for it to finish
const run = await client.actor("spry_frame/nursing-home-inspection-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 = { "state": "TX" }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,spry_frame/nursing-home-inspection-scraper"
        }
    }
}

```

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/Js1Q36d6VuT08tldL/builds/CctoTOXB4oHJcfMg5/openapi.json
