# CMS Hospice Scraper API - Care Compare Quality & Ratings (`pink_comic/cms-hospice-quality-care-compare`) Actor

Search CMS Hospice Provider Data by CCN, facility, geography, measure, score/footnote presence, and measurement period. Returns source-linked measure-level Care Compare evidence.

- **URL**: https://apify.com/pink\_comic/cms-hospice-quality-care-compare.md
- **Developed by:** [Ava Torres](https://apify.com/pink_comic) (community)
- **Categories:** Business, Education, 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 hospice care compare quality 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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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 Hospice Quality Care Compare Scraper API

Search the official, public, no-key **CMS Provider Data API Hospice - Provider Data** dataset (`252m-zfp9`) and return measure-level quality evidence for hospice comparison, provider research, and data QA.

### Deterministic first run

Empty input uses CCN `001500` for **AGAVE HOSPICE AND PALLIATIVE CARE** and returns at most five measure rows. Current source rows include `H_001_01_OBSERVED`, score text `100`, and measure range `07/01/2024-06/30/2025`.

```json
{
  "ccn": "001500",
  "maxResults": 5
}
````

Maximum default charge: **$0.0101** ($0.0001 start + up to 5 × $0.002/item).

### Search inputs

- exact six-digit `ccn`
- facility-name `query`
- exact `state` and `zipCode`, county keyword
- exact `measureCode` or `measureName` keyword
- `scorePresence` / `footnotePresence`: `ANY`, `PRESENT`, or `MISSING`
- `measurementFrom` / `measurementTo` (`YYYY-MM-DD`): require the measure period to fall within those boundaries
- sort by `measureCode`, `measureName`, `facilityName`, `score`, or `measureDateRange`
- `maxCandidates` (up to 5,000) bounds the source window; `maxResults` (up to 500) is a total output cap

Example research query:

```json
{
  "query": "HOSPICE",
  "state": "AZ",
  "measureName": "Treatment Preferences",
  "scorePresence": "PRESENT",
  "measurementFrom": "2024-07-01",
  "measurementTo": "2025-06-30",
  "maxCandidates": 500,
  "maxResults": 25
}
```

### Output and evidence boundaries

Each row preserves CCN, facility identity/contact/geography, CMS region, measure code/name, score **as source text**, footnote, date range, exact CMS query URL, retrieval time, filters, and candidate-bound disclosure. Suppressed, missing, or nonnumeric values are not changed to zero. Runs return explicit `FOUND`, `NO_MATCH`, or `SOURCE_UNAVAILABLE` evidence.

Care Compare measures are dated CMS quality evidence. They do **not** establish current service availability, patient-specific outcomes, accreditation, licensure, a comprehensive quality ranking, or medical advice. A bounded no-match is not proof of absence. Review the linked CMS query and current provider information before consequential use.

Source: `https://data.cms.gov/provider-data/api/1/datastore/query/252m-zfp9/0`

### Standalone

```bash
go run ./cmd/cms-hospice-quality-care-compare --ccn 001500 --max-results 5
```

# Actor input Schema

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

Exact six-digit CMS Certification Number. Clear when using broad search fields.

## `query` (type: `string`):

Case-insensitive hospice/facility name keyword.

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

Exact two-letter state code.

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

Exact five-digit ZIP code.

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

Case-insensitive county/parish keyword.

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

Exact CMS measure code, such as H\_001\_01\_OBSERVED.

## `measureName` (type: `string`):

Case-insensitive measure-name keyword.

## `scorePresence` (type: `string`):

Filter source score text presence without converting values.

## `footnotePresence` (type: `string`):

Filter source footnote presence.

## `measurementFrom` (type: `string`):

Require period start on/after YYYY-MM-DD.

## `measurementTo` (type: `string`):

Require period end on/before YYYY-MM-DD.

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

Local deterministic sorting.

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

Ascending or descending.

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

Bounded source rows checked before local keyword, presence, date, and sorting filters.

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

Total paid output cap; each item costs $0.002.

## Actor input object example

```json
{
  "ccn": "001500",
  "scorePresence": "",
  "footnotePresence": "",
  "sortBy": "sourceOrder",
  "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": "001500",
    "maxResults": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("pink_comic/cms-hospice-quality-care-compare").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": "001500",
    "maxResults": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("pink_comic/cms-hospice-quality-care-compare").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": "001500",
  "maxResults": 5
}' |
apify call pink_comic/cms-hospice-quality-care-compare --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "CMS Hospice Scraper API - Care Compare Quality & Ratings",
        "description": "Search CMS Hospice Provider Data by CCN, facility, geography, measure, score/footnote presence, and measurement period. Returns source-linked measure-level Care Compare evidence.",
        "version": "0.1",
        "x-build-id": "84ulbjiIjwzP8C4FC"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/pink_comic~cms-hospice-quality-care-compare/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-pink_comic-cms-hospice-quality-care-compare",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/pink_comic~cms-hospice-quality-care-compare/runs": {
            "post": {
                "operationId": "runs-sync-pink_comic-cms-hospice-quality-care-compare",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/pink_comic~cms-hospice-quality-care-compare/run-sync": {
            "post": {
                "operationId": "run-sync-pink_comic-cms-hospice-quality-care-compare",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "ccn": {
                        "title": "Exact CCN",
                        "pattern": "^$|^[0-9]{6}$",
                        "type": "string",
                        "description": "Exact six-digit CMS Certification Number. Clear when using broad search fields.",
                        "default": "001500"
                    },
                    "query": {
                        "title": "Facility Keyword",
                        "type": "string",
                        "description": "Case-insensitive hospice/facility name keyword."
                    },
                    "state": {
                        "title": "State",
                        "pattern": "^$|^[A-Za-z]{2}$",
                        "type": "string",
                        "description": "Exact two-letter state code."
                    },
                    "zipCode": {
                        "title": "ZIP Code",
                        "pattern": "^$|^[0-9]{5}$",
                        "type": "string",
                        "description": "Exact five-digit ZIP code."
                    },
                    "county": {
                        "title": "County Keyword",
                        "type": "string",
                        "description": "Case-insensitive county/parish keyword."
                    },
                    "measureCode": {
                        "title": "Measure Code",
                        "type": "string",
                        "description": "Exact CMS measure code, such as H_001_01_OBSERVED."
                    },
                    "measureName": {
                        "title": "Measure Name Keyword",
                        "type": "string",
                        "description": "Case-insensitive measure-name keyword."
                    },
                    "scorePresence": {
                        "title": "Score Presence",
                        "enum": [
                            "",
                            "ANY",
                            "PRESENT",
                            "MISSING"
                        ],
                        "type": "string",
                        "description": "Filter source score text presence without converting values.",
                        "default": ""
                    },
                    "footnotePresence": {
                        "title": "Footnote Presence",
                        "enum": [
                            "",
                            "ANY",
                            "PRESENT",
                            "MISSING"
                        ],
                        "type": "string",
                        "description": "Filter source footnote presence.",
                        "default": ""
                    },
                    "measurementFrom": {
                        "title": "Measurement Period From",
                        "pattern": "^$|^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                        "type": "string",
                        "description": "Require period start on/after YYYY-MM-DD."
                    },
                    "measurementTo": {
                        "title": "Measurement Period To",
                        "pattern": "^$|^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                        "type": "string",
                        "description": "Require period end on/before YYYY-MM-DD."
                    },
                    "sortBy": {
                        "title": "Sort By",
                        "enum": [
                            "sourceOrder",
                            "measureCode",
                            "measureName",
                            "facilityName",
                            "score",
                            "measureDateRange"
                        ],
                        "type": "string",
                        "description": "Local deterministic sorting.",
                        "default": "sourceOrder"
                    },
                    "sortDirection": {
                        "title": "Sort Direction",
                        "enum": [
                            "asc",
                            "desc"
                        ],
                        "type": "string",
                        "description": "Ascending or descending.",
                        "default": "asc"
                    },
                    "maxCandidates": {
                        "title": "Maximum Source Candidates",
                        "minimum": 1,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Bounded source rows checked before local keyword, presence, date, and sorting filters.",
                        "default": 100
                    },
                    "maxResults": {
                        "title": "Maximum Results",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Total paid output cap; each item costs $0.002.",
                        "default": 5
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
