# CMS Nursing Home Inspections, Ratings & Penalties (`kingly_contest_7cb/cms-nursing-home-inspections`) Actor

All ~14,700 Medicare/Medicaid nursing homes from the official CMS Provider Data API: star ratings, staffing, health inspection deficiencies with scope/severity, fines and payment denials. Filter by state, city or ZIP.

- **URL**: https://apify.com/kingly_contest_7cb/cms-nursing-home-inspections.md
- **Developed by:** [Carina Hatton](https://apify.com/kingly_contest_7cb) (community)
- **Categories:** Lead generation, Business, Open source
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 nursing homes

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

## CMS Nursing Home Inspections, Star Ratings & Penalties

Every Medicare and Medicaid certified nursing home in the US is inspected, rated and, when things go wrong, fined. CMS publishes all of it in its Provider Data Catalog, the same data behind Medicare Care Compare. But it's split across separate files that you have to join yourself. This Actor does the joining. You get one clean record per nursing home (ratings, staffing, fines, penalties and a deficiency summary), plus one record per cited deficiency if you want the detail.

It uses the **official CMS Provider Data API**. There's no page scraping, so the fields are stable and runs don't break when a website changes.

### What you get

**Nursing home records** (`record_type: "facility"`)

| Field group | Examples |
|---|---|
| Identity | CCN, provider name, legal business name, ownership type, chain name and size, date first certified |
| Location | street, city, state, ZIP, county, latitude/longitude, phone |
| Size | certified beds, average residents per day |
| Star ratings | overall, health inspection, quality measures (long and short stay), staffing |
| Staffing | nurse aide, LPN, RN and total nurse hours per resident per day, weekend hours, staff and RN turnover, administrators who left |
| Inspections | last standard survey date, cycle 1 deficiency counts, weighted health survey score, deficiency count, immediate jeopardy count, harm-or-worse count, complaint deficiencies, scope/severity breakdown |
| Enforcement | number of fines, total fines in dollars, payment denials, total penalties, plus a `penalties` list (date, type, amount, denial dates) |
| Flags | abuse icon, special focus status, changed ownership in the last 12 months, located in a hospital, CCRC |

**Deficiency records** (`record_type: "deficiency"`)

survey date, survey type, tag (e.g. `F0880`), category, CMS's standard requirement description, scope/severity code (A–L), immediate-jeopardy and actual-harm flags, correction status and date, inspection cycle, standard/complaint/infection-control flags, and IDR/IIDR status.

Every record carries a `source_url` (the facility's Medicare Care Compare page), a `dataset_url`, an attribution line and a timestamp. Dates are ISO (`YYYY-MM-DD`).

### Who it's for

- **Senior care placement and referral agencies** that need ratings and inspection history in one place
- **Healthcare sales teams** (pharmacy, staffing agencies, therapy providers, software vendors, consultants) building nursing home lead lists by state, chain, size or rating
- **Plaintiff and defense attorneys** researching a facility's citation and penalty history
- **Investors, lenders and M\&A teams** screening operators and chains
- **Journalists, researchers and advocates** tracking quality and enforcement

### Input

```json
{
  "states": ["TX", "OK"],
  "cities": [],
  "zipCodes": [],
  "includeFacilities": true,
  "includeDeficiencies": true,
  "includePenalties": true,
  "deficienciesSince": "2024-01-01",
  "maxOverallRating": 2,
  "maxFacilities": 0
}
```

- **states**: two-letter codes. Leave empty for every state, DC and the territories.
- **cities / zipCodes**: narrow to a market. Combine with `states`.
- **includeFacilities / includeDeficiencies**: choose one or both record types.
- **includePenalties**: nest each facility's fines and payment denials.
- **deficienciesSince**: keep only recent citations.
- **maxOverallRating**: e.g. `2` returns only 1 and 2 star homes, which is useful for consultants and attorneys.
- **maxFacilities**: cap for a quick sample.
- **requestDelaySecs**: pause between API calls. It's 10 seconds, as data.cms.gov's robots.txt asks.

### Output

A nursing home record (shortened):

```json
{
  "record_type": "facility",
  "ccn": "025025",
  "provider_name": "CENTENNIAL POST ACUTE",
  "city": "ANCHORAGE",
  "state": "AK",
  "certified_beds": 102,
  "chain_name": "PACS GROUP",
  "overall_rating": 1,
  "health_inspection_rating": 1,
  "staffing_rating": 4,
  "total_nurse_hours_per_resident_day": 4.5272,
  "total_nursing_staff_turnover_pct": 48.0,
  "last_standard_survey_date": "2025-12-24",
  "deficiency_count": 83,
  "immediate_jeopardy_count": 1,
  "severity_counts": {"D": 43, "E": 13, "F": 18, "G": 7, "J": 1},
  "total_fines_usd": 232502.0,
  "penalties": [{"penalty_date": "2025-12-24", "penalty_type": "Fine", "fine_amount_usd": 155753.0}],
  "source_url": "https://www.medicare.gov/care-compare/details/nursing-home/025025"
}
```

A deficiency record:

```json
{
  "record_type": "deficiency",
  "ccn": "025025",
  "provider_name": "CENTENNIAL POST ACUTE",
  "survey_date": "2025-12-24",
  "deficiency_tag": "F0865",
  "deficiency_category": "Administration Deficiencies",
  "deficiency_description": "Have a plan that describes the process for conducting QAPI and QAA activities.",
  "scope_severity_code": "F",
  "immediate_jeopardy": false,
  "complaint_survey": true,
  "correction_date": "2026-02-26"
}
```

The Console has two table views, **Nursing homes** and **Deficiencies**. Filter on `record_type` when you export.

### Pricing

Pay per result:

| Event | Price |
|---|---|
| Nursing home record | $0.003 |
| Deficiency record | $0.003 |

Some examples:

- Texas, facilities only (about 1,200 homes), costs about **$3.60**.
- One state with all deficiencies, for example Rhode Island (72 homes and about 2,000 citations), costs about **$6.20**.
- All 14,700 US nursing homes, facilities only, costs about **$44**.
- Everything, meaning every facility and all ~419,000 deficiencies, costs about **$1,300**. Use `deficienciesSince` or state filters to keep this smaller.

Set a maximum charge per run in Apify, and the Actor stops cleanly at your cap.

### Data sources and compliance

- [Provider Information](https://data.cms.gov/provider-data/dataset/4pq5-n9py)
- [Health Deficiencies](https://data.cms.gov/provider-data/dataset/r5ix-sfxw)
- [Penalties](https://data.cms.gov/provider-data/dataset/g6vv-u9sr)

This is US government open data from the Centers for Medicare & Medicaid Services. The Actor uses CMS's public datastore API with no login, one call at a time, and honors the 10 second crawl delay in data.cms.gov's robots.txt. The deficiency description is CMS's standard short wording for the regulation, not inspector narrative. No resident or staff personal data is collected. This dataset is not endorsed by CMS.

### Limits

- CMS refreshes these datasets about once a month. `cms_processing_date` tells you which release you have.
- CMS publishes roughly the last three standard survey cycles of health deficiencies. Fire-safety (life safety code) citations are a separate CMS dataset and aren't included yet.
- Ratings can be blank for new facilities or those with too little data. Blank stays `null` and is never shown as zero.
- With the polite 10 second delay, an all-states run with deficiencies takes about an hour. A single state takes a few minutes.

### Updates and support

Schedule a monthly run after the CMS refresh to keep your copy current. Questions or a field you'd like added? Use the Issues tab.

# Actor input Schema

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

Two-letter state codes (TX, FL, CA, also DC, PR, GU, VI). Leave empty for every state.

## `cities` (type: `array`):

Optional. Only nursing homes in these cities (matched case-insensitively against CMS's city field). Combine with States so the right state is used.

## `zipCodes` (type: `array`):

Optional. Only nursing homes in these 5-digit ZIP codes.

## `includeFacilities` (type: `boolean`):

One record per nursing home with star ratings, staffing, fines, a deficiency summary and nested penalties.

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

One record per cited health deficiency (tag, category, scope/severity, survey and correction dates).

## `includePenalties` (type: `boolean`):

Add each facility's CMS fines and payment denials as a list.

## `deficienciesSince` (type: `string`):

Optional. Only deficiencies with a survey date on or after this date. CMS publishes about the last three survey cycles.

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

Optional. Only nursing homes rated at or below this overall star rating (e.g. 2 for 1 and 2 star homes). Unrated homes are skipped when this is set.

## `maxFacilities` (type: `integer`):

Stop after this many nursing homes (their deficiencies are still included). 0 means no limit.

## `requestDelaySecs` (type: `number`):

Pause between calls to data.cms.gov. Its robots.txt asks for 10 seconds, which is the minimum.

## Actor input object example

```json
{
  "states": [
    "RI"
  ],
  "cities": [],
  "zipCodes": [],
  "includeFacilities": true,
  "includeDeficiencies": true,
  "includePenalties": true,
  "maxFacilities": 0,
  "requestDelaySecs": 10
}
```

# Actor output Schema

## `facilities` (type: `string`):

No description

## `deficiencies` (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": [
        "RI"
    ],
    "cities": [],
    "zipCodes": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("kingly_contest_7cb/cms-nursing-home-inspections").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": ["RI"],
    "cities": [],
    "zipCodes": [],
}

# Run the Actor and wait for it to finish
run = client.actor("kingly_contest_7cb/cms-nursing-home-inspections").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 '{
  "states": [
    "RI"
  ],
  "cities": [],
  "zipCodes": []
}' |
apify call kingly_contest_7cb/cms-nursing-home-inspections --silent --output-dataset

```

## MCP server setup

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

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/2NP1C168Pt39tAD1Z/builds/5z37OqV039rRnczDM/openapi.json
