# US Healthcare Facility Leads Scraper (CMS) (`scrapesage/us-healthcare-facility-leads-scraper`) Actor

Scrape every US Medicare-certified healthcare facility from the official CMS Provider of Services files: hospitals, ASCs, dialysis, skilled nursing, home health, hospice, rural health clinics & FQHCs. Name, phone, address, beds, services, ownership + lead score. Filter & monitor.

- **URL**: https://apify.com/scrapesage/us-healthcare-facility-leads-scraper.md
- **Developed by:** [Scrape Sage](https://apify.com/scrapesage) (community)
- **Categories:** Lead generation, Agents, Integrations
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.31 / 1,000 healthcare 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/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

## US Healthcare Facility Leads Scraper — Hospitals, ASCs, Dialysis, Clinics & More (CMS)

Turn the two official **CMS Provider of Services (POS)** files into one clean, ready-to-contact **B2B lead list of every Medicare-certified healthcare facility in the United States** — **hospitals, ambulatory surgery centers (ASCs), dialysis/ESRD facilities, skilled nursing, home health, hospice, rural health clinics, federally qualified health centers (FQHCs), community mental health centers, rehab agencies, outpatient therapy, ICF/IID and organ procurement organizations.**

Every record carries the firmographics that matter for selling **into** healthcare: **facility name, phone, fax, full address + county + geo, facility category & subtype, ownership type, certified & total bed counts (with a breakdown by unit), operating/procedure rooms, dialysis stations, the service lines each facility offers, surgical specialties, staffing counts, accreditation, certification & ownership-change dates, health-system network affiliations, compliance status — and a 0–100 lead score.**

No login, no cookies, no browser, no API key — fast JSON extraction straight from the government's own data API, with **monitoring mode** for an only-new feed and the **full raw CMS row (up to 473 fields)** attached to every record.

### Why this healthcare facility scraper?

Most "healthcare" scrapers are thin Google-Maps email grabbers, single-endpoint NPI lookups, or consumer-facing Care Compare quality clones. This actor unifies **both** official CMS POS files into the **richest facility lead record in the category**:

| Data | Typical scrapers | This actor |
|---|---|---|
| Every Medicare-certified facility type in one schema | ❌ one type | ✅ 15+ categories unified |
| Phone & fax | partial | ✅ ~99% phone |
| Facility category **and** subtype (e.g. Critical Access, Children's, Psychiatric) | ❌ | ✅ |
| Certified & total **bed counts** + per-unit breakdown | ❌ | ✅ |
| Operating rooms, procedure rooms, dialysis stations | ❌ | ✅ |
| **Service lines** offered (CT, MRI, PET, cardiac cath, ER, ICU, chemo, dialysis…) | ❌ | ✅ |
| ASC **surgical specialties** (orthopedic, ophthalmology, GI, pain…) | ❌ | ✅ |
| Ownership type (for-profit / non-profit / government / physician) | partial | ✅ |
| **Health-system network** affiliations | ❌ | ✅ |
| New-facility, ownership-change & accreditation signals | ❌ | ✅ |
| Lead score (0–100) per facility | ❌ | ✅ |
| Full raw CMS row (up to 473 fields) | ❌ | ✅ |
| Monitoring mode (only new / changed) | ❌ | ✅ |

### Use cases

- **Sell into hospitals & ASCs** — medical devices, capital equipment, surgical supplies, sterilization, imaging, anesthesia & locum staffing, RCM/EHR software, GPOs, construction & facilities services. Target by `beds`, `operatingRooms`, `serviceLines` and `facilityCategory`.
- **Dialysis & renal** — reach every ESRD facility by `dialysisStations` and network for supplies, water treatment, pharma and staffing.
- **M\&A / private equity** — find roll-up targets by `ownershipCategory: forProfit`, recent `changeOfOwnershipCount`, and health-system network size; spot newly-certified facilities early.
- **Healthcare SaaS & RCM** — prospect skilled nursing, home health, hospice, FQHCs and rural health clinics by state, beds and service mix.
- **Compliance, accreditation & consulting** — filter by accreditation status, compliance status and certification dates.
- **Market & territory intelligence** — map facility density, ownership mix, bed capacity and service availability by state, county or CBSA.

### How to use

1. [Sign up for Apify](https://console.apify.com/sign-up) — the free plan is enough to try this actor.
2. Open the **US Healthcare Facility Leads Scraper**, choose your **states** and (optionally) **facility categories**, then click **Start**.
3. Watch results stream into the dataset table.
4. **Export** as JSON, CSV, Excel, XML, or RSS — or pull results programmatically via the [Apify API](https://docs.apify.com/api/v2).

### Input

```json
{
    "states": ["TX", "CA"],
    "facilityCategories": ["hospital", "ambulatorySurgery", "dialysis"],
    "ownershipTypes": ["forProfit"],
    "minBeds": 50,
    "serviceLines": ["MRI", "Cardiac Catheterization"],
    "withPhoneOnly": true,
    "sortBy": "leadScore",
    "maxResults": 1000
}
```

- **states** — two-letter codes (e.g. `["CA","TX"]`). Leave empty for all 50 states + DC (territories `PR`, `GU`, `VI`, `AS`, `MP` supported).
- **facilityCategories** — `hospital`, `ambulatorySurgery`, `dialysis`, `skilledNursing`, `nursingFacility`, `icfIid`, `homeHealth`, `hospice`, `ruralHealthClinic`, `fqhc`, `communityMentalHealth`, `comprehensiveRehab`, `outpatientTherapy`, `portableXray`, `organProcurement`, `psychResidential`. Leave empty for all.
- **hospitalSubtypes** — narrow hospitals to `shortTerm`, `longTerm`, `psychiatric`, `rehabilitation`, `childrens`, `criticalAccess`, `transplant`, `ruralEmergency`.
- **ownershipTypes** — `forProfit`, `nonProfit`, `government`, `physician`, `other`.
- **serviceLines** — keep only facilities offering ALL of these (substring match, e.g. `["MRI","CT Scan"]`, `["Chemotherapy"]`, `["Emergency"]`, `["Dialysis"]`).
- **minBeds / maxBeds / bedSizeTiers** — size targeting (`small`, `medium`, `large`, `veryLarge`).
- **cities / counties / zipCodes / nameQuery** — geographic & name filters.
- **ccnNumbers** — look up specific facilities by CMS Certification Number (e.g. `["450002"]`).
- **activeOnly** *(default true)* — only currently-certified facilities. **withPhoneOnly** — drop facilities without a phone.
- **newlyCertifiedWithinDays / ownershipChangedWithinDays** — intent windows for brand-new facilities and recent M\&A.
- **includeQies / includeIqies** *(default true)* — toggle the two source files (QIES = hospitals/RHCs/FQHCs/CMHCs; iQIES = SNF/home health/hospice/dialysis/ASC…).
- **sortBy** — `leadScore`, `bedsHigh`, `newest`, `name`, `source`.
- **maxResults / maxResultsPerState / deduplicateResults / includeRawFields**.
- **monitorMode / monitorKey** — see *Monitoring mode* below.

### Output

One record per facility (`recordType: "facility"`):

```json
{
    "recordType": "facility",
    "ccn": "450002",
    "facilityName": "The Hospitals Of Providence Memorial Campus",
    "facilityCategory": "Hospital",
    "facilityCategoryCode": "hospital",
    "facilitySubtype": "Short-Term (Acute Care)",
    "phone": "(915) 577-6011",
    "fax": null,
    "hasPhone": true,
    "street": "2001 N Oregon St",
    "city": "El Paso",
    "state": "TX",
    "stateName": "Texas",
    "zip": "79902",
    "county": "El Paso",
    "fullAddress": "2001 N Oregon St, El Paso, TX, 79902",
    "isUrban": true,
    "cmsRegion": "Dallas",
    "ownershipType": "Proprietary (For-Profit)",
    "ownershipCategory": "forProfit",
    "isForProfit": true,
    "status": "active",
    "isActive": true,
    "totalBeds": 486,
    "certifiedBeds": 486,
    "beds": 486,
    "bedSizeTier": "veryLarge",
    "operatingRooms": 12,
    "dialysisStations": null,
    "serviceLines": ["Pharmacy", "Clinical Laboratory", "Diagnostic Radiology", "CT Scan", "MRI", "Nuclear Medicine", "Cardiac Catheterization", "Open Heart Surgery", "Chemotherapy / Oncology", "Emergency Department", "Intensive Care Unit"],
    "serviceLineCount": 41,
    "surgicalSpecialties": [],
    "staffing": { "registeredNurses": 286.5 },
    "isAccredited": true,
    "accreditationExpirationDate": "2027-04-26",
    "isPartOfHealthSystem": true,
    "networkAffiliations": { "hospitals": 5 },
    "certificationDate": "2024-04-25",
    "originalParticipationDate": "1966-07-01",
    "facilityAgeYears": 59.9,
    "isNewlyCertified": false,
    "changeOfOwnershipCount": 1,
    "complianceStatus": "In compliance",
    "leadScore": 89,
    "leadSignals": ["Hospital — Short-Term (Acute Care)", "486 beds (very large)", "12 operating room(s)", "41 service lines", "Accredited", "Health-system network (5 affiliated)"],
    "sourceSystem": "qies",
    "sourceDataset": "CMS Provider of Services File - Hospitals, RHCs, FQHCs & CMHCs (QIES)",
    "dataQuarter": "2026-04-15",
    "scrapedAt": "2026-06-21T05:27:00.000Z",
    "sourceFields": { "PRVDR_NUM": "450002", "BED_CNT": "486", "...": "all original CMS columns" }
}
```

### Monitoring mode (only new / changed)

Set `monitorMode: true` (with an optional `monitorKey`) and the actor returns only facilities that are **new** or whose certification, status, beds or ownership **changed** since the last run with the same key. It remembers what it has emitted in a tiny key-value store, so each run hands you a clean only-new feed — ideal for catching newly-certified facilities and ownership changes every quarter.

This is fully **complementary to [Apify Schedules](https://docs.apify.com/platform/schedules)**: schedule the run (e.g. weekly or monthly) and turn on monitoring mode to receive only the deltas each time. They don't conflict — the schedule decides *when* the actor runs, monitoring mode decides *what* it returns.

### Automate & schedule

Run this actor on autopilot and pull results into your own stack:

- **[Apify API](https://docs.apify.com/api/v2)** — start runs, fetch datasets, and manage schedules over REST.
- **[apify-client for JavaScript](https://docs.apify.com/api/client/js/)** and **[apify-client for Python](https://docs.apify.com/api/client/python/)** — official SDKs.
- **[Schedules](https://docs.apify.com/platform/schedules)** — run it monthly/quarterly with `monitorMode` to capture every newly-certified facility automatically.
- **[Webhooks](https://docs.apify.com/platform/integrations/webhooks)** — trigger downstream actions (CRM import, Slack alert, email sequence) the moment a run finishes.

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'MY_APIFY_TOKEN' });

const run = await client.actor('scrapesage/us-healthcare-facility-leads-scraper').call({
    states: ['TX'],
    facilityCategories: ['hospital', 'ambulatorySurgery'],
    minBeds: 50,
    sortBy: 'leadScore',
    maxResults: 1000,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Got ${items.length} healthcare facility leads`);
```

### Integrate with any app

Connect the dataset to 5,000+ apps — no code required:

- **[Make](https://docs.apify.com/platform/integrations/make)** — multi-step automation scenarios.
- **[Zapier](https://docs.apify.com/platform/integrations/zapier)** — push new facility leads straight into your CRM.
- **[Slack](https://docs.apify.com/platform/integrations/slack)** — get notified when a monitored search finds new facilities.
- **[Google Drive / Sheets](https://docs.apify.com/platform/integrations/drive)** — auto-export every run to a spreadsheet.
- **[Airbyte](https://docs.apify.com/platform/integrations/airbyte)** — pipe results into your data warehouse.
- **[GitHub](https://docs.apify.com/platform/integrations/github)** — trigger runs from commits or releases.

### Use with AI assistants (MCP)

The output is clean, LLM-ready JSON. You can call this actor from Claude, ChatGPT, or any agent framework through the **[Apify MCP server](https://docs.apify.com/platform/integrations/mcp)** — ask your assistant to "find for-profit ambulatory surgery centers in Texas with an MRI and contact details" and let it run this scraper for you.

### Agent-ready: autonomous payments (x402 & Skyfire)

This actor is **agent-ready** — AI agents can discover it, run it, and **pay for it autonomously**, with no Apify account and no human in the loop. It uses [pay-per-event](https://docs.apify.com/platform/actors/publishing/monetize/pay-per-event) pricing and [limited permissions](https://docs.apify.com/platform/actors/development/permissions), so it qualifies for Apify's agentic-payment standards:

- **[x402](https://docs.apify.com/platform/integrations/x402)** — an open, HTTP-native payment protocol. Agents pay per run in USDC on the Base network directly through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp) — no account, no API key.
- **[Skyfire](https://docs.apify.com/platform/integrations/skyfire)** — agent-to-service payments for fully autonomous AI-agent workflows.

Building an AI agent, MCP tool, or autonomous data pipeline? This scraper is ready to plug in and pay as it goes.

### More scrapers from scrapesage

Build a complete **healthcare, government-data & B2B lead-gen stack**:

- **[Clinical Lab Leads Scraper](https://apify.com/scrapesage/clinical-lab-leads-scraper)** — every US CLIA-certified clinical & diagnostic laboratory with phone, certificate type and test volume.
- **[NPI / NPPES Scraper](https://apify.com/scrapesage/npi-nppes-scraper)** — every US healthcare provider and organization with NPI, taxonomy and address.
- **[Medical Equipment & DMEPOS Supplier Scraper](https://apify.com/scrapesage/medical-equipment-supplier-leads)** — Medicare DMEPOS suppliers with product lines, phone and geo.
- **[Senior Care Facility Leads Scraper](https://apify.com/scrapesage/senior-care-facility-leads-scraper)** — assisted living, memory care and home-care providers from state licensing registries.
- **[SAMHSA Treatment Facility Scraper](https://apify.com/scrapesage/samhsa-treatment-facility-scraper)** — addiction & mental-health treatment centers with phone and website.
- **[FDA Scraper (openFDA)](https://apify.com/scrapesage/fda-scraper)** — drug, device & food recalls, adverse events and manufacturer leads.
- **[Clinical Trials Scraper](https://apify.com/scrapesage/clinical-trials-scraper)** — trials, sponsors, sites and investigators from ClinicalTrials.gov.
- **[Healthgrades Scraper](https://apify.com/scrapesage/healthgrades-scraper)** — physician profiles, specialties and ratings.
- **[HUD Multifamily Scraper](https://apify.com/scrapesage/hud-multifamily-scraper)** — affordable-housing properties, management contacts & loans.
- **[US Business Formation Scraper](https://apify.com/scrapesage/us-business-formation-scraper)** — newly-registered companies as fresh leads.

### Tips

- **Start with a state + category** (e.g. `TX` + `hospital`) for a fast, focused list, then layer on beds, ownership or service-line filters.
- **Highest-value targets**: filter `facilityCategories: ["hospital"]`, set `minBeds: 100`, and sort by `bedsHigh` — large hospitals are the biggest buyers of capital equipment, devices and software.
- **ASC plays**: filter `ambulatorySurgery` and read `surgicalSpecialties` + `operatingRooms` to target by procedure mix.
- **Dialysis plays**: filter `dialysis` and read `dialysisStations` for site capacity.
- **M\&A intent**: set `ownershipChangedWithinDays: 365` to find facilities with a recent change of ownership (new decision-makers).
- **New-facility intent**: set `newlyCertifiedWithinDays: 365` to find facilities certified in the last year — they need equipment, staffing and supplies.
- **Recurring monitoring**: combine [Schedules](https://docs.apify.com/platform/schedules) with `monitorMode` to capture only facilities added or changed since the last run.

### FAQ

**Where does the data come from?** From the two official U.S. **CMS Provider of Services (POS)** files on [data.cms.gov](https://data.cms.gov): the **QIES** file (hospitals, rural health clinics, FQHCs, community mental health centers) and the **iQIES** file (skilled nursing, home health, hospice, dialysis/ESRD, ambulatory surgery centers, ICF/IID, comprehensive rehab, outpatient therapy, portable X-ray, organ procurement). This actor unifies both into one schema.

**Does it need an API key or login?** No. The CMS data API is queried directly — no key, no login, no browser, no proxy.

**How fresh is it?** CMS refreshes the Provider of Services files **quarterly**, and this actor always resolves the newest available quarter automatically. Run on a [Schedule](https://docs.apify.com/platform/schedules) with monitoring mode to capture newly-certified facilities as they post.

**Does it include emails?** No — the CMS POS files are regulatory data that carry **phone and fax** (near-100% phone coverage) but not email. We never fabricate contact data; everything in the record is straight from CMS.

**How is this different from an NPI scraper?** NPPES/NPI is a provider *identifier* registry (individuals & organizations by taxonomy). This is the **facility-level certification** view: bed counts, service lines, operating rooms, ownership, accreditation, certification lifecycle and health-system affiliations that NPI does not contain.

**What's the lead score?** A 0–100 score derived from facility category, bed size, service breadth, ownership, accreditation, network size and new-facility / ownership-change signals — so the biggest, highest-intent buyers sort to the top.

**Can I export to Google Sheets, CSV, or Excel?** Yes — one click in the dataset view, or automatically on every run via the [Google Drive integration](https://docs.apify.com/platform/integrations/drive).

**A field is empty — why?** A facility only carries data for the programs and services it participates in (e.g. an ASC has no beds; a home health agency has no operating rooms). Blank means CMS has no value, never that scraping failed. The complete raw CMS row is attached under `sourceFields` when `includeRawFields` is on.

**Is this legal?** This actor collects publicly available U.S. government data only. You are responsible for using the data in compliance with applicable laws.

### Need help?

Open an issue on the actor's **Issues** tab, or visit the [Apify help center](https://help.apify.com/). Feature requests are welcome — this actor is actively maintained.

# Actor input Schema

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

Two-letter state codes to scrape (e.g. \["CA","TX"]). Leave empty to scrape all 50 states + DC. Territories also supported: PR, GU, VI, AS, MP.

## `facilityCategories` (type: `array`):

Keep only facilities of these categories. Allowed values: hospital, ambulatorySurgery, dialysis, skilledNursing, nursingFacility, icfIid, homeHealth, hospice, ruralHealthClinic, fqhc, communityMentalHealth, comprehensiveRehab, outpatientTherapy, portableXray, organProcurement, psychResidential. Leave empty for all. (Picking only QIES or only iQIES categories speeds the run by skipping the other file.)

## `hospitalSubtypes` (type: `array`):

When including hospitals, keep only these hospital subtypes. Allowed values: shortTerm (acute care), longTerm, psychiatric, rehabilitation, childrens, criticalAccess, transplant, ruralEmergency. Leave empty for all hospital subtypes.

## `ownershipTypes` (type: `array`):

Keep only facilities with these ownership categories. Allowed values: forProfit, nonProfit, government, physician, other. Leave empty for all.

## `serviceLines` (type: `array`):

Keep only facilities offering ALL of these service lines (case-insensitive substring match against the facility's service list, e.g. \["MRI","CT Scan"], \["Chemotherapy"], \["Emergency"], \["Cardiac Catheterization"], \["Dialysis"]). Optional.

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

Keep only facilities in these cities (case-insensitive, exact match on the facility's city). Optional.

## `counties` (type: `array`):

Keep only facilities in these counties (case-insensitive, matches the resolved county name, e.g. "Los Angeles"). Optional.

## `zipCodes` (type: `array`):

Keep only facilities whose ZIP starts with any of these values (full ZIP or prefix, e.g. "900" or "90210"). Optional.

## `nameQuery` (type: `string`):

Keep only facilities whose name contains this text (case-insensitive). Optional.

## `ccnNumbers` (type: `array`):

Look up specific facilities by CMS Certification Number / Provider Number (e.g. "450002"). When set, the state filter is ignored and only these facilities are returned.

## `activeOnly` (type: `boolean`):

Keep only facilities with an active (non-terminated) Medicare certification.

## `withPhoneOnly` (type: `boolean`):

Keep only facilities that have a phone number.

## `minBeds` (type: `integer`):

Keep only facilities with at least this many certified/total beds (hospitals, SNFs, ICF/IID, rehab, psych). Leave empty for no minimum.

## `maxBeds` (type: `integer`):

Keep only facilities with at most this many beds. Leave empty for no maximum.

## `bedSizeTiers` (type: `array`):

Keep only facilities in these bed-size tiers. Allowed values: small (<25), medium (25-99), large (100-299), veryLarge (300+). Leave empty for all.

## `newlyCertifiedWithinDays` (type: `integer`):

Keep only facilities first certified (original participation / certification date) within the last N days — brand-new facilities that need equipment, software, staffing and supplies. Leave empty to disable.

## `ownershipChangedWithinDays` (type: `integer`):

Keep only facilities whose most recent change of ownership was within the last N days — an M\&A / new-decision-maker signal. Leave empty to disable.

## `minLeadScore` (type: `integer`):

Keep only facilities with a lead score at or above this value (0-100).

## `includeQies` (type: `boolean`):

Include the CMS QIES Provider of Services file: hospitals, rural health clinics, federally qualified health centers and community mental health centers.

## `includeIqies` (type: `boolean`):

Include the CMS iQIES Provider of Services file: skilled nursing, home health, hospice, dialysis (ESRD), ambulatory surgery centers, ICF/IID, comprehensive rehab, outpatient therapy, portable X-ray and organ procurement organizations.

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

Order of the output.

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

Maximum number of facility records to return across all states.

## `maxResultsPerState` (type: `integer`):

Optional cap on the number of facilities returned from each state (useful for balanced multi-state pulls). Leave empty for no per-state cap.

## `deduplicateResults` (type: `boolean`):

Drop duplicate facilities that share the same CMS Certification Number.

## `includeRawFields` (type: `boolean`):

Attach the raw CMS POS source row (all original columns — up to ~473) under sourceFields on each record.

## `monitorMode` (type: `boolean`):

Only return facilities that are new or whose certification, status, beds or ownership changed since the last run with the same monitor key. Ideal on a Schedule to capture newly-certified facilities each quarter.

## `monitorKey` (type: `string`):

Namespace for monitoring mode so independent monitors don't collide. Use a distinct key per saved configuration.

## `proxyConfiguration` (type: `object`):

Optional. The CMS data API needs no proxy, so leave this off for the fastest queries.

## Actor input object example

```json
{
  "states": [
    "WY"
  ],
  "activeOnly": true,
  "withPhoneOnly": false,
  "includeQies": true,
  "includeIqies": true,
  "sortBy": "leadScore",
  "maxResults": 1000,
  "deduplicateResults": true,
  "includeRawFields": true,
  "monitorMode": false,
  "monitorKey": "default",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

All scraped healthcare-facility records in the default dataset, each with firmographics, category & subtype, beds & services, ownership, accreditation, lifecycle signals and a lead score.

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

// Run the Actor and wait for it to finish
const run = await client.actor("scrapesage/us-healthcare-facility-leads-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 = { "states": ["WY"] }

# Run the Actor and wait for it to finish
run = client.actor("scrapesage/us-healthcare-facility-leads-scraper").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": [
    "WY"
  ]
}' |
apify call scrapesage/us-healthcare-facility-leads-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapesage/us-healthcare-facility-leads-scraper"
        }
    }
}

```

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/CW040Hlk2jYalxVdB/builds/cDXqGJ4zjtfXUzHXm/openapi.json
