# CMS IRF Compare Quality Evidence Scraper API (`pink_comic/cms-inpatient-rehabilitation-quality`) Actor

Search CMS Inpatient Rehabilitation Facility Provider Data by CCN, provider, geography, measure, score, footnote, and dates. Export source-linked measure-level IRF Compare evidence with explicit historical-period and interpretation limits.

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

## Pricing

from $2.00 / 1,000 cms irf compare quality evidence scraper api evidence items

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 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

## CMS Inpatient Rehabilitation Facility Quality Scraper API

Search the **CMS Provider Data API — Inpatient Rehabilitation Facility - Provider Data** dataset (`v9e4-nwhh`) and receive one source-linked row per IRF Compare measure. Use it for facility research, historical quality-measure review, and reproducible CMS evidence exports.

### Deterministic first run

Empty input uses CCN `013025` for **ENCOMPASS HEALTH LAKESHORE REHABILITATION HOSPITAL** and returns at most five rows. The expected first measures include `I_006_01_CI_LOWER`, `I_006_01_CI_UPPER`, and `I_006_01_COMP_PERF`.

```json
{}
```

Up to **$0.0101**: $0.0001 start + 5 × $0.002/item.

### Inputs

```json
{
  "ccn": "013025",
  "measureCode": "I_006_01_COMP_PERF",
  "maxResults": 1,
  "maxCandidates": 100
}
```

Also supports `providerKeyword`, two-letter `state`, `zipCode`, `county`, `scoreKeyword`, `footnotePresent`, `startMeasurementDate` / `endMeasurementDate` (`YYYY-MM-DD`), and measure-code sort direction. `maxResults` is a total response cap (1–500); `maxCandidates` bounds source scanning (up to 5,000). Apify charge limits can reduce the result cap before the CMS request. Output is persisted in batches of at most 100 items.

### Evidence model

Every run emits `FOUND`, `NO_MATCH`, or `SOURCE_UNAVAILABLE`, with dataset ID, exact official query URL, UTC retrieval time, filter/default disclosure, candidate counts, and bounds. Source score text is preserved. Numeric, comparison-text, unavailable, and suppressed scores remain distinguishable; footnotes and measurement dates are retained.

### Important limits

CMS IRF Compare measures cover specific historical measurement periods. They are **not** real-time capacity data, accreditation or licensure proof, patient-specific prognosis, a complete quality assessment, benchmark interpretation beyond CMS text, or medical advice. A no-match result applies only to the checked dataset and bounded candidate set. Review CMS measure definitions, footnotes, and current facility information before consequential use.

Source: `https://data.cms.gov/provider-data/api/1/datastore/query/v9e4-nwhh/0` (public, no key).

# Actor input Schema

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

Exact six-character CMS Certification Number.

## `providerKeyword` (type: `string`):

Case-insensitive provider-name substring; applied within the bounded source candidate set.

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

Exact two-letter state code.

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

Exact five-digit ZIP or ZIP+4.

## `county` (type: `string`):

Case-insensitive county/parish substring.

## `measureCode` (type: `string`):

Exact CMS measure code, for example I\_006\_01\_COMP\_PERF.

## `scoreKeyword` (type: `string`):

Case-insensitive substring in CMS source score text, including comparison wording.

## `footnotePresent` (type: `boolean`):

When set, require a substantive CMS footnote (true) or no substantive footnote (false).

## `startMeasurementDate` (type: `string`):

Require measure period start on or after this YYYY-MM-DD date.

## `endMeasurementDate` (type: `string`):

Require measure period end on or before this YYYY-MM-DD date.

## `sortDirection` (type: `string`):

Sort matched measure codes ascending or descending.

## `maxCandidates` (type: `integer`):

Hard bound on source rows retrieved before local text/date/footnote filtering.

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

Total output cap; empty/default input is capped at five rows.

## Actor input object example

```json
{
  "ccn": "013025",
  "sortDirection": "asc",
  "maxCandidates": 100,
  "maxResults": 5
}
```

# 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 = {
    "ccn": "013025",
    "sortDirection": "asc",
    "maxCandidates": 100,
    "maxResults": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("pink_comic/cms-inpatient-rehabilitation-quality").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 = {
    "ccn": "013025",
    "sortDirection": "asc",
    "maxCandidates": 100,
    "maxResults": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("pink_comic/cms-inpatient-rehabilitation-quality").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 '{
  "ccn": "013025",
  "sortDirection": "asc",
  "maxCandidates": 100,
  "maxResults": 5
}' |
apify call pink_comic/cms-inpatient-rehabilitation-quality --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/EMdRJj94CbGuTQVOx/builds/i5HssSjdtZb4tUAJL/openapi.json
