# Hospital & Nursing Home Star Ratings Export (`lepidata/care-ratings`) Actor

Export hospital overall star ratings and nursing home ratings (overall, health inspection, staffing, quality), staffing hours, inspections, fines and flags from US government public data. Filter by state, city, ZIP, name, rating or radius. Unofficial.

- **URL**: https://apify.com/lepidata/care-ratings.md
- **Developed by:** [Lepi Data](https://apify.com/lepidata) (community)
- **Categories:** Lead generation, Business
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.25 / 1,000 facility 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

## Hospital & Nursing Home Star Ratings Export

*Unofficial tool. Not affiliated with, endorsed by, or sponsored by any government agency. No government seals or logos are used. This product uses publicly available data from the U.S. Department of Health and Human Services; it is not endorsed by the U.S. Department of Health and Human Services or the Centers for Medicare & Medicaid Services.*

Export star ratings for every federally certified hospital and nursing home in the US, straight from the current public Provider Data Catalog files. It's for senior-care referral and placement sites, health-plan and provider-network tools, healthcare analysts, journalists and researchers.

**Input:** facility type (nursing homes, hospitals or both), states, certification numbers (CCNs), name words, cities, ZIP prefixes, minimum overall / staffing / health inspection rating, ownership, abuse-icon and Special Focus exclusions, hospital types, or a radius search around a point (nursing homes).

**Output:** one row per facility.

- Hospitals: overall star rating, hospital type, ownership, emergency services, birthing-friendly designation and the measure-group counts (mortality, safety, readmission, patient experience, timely and effective care) with better / no different / worse than national.
- Nursing homes: overall, health inspection, quality measure (long-stay and short-stay) and staffing ratings with footnotes; reported, case-mix and adjusted nurse staffing hours; staff turnover; inspection deficiency counts and scores; fines and payment denials; Special Focus status, abuse icon and ownership-change flags; chain id, size and chain averages; beds and residents per day; coordinates.

A provider's star rating on an individual measure or domain may not be reflective of that provider's overall star rating.

**Confirm on the official public comparison site** before relying on a rating. Ratings are refreshed by the source monthly (nursing homes) and quarterly (hospitals); each row carries the source file name and modified date.

### Input

- `facilityType`: `nursing_home` (default), `hospital` or `both`
- `states`, `ccns`, `nameContains` (facility name; every word must appear), `cities`, `zipPrefixes`
- `minOverallRating`, `minStaffingRating`, `minHealthInspectionRating` (1-5; unrated facilities are excluded when set)
- `ownership`: `any`, `for_profit`, `non_profit`, `government` (nursing homes)
- `excludeAbuseIcon`, `excludeSpecialFocus` (nursing homes)
- `hospitalTypes`: `acute`, `critical_access`, `childrens`, `va`, `dod`, `psychiatric`, `rural_emergency`, `long_term`
- `nearLat`, `nearLon`, `radiusMiles` (1-200, nursing homes only)
- `allStates`: set true to export every facility when no other filter is given
- `sortBy`: `name` (default), `rating` or `distance`; `maxResults` up to 20,000

### Output fields

`type`, `facility_type`, `ccn`, `name`, `legal_business_name` (only when it is a business or government entity name; otherwise null), `address`, `phone`, `location`, `distance_miles`, `overall_rating`, `overall_rating_footnote`, `hospital_type`, `ownership`, `emergency_services`, `birthing_friendly`, `measure_groups`, `ownership_type`, `provider_type`, `certified_beds`, `average_residents_per_day`, `chain`, `ratings`, `flags`, `staffing_hours_per_resident_day`, `turnover`, `inspections`, `penalties`, `processing_date`, `source`, `not_affiliated`, `source_dataset`, `rating_note`, `not_endorsed`, `confirm_at`

**Privacy.** Facility-level data only. The phone number is the facility's main line as published. You are responsible for your own CAN-SPAM, TCPA and do-not-call compliance when contacting any facility found here. The source's ownership file, which names individual owners and managers, is never read, chain names are not returned, and a legal business name is returned only when it carries a business or government entity marker, so no person names are returned. `nameContains` matches the facility name only.

**Opt-out.** Removal requests: support@lepidata.com (handled within 30 days).
Send the facility's CCN; removed facilities are dropped from every run.

Free status rows (not charged): `no-results`, `invalid-input`, `source-error`, `free-plan-limit`, `charge-limit-reached`.

**Example:** `{"facilityType":"nursing_home","states":["FL"],"minOverallRating":4,"excludeAbuseIcon":true,"sortBy":"rating","maxResults":500}`

### Not medical advice

Not medical advice and not a recommendation of any facility. Star ratings are one input; visit and ask questions before choosing care.

### Data source and compliance

- Source credit: US government public data, the Provider Data Catalog datasets "Hospital General Information" and "Provider Information" (nursing homes). Public domain. Each run downloads the current files: 2 requests per facility type, 10 seconds apart, a declared User-Agent with a contact address.
- Unofficial data: confirm on the official public comparison site.
- Free-plan accounts get up to 100 results per run.

**As published.** Star ratings, penalties, the abuse icon and the special-focus status are passed through verbatim, with the dataset dates on every row. This tool adds no rankings or labels of its own.

**Pricing.** Pay per result: $0.25 per 1,000 facilities ($0.00025 each), the same price on every plan, no start fee. Free status rows are never charged.

# Actor input Schema

## `facilityType` (type: `string`):

Which file to read.

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

2-letter state or territory codes, e.g. CA, NY.

## `ccns` (type: `array`):

6-character certification numbers, e.g. 050454. Give these to fetch specific facilities.

## `nameContains` (type: `array`):

Facility-name queries; a facility matches when every word appears in its facility name.

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

City names (exact, case-insensitive).

## `zipPrefixes` (type: `array`):

3-5 digit ZIP prefixes, e.g. 940 or 94110.

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

1-5 stars. Unrated facilities are excluded when set.

## `minStaffingRating` (type: `integer`):

1-5 stars.

## `minHealthInspectionRating` (type: `integer`):

1-5 stars.

## `ownership` (type: `string`):

Ownership category.

## `excludeAbuseIcon` (type: `boolean`):

Drop homes flagged with the abuse icon.

## `excludeSpecialFocus` (type: `boolean`):

Drop homes with a Special Focus status (facility or candidate).

## `hospitalTypes` (type: `array`):

Limit hospitals to these types.

## `nearLat` (type: `string`):

Decimal degrees, e.g. 41.82. Use with nearLon for a radius search.

## `nearLon` (type: `string`):

Decimal degrees, e.g. -71.41.

## `radiusMiles` (type: `integer`):

Radius search distance.

## `allStates` (type: `boolean`):

Required when no state, CCN, name or radius is given.

## `sortBy` (type: `string`):

distance needs a radius search.

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

Paid rows cap for this run.

## Actor input object example

```json
{
  "facilityType": "nursing_home",
  "states": [
    "RI"
  ],
  "ownership": "any",
  "excludeAbuseIcon": false,
  "excludeSpecialFocus": false,
  "radiusMiles": 10,
  "allStates": false,
  "sortBy": "name",
  "maxResults": 1000
}
```

# Actor output Schema

## `items` (type: `string`):

All rows from this run.

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

// Run the Actor and wait for it to finish
const run = await client.actor("lepidata/care-ratings").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"] }

# Run the Actor and wait for it to finish
run = client.actor("lepidata/care-ratings").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"
  ]
}' |
apify call lepidata/care-ratings --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lepidata/care-ratings"
        }
    }
}
```

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/QcMgbdq6sGBdta3mR/builds/sW4H2oWMVNhHu1aqD/openapi.json
