# CMS Medicare Facility Enrollment Scraper — Hospitals & SNFs (`compute-edge/cms-facility-enrollment-scraper`) Actor

Extract Medicare-enrolled facility data from CMS: hospitals, skilled nursing facilities, hospices, home health agencies, FQHCs, and rural health clinics. Filter by state or organization name.

- **URL**: https://apify.com/compute-edge/cms-facility-enrollment-scraper.md
- **Developed by:** [Compute Edge](https://apify.com/compute-edge) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.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/platform/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

## Medicare Facility Enrollments Scraper — Hospitals, SNF, Hospice

Extract **Medicare-enrolled facility data** directly from the [CMS (Centers for Medicare & Medicaid Services) public API](https://data.cms.gov). This Actor retrieves enrollment records for **hospitals, skilled nursing facilities (SNFs), hospices, home health agencies (HHAs), federally qualified health centers (FQHCs), and rural health clinics (RHCs)** — all facilities that have formally enrolled in the Medicare program.

Every record includes the facility's **NPI (National Provider Identifier)**, **CCN (CMS Certification Number)**, legal organization name, DBA name, ownership structure, incorporation details, and full address. This is official government data, maintained by CMS under regulatory obligation, and updated regularly.

### Features

- **6 facility types**: hospitals, SNFs, hospices, HHAs, FQHCs, and rural health clinics
- **Filter by state**: pass a 2-letter state code to narrow results to one state
- **Filter by organization name**: partial, case-insensitive match against legal name and DBA
- **Configurable result cap**: from 1 to 100,000 records per run
- **No auth required**: pulls from CMS's public data API — no login, no API key
- **Structured output**: camelCase JSON ready for CRM import, RAG pipelines, or lead enrichment

#### Output Fields

| Field | Description |
|---|---|
| `organizationName` | Legal organization name on file with CMS |
| `doingBusinessAsName` | DBA / trade name |
| `facilityType` | Type as selected by user (e.g. `hospital`, `hospice`) |
| `enrollmentState` | State where facility enrolled in Medicare |
| `npi` | National Provider Identifier |
| `ccn` | CMS Certification Number |
| `providerTypeCode` | CMS internal provider type code |
| `providerTypeText` | Human-readable provider type |
| `incorporationDate` | Legal incorporation date |
| `incorporationState` | State of legal incorporation |
| `organizationTypeStructure` | LLC, Corporation, Partnership, etc. |
| `proprietaryNonprofit` | P = proprietary/for-profit, N = non-profit |
| `addressLine1` | Street address line 1 |
| `addressLine2` | Street address line 2 |
| `city` | City |
| `state` | Practice location state |
| `zipCode` | ZIP code |
| `associateId` | CMS Associate ID |
| `enrollmentId` | CMS Enrollment ID |

#### Who Needs This Data?

- **Medical device and supplies sales teams** building prospecting lists of hospitals, SNFs, and HHAs — every facility here is a potential buyer
- **Healthcare B2B SaaS companies** targeting verified Medicare-enrolled providers
- **Market research and consulting firms** mapping the healthcare supply chain by state or facility type
- **Revenue cycle and billing companies** that service Medicare providers and need verified CCN + NPI pairs
- **Healthcare real estate investors** tracking facility growth and ownership structures by region

### How to scrape Medicare facility enrollment data

1. **Open the Actor** in Apify Console and click "Try for free"
2. **Select a Facility Type** from the dropdown — choose `hospital`, `skilledNursingFacility`, `hospice`, `homeHealthAgency`, `fqhc`, or `ruralHealthClinic`
3. **Optionally filter by state** — enter a 2-letter state code (e.g. `TX`) in the State Filter field
4. **Optionally filter by name** — type a partial name in the Organization Name Filter (e.g. `Memorial` will match any facility with "Memorial" in its name or DBA)
5. **Set Max Results** — the default is 500. Set to 0 to retrieve all records (can be tens of thousands per facility type)
6. **Click Start** and wait for the run to complete
7. **Download your results** as JSON, CSV, or Excel from the Dataset tab

### Pricing

This Actor uses **per-result pricing** at **$0.003 per record** extracted. In addition to the per-result fee, you pay standard Apify compute costs for the run duration.

**Example cost estimates:**
- 500 hospital records: ~$1.50 in per-result fees
- 5,000 SNF records: ~$15.00 in per-result fees
- Filtered by state (e.g. all Texas hospitals): typically 200–600 records, ~$0.60–$1.80

Runs are fast — most requests complete in under 2 minutes. Memory usage is minimal (512 MB default).

### Input Example

```json
{
  "facilityType": "hospital",
  "state": "TX",
  "organizationName": "",
  "maxResults": 500
}
````

To pull all hospices nationwide:

```json
{
  "facilityType": "hospice",
  "state": "",
  "organizationName": "",
  "maxResults": 0
}
```

### Output Example

```json
{
  "facilityType": "hospital",
  "enrollmentId": "O20021004000000",
  "enrollmentState": "TX",
  "providerTypeCode": "00-09",
  "providerTypeText": "PART A PROVIDER - HOSPITAL",
  "npi": "1700805678",
  "multipleNpiFlag": "N",
  "ccn": "450833",
  "associateId": "8921915521",
  "organizationName": "PRHC ENNIS LP",
  "doingBusinessAsName": "ENNIS REGIONAL MEDICAL CENTER",
  "incorporationDate": "1999-08-05",
  "incorporationState": "TX",
  "organizationTypeStructure": "PARTNERSHIP",
  "organizationOtherTypeText": "",
  "proprietaryNonprofit": "P",
  "addressLine1": "2201 W LAMPASAS ST",
  "addressLine2": "",
  "city": "ENNIS",
  "state": "TX",
  "zipCode": "751195644",
  "practiceLocationType": "MAIN/PRIMARY HOSPITAL LOCATION",
  "locationOtherTypeText": "",
  "nursingHomeProviderName": "",
  "affiliationEntityName": "",
  "affiliationEntityId": ""
}
```

### Other Scrapers You May Like

- [CMS Hospital General Information Scraper](https://apify.com/compute-edge/cms-hospital-general-scraper) — Hospital quality ratings, bed counts, and ownership type
- [CMS Nursing Home Ratings Scraper](https://apify.com/compute-edge/cms-nursing-home-ratings-scraper) — Five-star ratings and inspection data for skilled nursing facilities
- [Medicare Provider Scraper](https://apify.com/compute-edge/medicare-provider-scraper) — Medicare participating provider directories
- [HRSA Health Centers Scraper](https://apify.com/compute-edge/hrsa-health-centers-scraper) — HRSA-funded community health centers and FQHCs

### FAQ

**Q: How often is the CMS enrollment data updated?**
A: CMS updates these datasets regularly (typically monthly). The data reflects current enrollment status as of the last CMS update.

**Q: How many records are available per facility type?**
A: Varies by type. Hospitals: ~10,000+. Skilled nursing facilities: ~15,000+. Hospices: ~6,000+. Home health agencies: ~11,000+. FQHCs: ~1,500+. Rural health clinics: ~5,000+.

**Q: Can I use the `state` filter and the `organizationName` filter together?**
A: Yes. State filtering is applied server-side (fast), and organization name filtering is applied client-side. Both filters can be combined.

**Q: What is a CCN?**
A: A CMS Certification Number (CCN) is a unique identifier assigned to each Medicare-certified provider. It is used in billing, certification, and quality reporting. Many downstream healthcare systems use CCN as the primary facility identifier.

**Q: What does the NPI number tell me?**
A: The National Provider Identifier (NPI) is a standard 10-digit identifier for healthcare providers used across all health insurance payers. Combined with CCN and address, it provides a complete identity anchor for healthcare CRM and data enrichment workflows.

**Q: Is this data free to access?**
A: The underlying CMS data is public and freely accessible via the CMS Data API. This Actor charges a per-result fee for the convenience of structured, filtered extraction without building your own pipeline.

### Legal Disclaimer

This Actor retrieves **publicly available, non-personal organizational data** published by the U.S. Centers for Medicare & Medicaid Services (CMS) under their public data initiative. All data is sourced from official government datasets (data.cms.gov) that are explicitly made available for public use.

The data contains only organizational/business information (facility names, addresses, CCNs, NPIs) — not personal health information (PHI) and not individual patient data. Use of this Actor is subject to CMS data use policies and Apify's Terms of Service.

For support or questions, contact the Actor author via the Apify platform.

# Actor input Schema

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

The type of Medicare-enrolled facility to retrieve. Defaults to 'hospital'.

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

Filter by 2-letter US state abbreviation (e.g. 'TX', 'CA'). Leave blank to include all states.

## `organizationName` (type: `string`):

Filter by organization name or DBA name (case-insensitive partial match). Example: 'Memorial' will match any facility with 'Memorial' in its name.

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

Maximum number of records to return. Set to 0 for unlimited (may be tens of thousands of records).

## Actor input object example

```json
{
  "facilityType": "hospital",
  "state": "",
  "organizationName": "",
  "maxResults": 500
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

# 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("compute-edge/cms-facility-enrollment-scraper").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("compute-edge/cms-facility-enrollment-scraper").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 '{}' |
apify call compute-edge/cms-facility-enrollment-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=compute-edge/cms-facility-enrollment-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "CMS Medicare Facility Enrollment Scraper — Hospitals & SNFs",
        "description": "Extract Medicare-enrolled facility data from CMS: hospitals, skilled nursing facilities, hospices, home health agencies, FQHCs, and rural health clinics. Filter by state or organization name.",
        "version": "0.1",
        "x-build-id": "2RVBnDTnpMdBL0Vxm"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/compute-edge~cms-facility-enrollment-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-compute-edge-cms-facility-enrollment-scraper",
                "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/compute-edge~cms-facility-enrollment-scraper/runs": {
            "post": {
                "operationId": "runs-sync-compute-edge-cms-facility-enrollment-scraper",
                "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/compute-edge~cms-facility-enrollment-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-compute-edge-cms-facility-enrollment-scraper",
                "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": {
                    "facilityType": {
                        "title": "Facility Type",
                        "enum": [
                            "hospital",
                            "skilledNursingFacility",
                            "hospice",
                            "homeHealthAgency",
                            "fqhc",
                            "ruralHealthClinic"
                        ],
                        "type": "string",
                        "description": "The type of Medicare-enrolled facility to retrieve. Defaults to 'hospital'.",
                        "default": "hospital"
                    },
                    "state": {
                        "title": "State Filter",
                        "type": "string",
                        "description": "Filter by 2-letter US state abbreviation (e.g. 'TX', 'CA'). Leave blank to include all states.",
                        "default": ""
                    },
                    "organizationName": {
                        "title": "Organization Name Filter",
                        "type": "string",
                        "description": "Filter by organization name or DBA name (case-insensitive partial match). Example: 'Memorial' will match any facility with 'Memorial' in its name.",
                        "default": ""
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 100000,
                        "type": "integer",
                        "description": "Maximum number of records to return. Set to 0 for unlimited (may be tens of thousands of records).",
                        "default": 500
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
