# NPI Healthcare Provider Leads — Doctors, Clinics & Contacts (`bgfc97/npi-healthcare-provider-leads`) Actor

🔥 Up to 20% OFF! Scrape the NPPES NPI Registry — doctors, clinics, specialties, taxonomies, phones/fax/E.164 and 0-100 lead score, with cross-run change monitoring. Official US data, no login. Perfect for medical sales, recruiters & healthcare marketing. ⚡

- **URL**: https://apify.com/bgfc97/npi-healthcare-provider-leads.md
- **Developed by:** [Bruno](https://apify.com/bgfc97) (community)
- **Categories:** Lead generation, Business
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.60 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## US Healthcare Provider Leads (NPI / NPPES)

Build **targeted lead lists of US healthcare providers** — doctors, dentists, nurses, therapists, clinics, hospitals, pharmacies and labs — with **full contact details**, straight from the **authoritative US government source**: the **NPPES NPI Registry**. No API key, no login, no proxy, no fragile HTML scraping — just clean, structured data on the ~8 million providers enrolled in the National Plan & Provider Enumeration System.

- 🆓 **Free, official data source** — the CMS NPPES public API. You only pay Apify for the provider rows you keep (bonus analytics rows are free).
- 🎯 **Rich search** — by specialty/taxonomy, state(s), city(ies), ZIP, first/last name, organization name, or provider type (individual vs organization).
- ♾️ **Breaks past the 1,200-result cap** — the NPPES API hard-limits any single search to 1,200 records; this Actor shards the search automatically and merges everything into one complete, de-duplicated list.
- 🧾 **Every field NPPES exposes** — all addresses (practice + mailing + secondary), full taxonomy list, licenses, other identifiers (Medicaid/Medicare), electronic endpoints, the authorized official (the org's decision-maker), the organization's **"doing business as" trade name(s)** and a provider's former / professional names, and the full enumeration/update/deactivation history.

#### 🧠 …and intelligence no other NPPES Actor ships (all derived from authoritative public data — nothing fabricated)

- 🏷️ **Taxonomy intelligence** — every specialty is matched to the official **NUCC taxonomy** (grouping → classification → specialization) and given a plain-English **category** (`Primary-care physician`, `Specialist physician`, `Dental`, `Behavioral health`, `Facility`…) plus `is_primary_care` / `is_specialist` / `is_facility` flags. Target "every primary-care physician" or "every specialist" in one filter.
- 📊 **Transparent lead score (0–100) + A/B/C/D tier** — ranked by **disclosed** signals (reachable by phone, sole-proprietor/decision-maker, active, recently verified, multi-location, licensed, operates under a public trade name…). Every row carries a `lead_score_factors` breakdown — never a black box. Filter with `minLeadScore` to keep only your best leads.
- 🗺️ **Geo enrichment** — ZIP → **lat/long** (centroid), **county** (not in NPPES!), **US region** and **time zone** — so you can map territories, build radius lists and know the best hour to call. Plus a `zip_state_matches` data-quality flag.
- ☎️ **Phone & deliverability intelligence** — normalized **E.164**, **toll-free** detection, and **area-code → state** geography (spot an out-of-area number), a mailing-vs-practice split and the `best_mailing_address` to post to.
- 🏢 **Doing-Business-As / trade-name intelligence** — NPPES ships alternate names with a *type*; most NPPES actors flatten them to a bare string and throw the type away. This Actor keeps it: an organization's **`doing_business_as`** (the public brand on the signage / Google listing — e.g. legal entity *"290 Crossing Dental & Orthodontics PLLC"* → **d/b/a "Rodeo Dental and Orthodontics"**), an individual's **`professional_name`**, and **`former_names`** for identity resolution against old CRM records. The DBA is the name you actually say on a cold call.
- 🕸️ **Practice-network graph** — automatically **clusters providers who share a clinic address or phone** (organization + the providers who work there) and surfaces the `suggested_org_lead`. Shipped as free `practice_network` rows.
- 📈 **Market summary** — one free `market_summary` row per run: counts by specialty, category, grouping, state and county, provider mix, contactability, lead-score distribution and network stats.
- 🔁 **Cross-run de-duplication** — turn on `dedupeAcrossRuns` and the Actor remembers everyone it already delivered. Run the same search daily and **pay only for brand-new providers** (resumable; never re-charges).
- 🛰️ **Cross-run change monitoring** — turn on `trackChanges` and each run **diffs against the last one** and tells you *what changed*: brand-new providers (`is_new_provider` — fresh leads before anyone else works them), practice-address **moves**, **phone** changes, new **trade names** (d/b/a), new **authorized officials** (decision-makers), specialty changes, **deactivations / reactivations**, and — under complete coverage — providers that **dropped out**. Every row gains a `change_since` block and one free `monitor_summary` row rolls up the whole run. NPPES refreshes weekly; this turns a re-run into an alerting feed. (Off by default; adds **zero** columns when off.)

### Why it beats the alternatives

Competitors like *Healthgrades* or *Google Maps* scrapers pull from review sites and map listings — incomplete, duplicated, often missing the NPI, specialty taxonomy, license, mailing address or fax, and always at the mercy of a layout change or a login wall. Other NPPES actors exist, but most return a thin, flattened row and shard only crudely (by state, or `A*`–`Z*` last-name prefixes) — which leaves the big metros capped and silently incomplete.

| Capability | **This Actor** | Typical NPPES competitor |
|---|---|---|
| Official NPI + standardized taxonomy (code **+** description) | ✅ primary **and** all secondary | ✅ usually primary only |
| Practice address | ✅ | ✅ |
| Mailing address | ✅ | ⚠️ sometimes |
| **Secondary practice locations** (multi-site orgs) | ✅ full array, each with its own phone/fax | ⚠️ rarely |
| **De-duplicated phones / faxes** across all addresses | ✅ normalized `(xxx) xxx-xxxx` + arrays + **E.164 for every number** | ⚠️ single raw phone |
| Authorized official (name / title / **phone = decision-maker lead**) | ✅ | ⚠️ sometimes |
| **Doing-Business-As / trade name** + former / professional names (type-aware) | ✅ `doing_business_as` + `other_names_detail` | ⚠️ bare string, type discarded |
| Other identifiers (Medicaid / Medicare / other) | ✅ | ⚠️ rarely |
| Electronic endpoints (Direct / FHIR, with e-mails extracted) | ✅ | ⚠️ rarely |
| Sole-proprietor flag, credential, gender | ✅ | ⚠️ partial |
| Enumeration / update / **deactivation + reactivation** dates | ✅ | ⚠️ partial |
| Break past the **1,200-result** cap | ✅ **adaptive ZIP/name sharding** (deepens only heavy branches) | ⚠️ coarse state / `A*–Z*` sharding |
| Multi-state **and** multi-city fan-out in one run | ✅ | ⚠️ rarely |
| Flat CSV/Sheets columns **and** structured objects | ✅ both | ⚠️ one or the other |
| Bulk NPI enrichment (list of NPIs → full records) | ✅ | ✅ |
| **NUCC taxonomy intelligence** (grouping + category + primary-care/specialist/facility flags) | ✅ | ❌ |
| **Transparent lead score 0–100 + tier** (with per-factor breakdown) | ✅ | ❌ |
| **Geo: lat/long + county + region + time zone** from the ZIP | ✅ | ❌ (ZIP only) |
| **Phone intelligence** (E.164, toll-free, area-code → state) | ✅ | ❌ raw string |
| **Practice-network graph** (co-located providers → org + members) | ✅ | ❌ |
| **Market-summary** analytics row per run (free) | ✅ | ❌ |
| **Cross-run dedupe** (pay only for new providers on a schedule) | ✅ | ❌ |
| **Cross-run change monitoring** (diff vs last run: new/moved/deactivated/new decision-maker…) | ✅ `change_since` + `monitor_summary` | ❌ |
| Honest cap handling (warns which prefixes still exceed 1,200) | ✅ | ❌ silent truncation |
| Per-record error isolation (one bad record never aborts the run) | ✅ | ⚠️ varies |
| API key / login / proxy required | ❌ none | varies |

### Input

Search by any combination of filters — leave the rest blank. A **state or country code can't be searched on its own**; pair it with a specialty, city, ZIP or name.

```json
{
  "taxonomyDescription": "Dentist",
  "state": "TX",
  "city": "Houston",
  "enumerationType": "both",
  "maxResults": 500
}
```

Pull an **entire state** (past the 1,200 cap):

```json
{
  "taxonomyDescription": "Dentist",
  "state": "TX",
  "splitLargeSearches": true,
  "maxResults": 50000
}
```

| Field | Description |
|---|---|
| `taxonomyDescription` | Specialty / taxonomy, e.g. `Dentist`, `Family Medicine`, `Pediatrics`, `Pharmacy`. Trailing `*` wildcard works (≥2 leading chars). |
| `state` / `states` | 2-letter state code, or a list of them. Each is searched (and sharded) independently, then merged. Can't be used *alone*. |
| `city` / `cities` | City name, or a list — great for sweeping a whole metro. |
| `postalCode` | ZIP code. Trailing `*` works (e.g. `770*`). |
| `firstName`, `lastName` | For individual providers. Trailing `*` works. |
| `organizationName` | For clinics / facilities / organizations. Trailing `*` works. |
| `npi` / `npiList` | Direct / bulk lookup of 10-digit NPIs. When set, search filters are ignored. |
| `enumerationType` | `both` (default), `individual` (NPI-1) or `org` (NPI-2). |
| `addressPurpose` | Restrict to `LOCATION`, `MAILING`, `PRIMARY` or `SECONDARY` addresses. |
| `taxonomyCode` | Keep only providers carrying an exact 10-char NUCC code (e.g. `122300000X` = Dentist). Applied as a post-filter. |
| `useFirstNameAlias` | Also match nicknames (Bob ↔ Robert). |
| `namePurpose` | Whether a name search targets the provider or the org's authorized official. |
| `countryCode` | Address country (default `US`). Can't be used alone. |
| `onlyActive` | Drop deactivated NPIs. |
| `splitLargeSearches` | **Break past the 1,200-result cap** — shard automatically and pull the complete set. Pair with a high `maxResults`. |
| `splitBy` | Sharding strategy: `auto` (recommended, ZIP-prefix), `postal`, `lastname`, `organizationname`, `none`. |
| `minLeadScore` | Keep only providers whose 0–100 lead score is ≥ this (0 = keep all). Filtered rows aren't returned or charged. |
| `highValueTaxonomies` | Keywords that earn a +8 lead-score boost when they match the provider's specialty/category (e.g. `Dentist`, `Dermatology`). |
| `buildPracticeNetwork` | Emit free `practice_network` cluster rows (default **on**). |
| `marketSummary` | Emit one free `market_summary` row per run (default **on**). |
| `dedupeAcrossRuns` | Remember delivered NPIs across runs and skip them — never re-returned, never re-charged (default off). |
| `dedupeStoreName` | Name of the Key-Value store holding the cross-run "seen NPIs" set (default `npi-provider-seen`). Use different names for independent lead lists. |
| `trackChanges` | **Cross-run change monitoring** — diff each run against the last and report what changed (default off; see below). Adds a `change_since` block per row + a free `monitor_summary`. |
| `monitorKey` | Stable label tying a run to its history (e.g. `tx-dentists-watch`). Blank = derived from your search filters. Set distinct keys for independent watchlists. |
| `monitorStoreName` | Advanced: explicit name for the named Key-Value store that holds the monitor snapshots. Blank = derived from `monitorKey`. |
| `monitorMaxAgeDays` | Drop a tracked provider not re-seen within this many days (default 400). |
| `monitorMaxEntries` | Hard cap on tracked provider snapshots (default 200,000; most-recently-seen kept). |
| `maxResults` | Max providers to return (1–1,000,000). Without `splitLargeSearches`, a single search tops out at 1,200. |
| `maxRequests` | Safety cap on total API calls (each returns up to 200 providers). |
| `requestDelayMs` | Politeness delay between calls to the government API. |

#### Keep only your best leads, pull only what's new

```json
{
  "taxonomyDescription": "Dentist",
  "state": "FL",
  "splitLargeSearches": true,
  "maxResults": 100000,
  "minLeadScore": 70,
  "highValueTaxonomies": ["Dentist"],
  "dedupeAcrossRuns": true
}
```

Run this on a schedule: the first run returns every Florida dentist scoring ≥ 70; each later run returns (and charges for) **only the newly-enrolled or newly-qualifying providers**.

### Output (one row per provider — real sample)

```json
{
  "npi": "1881105682",
  "type": "individual",
  "enumeration_type": "NPI-1",
  "full_name": "Dr. SARAH KHALID ABDAT",
  "first_name": "SARAH",
  "middle_name": "KHALID",
  "last_name": "ABDAT",
  "name_prefix": "Dr.",
  "credential": "B.D.S, M.S",
  "gender": "Female",
  "sole_proprietor": "NO",
  "primary_taxonomy_code": "1223E0200X",
  "primary_specialty": "Dentist, Endodontics",
  "license_number": "33568",
  "license_state": "TX",
  "taxonomies": [
    { "code": "1223E0200X", "description": "Dentist, Endodontics", "primary": true, "license": "33568", "license_state": "TX", "taxonomy_group": null }
  ],
  "all_specialties": ["Dentist, Endodontics"],
  "phone": "(254) 699-7855",
  "fax": null,
  "phones": ["(254) 699-7855", "(512) 328-6763"],
  "phones_e164": ["+12546997855", "+15123286763"],
  "faxes": [],
  "emails": [],
  "practice_address": {
    "purpose": "LOCATION", "type": "DOM",
    "street": "4400-1 E CENTRAL TEXAS EXPY STE B", "street2": null,
    "city": "KILLEEN", "state": "TX", "zip": "76543-7309", "country": "United States",
    "phone": "(254) 699-7855", "fax": null
  },
  "mailing_address": {
    "purpose": "MAILING", "type": "DOM",
    "street": "12174 N MOPAC EXPY STE C", "city": "AUSTIN", "state": "TX", "zip": "78758-2910",
    "country": "United States", "phone": null, "fax": null
  },
  "other_practice_locations": [
    { "purpose": "LOCATION", "street": "3801 BEE CAVES RD STE C", "city": "WEST LAKE HILLS", "state": "TX", "zip": "78746-6761", "phone": "(512) 328-6763", "fax": null }
  ],
  "other_identifiers": [],
  "endpoints": [],
  "endpoint_count": 0,
  "other_names": [],
  "other_names_detail": [],
  "doing_business_as": [],
  "dba": null,
  "former_names": [],
  "professional_name": null,
  "enumeration_date": "2017-10-19",
  "last_updated": "2018-03-17",
  "deactivation_date": null,
  "reactivation_date": null,
  "status": "A",
  "status_text": "Active",
  "npi_url": "https://npiregistry.cms.hhs.gov/provider-view/1881105682",
  "scraped_at": "2026-11-21T20:49:32.755Z",
  "summary": "Dr. SARAH KHALID ABDAT — Dentist, Endodontics (KILLEEN, TX) ☎ (254) 699-7855"
}
```

**Organizations** (`type: "organization"`) additionally carry `organization_name`, `organizational_subpart`, `parent_organization`, their public **`doing_business_as`** trade name(s), and an `authorized_official` block — **name, credential, title and phone** — the person to call:

```json
"organization_name": "290 CROSSING DENTAL AND ORTHODONTICS PLLC",
"doing_business_as": ["RODEO DENTAL AND ORTHODONTICS"],
"dba": "RODEO DENTAL AND ORTHODONTICS",
"other_names_detail": [
  { "name": "RODEO DENTAL AND ORTHODONTICS", "type": "Doing Business As", "code": "3", "credential": null }
],
"authorized_official": {
  "name": "Dr. BRADLEY K BARTELLI", "first_name": "BRADLEY", "last_name": "BARTELLI",
  "credential": "D.M.D", "title": "President", "phone": "(361) 851-2828"
}
```

The legal entity may be an opaque *"…PLLC"*, but the **`dba`** is the brand on the door and in Google — the name to use in outreach and to match the clinic to its reviews, website or map listing. Individuals similarly carry `professional_name` (the name they practise under) and `former_names` (to reconcile an old CRM record after a name change).

Every record also carries **flat, spreadsheet-friendly location columns** — `practice_street`, `practice_city`, `practice_state`, `practice_postal_code`, `mailing_city`, `mailing_state`, `mailing_postal_code` — so a CSV / Excel / Google Sheets export is clean out of the box, while the structured `practice_address` / `mailing_address` objects stay intact for programmatic use.

Arrays like `other_identifiers`, `endpoints` and `other_practice_locations` appear for every record and are populated only when the provider submitted them to CMS. `emails` holds any address parsed out of the provider's electronic **endpoints** (Direct secure-messaging / FHIR) — CMS does not publish general marketing e-mail, so this is often empty.

#### Enrichment fields (on every provider row)

On top of the raw CMS fields above, each `provider` row also carries:

| Field(s) | What it adds |
|---|---|
| `specialty_group`, `specialty_classification`, `specialty_specialization` | Authoritative **NUCC** breakdown of the primary taxonomy (e.g. `Dental Providers` → `Dentist` → `Endodontics`). |
| `specialty_category`, `specialty_category_label` | Plain-English bucket: `primary_care_physician`, `specialist_physician`, `dental`, `behavioral_health`, `advanced_practice`, `pharmacy`, `facility`, … |
| `is_primary_care`, `is_specialist`, `is_facility` | Boolean flags for one-filter targeting. `taxonomy_intel` holds the full per-provider rollup (all groupings/categories/classifications). |
| `lead_score`, `lead_tier`, `lead_score_factors` | Transparent 0–100 score, `A`/`B`/`C`/`D` tier, and the exact points awarded with reasons. |
| `practice_lat`, `practice_lon`, `practice_county`, `practice_region`, `practice_timezone`, `zip_state_matches` | Geo from the practice ZIP (centroid lat/long, county, US region, predominant time zone) + a data-quality flag. `practice_geo` holds the structured object. |
| `phone_area_code`, `phone_area_code_state`, `phone_is_toll_free`, `phone_details`, `phones_e164` | Phone intelligence — area-code geography, toll-free detection, and **E.164 for every number on file** (ready for a dialer / CRM import). |
| `doing_business_as`, `dba`, `former_names`, `professional_name`, `other_names_detail` | **Type-aware alternate names.** `dba`/`doing_business_as` = the org's public trade name(s); `professional_name` = the name an individual practises under; `former_names` = prior names for identity resolution. `other_names_detail` keeps every alternate name **with its NPPES type**. |
| `is_reachable_by_phone`, `mailing_differs_from_practice`, `best_mailing_address` | Deliverability helpers for call lists and direct mail. |

#### Two free bonus record types (never charged)

Every run also appends analytics rows you can tell apart by `record_type` (provider rows are `record_type: "provider"`):

- **`practice_network`** — one per cluster of providers that share an exact practice address (or a local phone across ≥2 sites). Each lists the `members` (NPI + name + specialty + score), the `shared_address`/`shared_phone`, and a `suggested_org_lead` (the organization at that location, or the strongest provider). Map a whole clinic/group from a single search.
- **`market_summary`** — one per run: provider mix, status, contactability totals, lead-score distribution, counts by specialty/category/grouping/state/county, practice-network stats, the reference data versions used, and honest caveats.
- **`monitor_summary`** — one per run *when `trackChanges` is on*: the cross-run diff roll-up (new / moved / phone / decision-maker / deactivated / gone shortlists + trending). See **[Cross-run change monitoring](#cross-run-change-monitoring)**.

> **Honesty & caveats.** `lead_score` is a **transparent heuristic** for prioritisation (read `lead_score_factors`), not a fact about the provider. `practice_geo` coordinates are **ZIP-area centroids** (`geocode_precision: "zip_centroid"`), not exact street geocodes. `practice_timezone` is the state's predominant zone (a few states straddle a boundary). Practice-network clusters are an **inference** from shared contact details, not a CMS-declared affiliation. Reference data: NUCC Taxonomy 25.1, GeoNames US postal centroids (CC-BY), NANP area-code geography.

### Cross-run change monitoring

NPPES is refreshed **weekly**. Turn on `trackChanges`, give the search a stable `monitorKey`, and run it on a schedule — each run keeps a compact snapshot of every provider in a **named Key-Value store** (the one storage that survives Apify's between-run purge) and **diffs the next run against it**. A re-run stops being "the same list again" and becomes an **alerting feed**:

- 🆕 **`is_new_provider`** — an NPI that appeared since the last run = a practice/clinician that just enrolled under your specialty + city. The hottest lead there is: nobody has worked it yet.
- 🚚 **Practice moved** — the provider changed location (a switching / buying moment).
- ☎️ **Phone changed** — refresh your dialer / CRM before the old number bounces.
- 🏷️ **New trade name (d/b/a)** / 👤 **new authorized official** — a rebrand, or a fresh decision-maker to pitch.
- 🩺 **Specialty/taxonomy added or changed** — the practice opened a new service line.
- ⛔ **Deactivated → stop calling**; ♻️ **reactivated**; and (only under complete coverage) providers that **dropped out** of the search.

The **first run is a baseline** (it just records snapshots — there is nothing honest to diff against yet); change detection starts on the **second** run. When `trackChanges` is off, **none** of these columns are added.

Each provider row gains `monitored`, `first_seen`, `last_checked_prev`, `is_new_provider` and a **`change_since`** block — a literal before→after of two real captures (never a prediction):

```json
"monitored": true,
"first_seen": "2026-11-16T05:07:37.754Z",
"last_checked_prev": "2026-11-16T05:07:37.754Z",
"is_new_provider": false,
"change_since": {
  "since": "2026-11-16T05:07:37.754Z",
  "prev_snapshot_date": "2026-11-16",
  "is_new_provider": false,
  "change_count": 1,
  "worst_severity": "positive",
  "headline": "Practice moved: FAIRBANKS, AK 99701 → JUNEAU, AK 99801",
  "changes": [
    { "type": "practice_address_change", "field": "practice_address", "severity": "positive", "direction": "moved",
      "from": { "city": "FAIRBANKS", "state": "AK", "zip": "99701" },
      "to":   { "city": "JUNEAU",    "state": "AK", "zip": "99801" },
      "detail": "Practice moved: FAIRBANKS, AK 99701 → JUNEAU, AK 99801" }
  ]
}
```

`severity` is lead-gen oriented: **`positive`** = an opportunity / good news (new provider, moved, reactivated, new d/b/a, new decision-maker), **`negative`** = a lead lost (deactivated), **`neutral`** = an informational refresh (phone / taxonomy change, or NPPES simply touched the record). A brand-new provider's `change_since` carries `"is_new_provider": true` and a single `new_provider` change.

Every run with tracking on also appends one **free** `monitor_summary` row that rolls up the whole diff — shortlists plus trending among the *new* providers (where the quiet green-field is):

```json
{
  "record_type": "monitor_summary",
  "monitor_key": "juneau-dentists-live",
  "first_run": false,
  "run_count": 2,
  "since": "2026-11-16T05:07:37.754Z",
  "coverage_complete": true,
  "providers_tracked": 54,
  "providers_checked": 54,
  "first_time_seen": 1,
  "changed_count": 6,
  "material_change_count": 5,
  "new_provider_count": 1,
  "deactivated_count": 0,
  "gone_count": 1,
  "new_providers":      [{ "npi": "1073679015", "name": "Dr. WILLIAM JENELL COLLIER II", "type": "individual", "specialty": "Dentist, General Practice", "city": "JUNEAU", "state": "AK" }],
  "moved_providers":    [{ "npi": "1003813734", "name": "Dr. LONNIE ARTHUR ANDERSON", "from": { "city": "FAIRBANKS", "state": "AK", "zip": "99701" }, "to": { "city": "JUNEAU", "state": "AK", "zip": "99801" } }],
  "phone_changes":      [{ "npi": "1558435446", "name": "Dr. THOMAS BENNETT BORNSTEIN", "from": "9070000000", "to": "9074634070" }],
  "new_decision_makers":[{ "npi": "1285000505", "name": "CHRISTINE MOLESKI, DMD, P.C.", "from": "DR OLD DECISIONMAKER", "to": "Dr. CHRISTINE MICHELLE MOLESKI" }],
  "gone_providers":     [{ "npi": "9999999999", "name": "...", "last_city": "JUNEAU", "last_state": "AK" }],
  "trending_new_specialties": [{ "name": "Dentist, General Practice", "count": 1 }],
  "summary": "Monitor \"juneau-dentists-live\": 5 provider(s) changed since last run — 1 NEW provider(s), 1 moved, 1 phone change(s), 1 new decision-maker(s), 1 gone."
}
```

| Field (on every provider row when `trackChanges` is on) | What it is |
|---|---|
| `monitored` | `true` once tracking has attached to the row. |
| `first_seen` | When this monitor first saw this NPI (preserved across runs). |
| `last_checked_prev` | When the monitor last captured this NPI before now (`null` on first sight). |
| `is_new_provider` | `true` when the NPI is new since the last run (only on an established monitor — never on the baseline run). |
| `change_since` | The before→after diff block (see above), or `null` when there's no prior capture or nothing changed. |

> **Honesty & scope.** The first run reports nothing (no baseline to diff). A new provider is flagged only once a baseline exists. **Disappeared-provider detection (`gone_providers`) runs only under _complete coverage_** — the search finished without hitting the 1,200 cap, the request/result safety caps or an API error, and with **no** row-dropping filter (`onlyActive`, `minLeadScore`, exact `taxonomyCode`) and **not** in bulk/dedupe mode — because otherwise "not seen this run" can't be told apart from NPPES pagination, so we stay silent rather than invent a false "gone". `trackChanges` and `dedupeAcrossRuns` pull in opposite directions (dedupe suppresses re-delivery; monitoring needs re-delivery to diff) — use one *or* the other per lead list. The snapshot store is pruned by age (`monitorMaxAgeDays`) and hard-capped (`monitorMaxEntries`). **The `monitor_summary` row is free — charging counts provider rows only.**

#### Monitor a territory on a schedule

```json
{
  "taxonomyDescription": "Dentist",
  "state": "TX",
  "splitLargeSearches": true,
  "maxResults": 100000,
  "trackChanges": true,
  "monitorKey": "tx-dentists-watch"
}
```

First run banks the baseline; every scheduled run after it emits a `monitor_summary` naming the newly-enrolled Texas dentists, the ones who moved or changed phone, the new clinic decision-makers and anyone deactivated — a ready-made alert, no manual diffing.

### Breaking past the 1,200-result cap

The NPPES API returns **at most 1,200 records per query** and never tells you how many actually matched. Set `splitLargeSearches: true` and the Actor:

1. Fans out across every state/city you provide.
2. Shards each search by **ZIP prefix** (the `auto` default) — covering individuals *and* organizations in one pass — and **adaptively deepens only the branches that are still capped** (e.g. `77*` → `770*` … `779*`), so it probes live prefixes instead of a blind `00–99` sweep.
3. **De-duplicates globally by NPI** and merges everything into one dataset.
4. If any prefix is *still* above 1,200 at maximum depth, it logs an honest warning telling you exactly where to add a city or specialty for 100% coverage — it never silently truncates.

### Use cases

- 🎯 **B2B / medical sales** — clean call & mail lists by specialty + geography, **pre-scored and tiered**, with the authorized official as the decision-maker contact. Use `minLeadScore` + `highValueTaxonomies` to surface only A-tier prospects, and `dedupeAcrossRuns` to work a territory daily without paying twice.
- 🛰️ **Always-on lead alerts** — schedule the same search with `trackChanges` on and let the `monitor_summary` tell you each run who just enrolled, moved, changed phone, got a new decision-maker or was deactivated — new-practice and switching signals the day they land, not on a quarterly manual re-pull.
- 🏥 **Recruiting** — find every provider of a given specialty in a city, ZIP or whole state; use the `is_primary_care` / `is_specialist` flags and `specialty_category` to target exactly the right clinicians.
- 🔗 **Data enrichment** — attach the official NPI, NUCC taxonomy, category, license, county, lat/long and Medicaid/Medicare IDs to your CRM via bulk NPI lookup.
- 🗺️ **Territory planning** — group leads by county, region or lat/long radius; the `practice_network` rows reveal which providers belong to the same clinic or group.
- 📊 **Market & network analysis** — the `market_summary` row profiles provider density, specialty mix, org vs. individual split and multi-site footprints for the whole search in one record.

### Notes

- Source: [NPPES NPI Registry API](https://npiregistry.cms.hhs.gov/api-page) v2.1 — public, free, no key. US-focused.
- The registry contains the contact information providers themselves submit for public listing.
- `limit` is capped at 200 per API call and pagination freezes past `skip=1000`, so one raw search exposes 1,200 records max — hence the sharding engine above.
- **Billing:** only `provider` rows are charged. The `practice_network`, `market_summary` and `monitor_summary` rows are always free. Cross-run dedupe / monitoring state lives in named Key-Value stores that persist across runs (and are not part of the dataset).

### ⭐ Enjoying this Actor?

A quick **rating/review** helps others find it. Want extra fields, CSV presets or a custom specialty list? Open a ticket on the **Issues** tab.

# Actor input Schema

## `taxonomyDescription` (type: `string`):

Provider specialty (NPPES taxonomy description), e.g. "Dentist", "Family Medicine", "Pediatrics", "Pharmacy". A trailing wildcard \* works (e.g. "Dent\*"); wildcards need at least 2 leading characters.

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

US state abbreviation, e.g. TX, CA, NY. Cannot be used entirely on its own — combine it with a specialty, city, ZIP or name. For several states use the "States" list below.

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

Several 2-letter state codes — each is searched (and, if enabled, sharded) independently and the results are merged + de-duplicated. Leave empty to use the single "State" field above.

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

City name, e.g. "Houston". Works on its own. For several cities use the "Cities" list below.

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

Several cities — each is searched independently and merged + de-duplicated. Great for building a lead list across a metro area.

## `postalCode` (type: `string`):

ZIP code. A trailing wildcard \* works for a whole area (e.g. "770\*"); wildcards need at least 2 leading characters.

## `firstName` (type: `string`):

Provider first name. Trailing wildcard \* works (≥2 leading chars).

## `lastName` (type: `string`):

Provider last name. Trailing wildcard \* works (≥2 leading chars).

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

Organization / clinic / facility name. Trailing wildcard \* works (≥2 leading chars).

## `npi` (type: `string`):

Look up one exact 10-digit NPI number. When set, all search filters are ignored.

## `npiList` (type: `array`):

A list of 10-digit NPI numbers to look up in bulk. When set, search filters are ignored. Non-10-digit and duplicate values are dropped.

## `enumerationType` (type: `string`):

Restrict to individuals (doctors, dentists…), organizations (clinics, hospitals, pharmacies…) or return both.

## `addressPurpose` (type: `string`):

Match on a specific address type. PRIMARY / SECONDARY refer to the provider's primary vs. secondary practice locations.

## `taxonomyCode` (type: `string`):

Keep only providers carrying this exact 10-char NUCC taxonomy code (e.g. "122300000X" for Dentist). Applied on top of your other filters.

## `useFirstNameAlias` (type: `boolean`):

Also match common nicknames of the first name (e.g. Bob ↔ Robert, Bill ↔ William).

## `namePurpose` (type: `string`):

When searching by name, whether the name refers to the provider or the organization's authorized official. Requires a first/last name.

## `countryCode` (type: `string`):

2-letter country code for the address (default US). Cannot be used alone — combine with another field.

## `onlyActive` (type: `boolean`):

Drop deactivated NPIs and keep only active providers.

## `splitLargeSearches` (type: `boolean`):

NPPES returns at most 1,200 results per search. Turn this on (and set a high Max results) to automatically shard the search by ZIP or name prefix and pull the complete, de-duplicated set — tens of thousands of providers.

## `splitBy` (type: `string`):

How to shard when breaking past the cap. "Auto" uses ZIP prefixes (complete coverage for individuals + organizations) and only falls back to name when a ZIP is already pinned.

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

Keep only providers whose transparent 0–100 lead score is at least this value (0 = keep everyone). Every row carries a `lead_score`, an A/B/C/D `lead_tier` and a `lead_score_factors` breakdown explaining the points. Filtered-out rows are not returned or charged.

## `highValueTaxonomies` (type: `array`):

Optional. Keywords (matched against the specialty / category, case-insensitive) that earn a provider +8 on its lead score — e.g. "Dentist", "Dermatology", "Med Spa". Leave empty for no boost.

## `buildPracticeNetwork` (type: `boolean`):

Also output `practice_network` records that cluster providers sharing a practice address or local phone (same clinic / group = the organization plus the providers who work there). Free / uncharged.

## `marketSummary` (type: `boolean`):

Also output one `market_summary` record per run: counts by specialty, category, grouping, state and county, provider mix, contactability, lead-score distribution and network stats. Free / uncharged.

## `dedupeAcrossRuns` (type: `boolean`):

Remember every NPI delivered in previous runs (in a named Key-Value store) and skip it next time — not re-returned and not re-charged. Run the same search on a schedule and pay only for brand-new providers.

## `dedupeStoreName` (type: `string`):

Name of the named Key-Value store that holds the cross-run "seen NPIs" set. Use distinct names to keep separate lead lists independent.

## `trackChanges` (type: `boolean`):

Remember a compact snapshot of every provider (in a named Key-Value store) and, on the NEXT run of the same search, report WHAT CHANGED: brand-new providers (`is_new_provider` — fresh leads nobody has worked), practice-address moves, phone changes, new trade names (d/b/a), new authorized officials (decision-makers), specialty changes, deactivations/reactivations, and — under complete coverage — providers that dropped out. Off by default and adds zero columns when off. Each provider row gains `monitored`, `first_seen`, `last_checked_prev`, `is_new_provider` and a `change_since` object; one free `monitor_summary` row rolls it all up. The first run is a baseline (it just records snapshots); changes appear from the second run on.

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

A stable label that ties a run to its history, e.g. "tx-dentists-watch". Leave blank and a key is derived automatically from your search filters (so the same search reuses the same history). Set distinct keys to keep separate watchlists independent. Only used when "Track changes across runs" is on.

## `monitorStoreName` (type: `string`):

Optional explicit name for the named Key-Value store that holds the monitor snapshots. Leave blank to derive it from the monitor key. Only used when "Track changes across runs" is on.

## `monitorMaxAgeDays` (type: `integer`):

A tracked provider not re-seen within this many days is pruned from the snapshot store (keeps an always-on monitor bounded). Only used when "Track changes across runs" is on.

## `monitorMaxEntries` (type: `integer`):

Hard cap on how many provider snapshots the store keeps (most-recently-seen are kept). Only used when "Track changes across runs" is on.

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

Maximum providers to return. Without "Break past the 1,200 cap", a single search tops out at 1,200. With it enabled, set this as high as you need.

## `maxRequests` (type: `integer`):

Upper bound on NPPES API calls for one run, so a huge sharded sweep can't run away. Each call returns up to 200 providers.

## `requestDelayMs` (type: `integer`):

Politeness delay between calls to the government API.

## Actor input object example

```json
{
  "taxonomyDescription": "Dentist",
  "state": "TX",
  "enumerationType": "both",
  "addressPurpose": "",
  "useFirstNameAlias": false,
  "namePurpose": "",
  "onlyActive": false,
  "splitLargeSearches": false,
  "splitBy": "auto",
  "minLeadScore": 0,
  "buildPracticeNetwork": true,
  "marketSummary": true,
  "dedupeAcrossRuns": false,
  "dedupeStoreName": "npi-provider-seen",
  "trackChanges": false,
  "monitorMaxAgeDays": 400,
  "monitorMaxEntries": 200000,
  "maxResults": 1000,
  "maxRequests": 5000,
  "requestDelayMs": 120
}
```

# Actor output Schema

# 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 = {
    "taxonomyDescription": "Dentist",
    "state": "TX"
};

// Run the Actor and wait for it to finish
const run = await client.actor("bgfc97/npi-healthcare-provider-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 = {
    "taxonomyDescription": "Dentist",
    "state": "TX",
}

# Run the Actor and wait for it to finish
run = client.actor("bgfc97/npi-healthcare-provider-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 '{
  "taxonomyDescription": "Dentist",
  "state": "TX"
}' |
apify call bgfc97/npi-healthcare-provider-leads --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bgfc97/npi-healthcare-provider-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/dqoi8uvkFiirKZHN0/builds/jaAdobGlZexJdZnEN/openapi.json
