# CMS Nursing Home Penalties with Facility Data (`thoob/cms-nursing-home-penalties-feed`) Actor

Returns CMS nursing home penalties (fines and payment denials) from data.cms.gov, newest first, each joined with facility star ratings, ownership, beds and chain. Filter by state, penalty type and start date. No key needed. Only delivered penalty rows are billed.

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

## Pricing

from $2.80 / 1,000 penalty records

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?

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 Penalties with Facility Data

This actor lists federal penalties (fines and payment denials) against US nursing homes from the CMS Provider Data Catalog, newest first. Each penalty is joined with facility data: star ratings, ownership, certified beds, chain and abuse icon. It is for journalists, researchers, compliance teams and families checking a facility.

### Input

```json
{
  "states": ["CA", "NY"],
  "penaltyType": "Fine",
  "since": "2024-01-01",
  "onlyNew": false,
  "maxRecords": 20
}
```

- `states`: two-letter codes, at most 50. Empty means all states.
- `penaltyType`: `Fine` or `Payment Denial`. Empty means both.
- `since`: earliest penalty date, `YYYY-MM-DD`.
- `onlyNew`: skip penalties delivered by earlier runs with this option on.
- `maxRecords`: cap on billed rows. 0 means no cap.

### Output

Illustration only, values are invented:

```json
{
  "ccn": "055001",
  "providerName": "EXAMPLE CARE CENTER",
  "address": "100 MAIN ST",
  "city": "SPRINGFIELD",
  "state": "CA",
  "zip": "90001",
  "penaltyDate": "2025-03-14",
  "penaltyType": "Fine",
  "fineId": "1",
  "fineAmount": 12500,
  "paymentDenialStartDate": null,
  "paymentDenialDays": null,
  "processingDate": "2025-06-01",
  "overallRating": 2,
  "healthInspectionRating": 1,
  "staffingRating": 3,
  "qualityMeasureRating": 4,
  "ownershipType": "For profit - Limited Liability company",
  "certifiedBeds": 99,
  "legalBusinessName": "EXAMPLE CARE LLC",
  "chainName": null,
  "abuseIcon": "N",
  "specialFocusStatus": null,
  "telephone": "5555550100",
  "sourceUrl": "https://data.cms.gov/provider-data/api/1/datastore/query/g6vv-u9sr/0?...",
  "providerSourceUrl": "https://data.cms.gov/provider-data/api/1/datastore/query/4pq5-n9py/0?...",
  "retrievedAt": "2025-07-01T12:00:00Z"
}
```

Empty source values are `null`. Facility fields are `null` when CMS returns no provider record for the CCN.

### Who uses it

- Compliance staff at senior care operators who track `fineAmount` and `paymentDenialDays` across competing facilities by `chainName` and `state`.
- Journalists who compare penalties with `overallRating`, `abuseIcon` and `specialFocusStatus`.
- Lenders and insurers who check a facility's penalty history by `ccn` before underwriting.
- Elder law attorneys who review a facility's `penaltyDate` and `penaltyType` records for a case.

### Pricing

Pay per event. Event `penalty-record` costs USD 0.004 per delivered penalty row, which is USD 4.00 per 1,000 rows. You are charged only for delivered penalty rows. The actor writes no other rows, so nothing else is billed.

### Limits

- CMS refreshes this data monthly, so the newest penalties are often weeks old.
- Requests to data.cms.gov are spaced at least 500 ms apart, and pages hold 50 penalties.
- If a request fails after retries, the run stops early, keeps rows already delivered and still succeeds.
- `onlyNew` remembers the newest 20,000 delivered penalties.
- Access to data.cms.gov from the Apify network is confirmed by the first platform run.

### FAQ

#### What input does it need?

No field is required. You can narrow results with `states`, `penaltyType` and a `since` date, and cap billed rows with `maxRecords`.

#### What does an empty result mean?

No penalty rows matched your filters. Searches with no match are not billed.

#### Can I run it on a schedule or through the API?

Yes. You can use Apify schedules or start runs through the Apify API. For repeat runs, `onlyNew` is meant to limit results to new penalties.

#### Can I check the original records?

Each row includes `sourceUrl` for the penalty and `providerSourceUrl` for the facility data, plus `retrievedAt`.

### Compliance

- Public sources only: the CMS Provider Data Catalog datasets Penalties (g6vv-u9sr) and Provider Information (4pq5-n9py).
- Documented public API endpoints only, no login, no key, no proxy.
- Every request sends an honest User-Agent: `PonoDataActors/1.0 (+https://ponodata.com)`.
- Values are copied from CMS as published. Every row carries the exact source URLs and the retrieval time.

# Actor input Schema

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

Two-letter state codes, for example CA or NY. Entries are trimmed and uppercased. Invalid entries and duplicates are dropped with a warning. At most 50 entries. Empty means all states.

## `penaltyType` (type: `string`):

Only return this penalty type. Empty means both types.

## `since` (type: `string`):

Only penalties on or after this date, as YYYY-MM-DD. Must be a real calendar date. Empty means no lower bound.

## `onlyNew` (type: `boolean`):

Deliver only penalties not delivered by an earlier run that had this option on. State is kept in the named key-value store cms-nursing-home-penalties-feed-seen.

## `maxRecords` (type: `integer`):

Cap on delivered, billed penalty rows. Also limits how many rows are fetched. 0 means no cap. The platform spend cap is honored regardless.

## Actor input object example

```json
{
  "onlyNew": false,
  "maxRecords": 20
}
```

# Actor output Schema

## `penalties` (type: `string`):

One row per penalty, newest first.

# 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 = {
    "onlyNew": false,
    "maxRecords": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("thoob/cms-nursing-home-penalties-feed").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 = {
    "onlyNew": False,
    "maxRecords": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("thoob/cms-nursing-home-penalties-feed").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 '{
  "onlyNew": false,
  "maxRecords": 20
}' |
apify call thoob/cms-nursing-home-penalties-feed --silent --output-dataset

```

## MCP server setup

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

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/pMs4jd7kHNcDmEZjF/builds/Ok4cFGrmAjVtDk074/openapi.json
