# CMS Medicare Facility Leads (`yanairon/cms-medicare-facility-leads`) Actor

Official CMS facility lists: home health, hospice, nursing homes, dialysis and certified ASCs. Phone/address where supplied, no email. Exact organizational-owner joins for home health/hospice with explicit coverage gaps. Dated snapshots, not alerts.

- **URL**: https://apify.com/yanairon/cms-medicare-facility-leads.md
- **Developed by:** [Yanai Ron](https://apify.com/yanairon) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 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.

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 Medicare Facility Leads

One facility lookup/export Actor for home health agencies, hospices, nursing homes, dialysis facilities and certified ambulatory surgical centers (ASCs). Uses official public CMS snapshots, without a CMS API key. No patient data. Price: $0.005 per output facility ($5 per 1,000).

### Input

```json
{
  "facilityTypes": ["hospice", "home_health"],
  "state": "AZ",
  "name": "hospice",
  "includeOwnership": true,
  "maxRecords": 100
}
```

- `facilityTypes`: any nonempty selection of `home_health`, `hospice`, `nursing_home`, `dialysis`, `asc`. Default: all five, in that order.
- `state`: optional two-letter state/territory code. `city`: optional exact city, case-insensitive.
- `name`: optional case-insensitive facility-name substring. `ccn`: optional exact CMS identifier, as a string to preserve leading zeroes. ASC IDs can contain letters.
- `includeOwnership`: default true. Enriches home health and hospice only.
- `maxRecords`: global output cap, 1-100,000, default 1,000. Types run in input order, not round-robin. The first type can fill the entire cap. Select a single type for a focused list.

One output item and one pricing event per facility-type + CCN. Hospice quality-measure rows are collapsed before output; owners and enrollment rows are nested and do not incur separate record events. CSV/JSON exports are available from the Apify dataset.

### Output

Each item includes `ccn`, `facilityType`, `businessName`, `phone`, `address`, `addressLine2`, `city`, `state`, `zip`, `county`, `country`, `ownershipType`, `legalBusinessName`, `chainName`, and available `starRating`, `certifiedBeds`, `dialysisStations`. Missing fields are null. Email is always null: none is sourced here. Star-rating scales and definitions differ by facility type; they are not comparable clinical advice.

Provenance includes `sourceUrl`, `sourceDownloadUrl`, `sourceModified` and, when available, `sourcePeriod`. CMS metadata modification dates are not a claim that each facility was checked on that date. No claim of real-time active status is made for the Provider Data Catalog lists. ASCs must be provider type 11 and have CMS status `Certified` in the iQIES snapshot.

For home health and hospice, `enrollments` preserves enrollment ID, NPI and legal business name. `organizationOwners` contains only organizational associates (`TYPE - OWNER = O`), with role, reported percentage and association date. A managerial-control relationship is not necessarily equity ownership, and percentages must not be summed across roles or enrollments. Private-equity/REIT flags mean CMS reported `Y`, not a verified negative when false. Individual owners, their names and all owner addresses are omitted. Facility registered contacts may still be residential or personal.

`ownershipStatus` makes gaps explicit:

- `matched_organization_owner`: exact CCN -> enrollment ID -> organizational associate match.
- `matched_enrollment_no_organization_owner`: matched enrollment but no organizational associate returned; this may mean individual-only ownership.
- `unmatched_ccn`: no matching enrollment in the ownership snapshot. No name-based guess is made.
- `not_available_for_type`: enrichment is not offered for this facility type.
- `not_requested`: enrichment disabled.

Ownership provenance includes its period, modification date and source URL. Different CMS source snapshots can disagree. This is a lookup/lead-list product, not an ownership certification, change alert, exhaustive facility directory, or permission to contact people.

### Sources and audit (2026-10-14)

| Type | Official source | Snapshot metadata modified | Facilities |
| --- | --- | --- | ---: |
| Home health | https://data.cms.gov/provider-data/dataset/6jpm-sxkc | 2026-05-27 | 12,460 |
| Hospice | https://data.cms.gov/provider-data/dataset/252m-zfp9 | 2026-08-07 | 6,669 |
| Nursing homes | https://data.cms.gov/provider-data/dataset/4pq5-n9py | 2026-09-30 | 14,690 |
| Dialysis | https://data.cms.gov/provider-data/dataset/23ew-n7w9 | 2026-06-16 | 7,490 |
| ASCs | https://data.cms.gov/provider-characteristics/hospitals-and-other-facilities/provider-of-services-file-internet-quality-improvement-and-evaluation-system | 2026-08-10, Q2 2026 | 6,640 |

Total: 47,949 facility-type/CCN records, not deduplicated across types. Hospice source: 453,492 measure rows collapsed to 6,669 facilities; no conflicting facility name/state/address found within CCN. Snapshot counts change and are not coverage guarantees.

Home health exact enrollment matches: 11,254/12,460; organizational associates: 4,460/12,460. Hospice: 5,696/6,669 and 3,007/6,669 respectively. These gaps are expected and visible in output, not silently filled.

Ownership and enrollment discovery: https://data.cms.gov/data.json . Select the latest snapshot period (not merely latest metadata modification) and require matching ownership/enrollment periods. Ownership snapshot: Q3 2026; owners modified 2026-08-19, enrollments 2026-07-27. These quarterly series have existed since 2023, not a new 2026 release.

- https://data.cms.gov/provider-characteristics/hospitals-and-other-facilities/home-health-agency-enrollments
- https://data.cms.gov/provider-characteristics/hospitals-and-other-facilities/home-health-agency-all-owners
- https://data.cms.gov/provider-characteristics/hospitals-and-other-facilities/hospice-enrollments
- https://data.cms.gov/provider-characteristics/hospitals-and-other-facilities/hospice-all-owners
- ASC code dictionary: https://data.cms.gov/sites/default/files/2026-07/iQIES%20POS%20Data%20Dictionary%20Jul2026.xlsx (Provider Type 11 = Ambulatory Surgical Center).

### Reliability and cost

Sources are resolved at runtime. CSV parsing is streamed, including the large iQIES roster, with explicit UTF-8/Windows-1252 decoding. Missing required headers, HTTP failures and mismatched ownership/enrollment periods fail the run instead of fabricating data. Up to three request attempts, each bounded to 180 seconds. Source interruption midway through a file fails rather than silently returning an incomplete list. Network/file scans can dominate the cost of small filtered requests; `maxRecords` caps output, not source scanning.

Unit tests are offline. Weekly/manual CI runs a small live smoke against all five types and real ownership joins. No persistent baseline, delta mode, scheduling or alerts. An Actor can be called through Apify's MCP integration after deployment; no separate MCPize listing or MCP server is published by this code.

```sh
npm ci
npm test
npm run smoke:cms
```

### Release status

Published on Apify Store on 2026-10-14 after offline tests, live source checks, one cloud build and five cloud smoke runs. Updates to cloud code are deployed from a tested source snapshot; this Actor has no automatic GitHub rebuild hook.

# Actor input Schema

## `facilityTypes` (type: `array`):

Types are processed in this order. The shared record cap can be filled by the first type. Select one type for a focused list.

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

Two-letter state or territory code. Optional.

## `city` (type: `string`):

Exact city name, case-insensitive. Optional.

## `name` (type: `string`):

Case-insensitive substring. Optional.

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

Exact CCN, preserving leading zeroes. ASC IDs may contain letters.

## `includeOwnership` (type: `boolean`):

Home health and hospice only. Joins by CCN and enrollment ID. Individual owner details and owner addresses are excluded. Does not imply full ownership coverage.

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

Global cap across selected types, not per type. One charge per facility, not per measure or owner.

## Actor input object example

```json
{
  "facilityTypes": [
    "home_health",
    "hospice",
    "nursing_home",
    "dialysis",
    "asc"
  ],
  "includeOwnership": true,
  "maxRecords": 1000
}
```

# Actor output Schema

## `records` (type: `string`):

CMS facilities with provenance, source date and optional organizational owners.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("yanairon/cms-medicare-facility-leads").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("yanairon/cms-medicare-facility-leads").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 '{}' |
apify call yanairon/cms-medicare-facility-leads --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,yanairon/cms-medicare-facility-leads"
        }
    }
}
```

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/vRGCRsVm8FUbVwmpE/builds/BCzOjh1BV589XWaK8/openapi.json
