# NPI Healthcare Lead Enricher (`b2btoolstudio/npi-healthcare-lead-enricher`) Actor

Queries the official CMS NPPES v2.1 API with auto-sharding, flattens nested taxonomies, addresses, phones, faxes, endpoints, and licenses into CRM-ready rows, deduplicates multi-location practices, and scores lead completeness and practice size.

- **URL**: https://apify.com/b2btoolstudio/npi-healthcare-lead-enricher.md
- **Developed by:** [B2B Tool Studio](https://apify.com/b2btoolstudio) (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 $5.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/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

## NPI Healthcare Lead Enricher

**Extract flat, deduplicated, CRM-ready healthcare provider and clinic leads from the official CMS NPPES v2.1 Registry—with automatic pagination/sharding past the 1,200-record cap, 80+ NUCC taxonomy mappings, phone normalization, and deterministic lead scoring.**

Built by [B2B Tool Studio](https://b2btoolstudio.com) for healthcare SaaS outbound, medtech sales teams, dental/PT DSO prospecting, HubSpot/Salesforce/Clay enrichment, and AI agent workflows.

***

### Why Use This Instead of Raw CMS NPPES API Calls?

- **Bypasses CMS `skip=1000` / `limit=200` Caps:** Automatically pages and shards by `enumeration_type` (`NPI-1`/`NPI-2`) and `postal_code` prefix (`0*`–`9*`) to extract up to 2,000 deduplicated leads in one run.
- **NUCC Taxonomy Dictionary:** Maps raw NUCC codes (`122300000X`, `207RC0000X`, `225100000X`, etc.) into clean `specialtyCategory` (`Dental`, `Primary Care`, `Cardiology`, `Rehab`, etc.) and `primarySpecialtyLabel`.
- **Flat CRM-Ready Columns:** Flattens nested addresses, phones (`XXX-XXX-XXXX`), faxes, licenses, and authorized officials into HubSpot/Salesforce/Clay-ready fields (`practiceAddressLine`, `practiceCity`, `practiceState`, `practiceZip`, `practicePhone`, `authorizedOfficial`).
- **Practice-Level Deduplication & Sizing:** Merges multi-location NPI-2 organizations and computes deterministic `completenessScore`, `practiceSizeScore`, `leadQualityScore` (0–100), and `practiceSizeTier` (`SOLO`, `SMALL_GROUP`, `MID_SIZE`, `ENTERPRISE`).
- **Spend-Cap Safe:** Honors Apify's `maxTotalChargeUsd` budget cap before pushing dataset items.

***

### Input Parameters

*(CMS NPPES v2.1 requires at least **2** active filter criteria.)*

| Field | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `state` | `string` | `"TX"` | Two-letter US state abbreviation (`TX`, `CA`, `NY`). |
| `city` | `string` | `"Austin"` | City name (`Austin`, `Dallas`, `Miami`). |
| `taxonomyDescription` | `string` | `"Dentist"` | Specialty or taxonomy description (`Dentist`, `Family Medicine`, `Physical Therapist`). |
| `postalCode` | `string` | `""` | Optional 5-digit ZIP or wildcard prefix (`78701`, `787*`). |
| `enumerationType` | `string` | `""` | Optional filter: `""` (All), `"NPI-1"` (Individual), or `"NPI-2"` (Organization). |
| `organizationName` | `string` | `""` | Optional practice/organization name filter (supports `*`). |
| `limit` | `integer` | `10` | Max deduplicated leads to return (`1`–`2000`). |
| `deduplicateByPractice` | `boolean` | `true` | Collapse multi-location orgs sharing name + state. |

***

### Example Output (Live Capture)

```json
{
  "npi": "1013125558",
  "enumerationType": "NPI-2",
  "status": "A",
  "providerName": "8118 DENTAL PROFESSIONALS PLLC",
  "organizationName": "8118 DENTAL PROFESSIONALS PLLC",
  "authorizedOfficial": "ERICA ELWARD",
  "authorizedOfficialTitle": "Partner/Dentist",
  "authorizedOfficialPhone": "512-452-8262",
  "primaryTaxonomyCode": "122300000X",
  "specialtyCategory": "Dental",
  "primarySpecialtyLabel": "Dentist",
  "practiceAddressLine": "8118 SHOAL CREEK",
  "practiceCity": "AUSTIN",
  "practiceState": "TX",
  "practiceZip": "78757",
  "practicePhone": "512-452-8262",
  "locationFax": "512-420-8265",
  "completenessScore": 80,
  "practiceSizeScore": 55,
  "leadQualityScore": 71,
  "practiceSizeTier": "SMALL_GROUP"
}
```

***

### AI Agent & MCP Integration

```json
{
  "mcpServers": {
    "apify": {
      "command": "npx",
      "args": ["-y", "@apify/actors-mcp-server", "--actors", "b2btoolstudio/npi-healthcare-lead-enricher"],
      "env": { "APIFY_TOKEN": "your_apify_token" }
    }
  }
}
```

#### Node.js / Python / Clay Usage

```javascript
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('b2btoolstudio/npi-healthcare-lead-enricher').call(
  { state: 'FL', city: 'Tampa', taxonomyDescription: 'Physical Therapist', limit: 100 },
  { maxTotalChargeUsd: 1.0 }
);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

***

### Transparent Pay-Per-Event Pricing

| Event | Price (USD) | Notes |
| :--- | :---: | :--- |
| Actor start (`apify-actor-start`) | `$0.00005` | Waives first 5 seconds of compute |
| Dataset result (`apify-default-dataset-item`) | `$0.002` | Charged per enriched, deduplicated lead |

Typical 100-lead prospecting list: **`~$0.20` total**.

***

### FAQ

**Why did a query with only `state` fail?**\
CMS NPPES v2.1 API enforces at least 2 filter criteria (e.g. `state` + `taxonomyDescription`, or `state` + `city`).

**Need a direct REST API or Remote MCP without an Apify account?**\
Explore [b2btoolstudio.com](https://b2btoolstudio.com) (`support@b2btoolstudio.com`).

# Actor input Schema

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

Two-letter US state abbreviation (e.g., TX, CA, NY).

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

City name (e.g., Austin, Dallas, Miami).

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

Provider specialty or taxonomy description (e.g., Dentist, Family Medicine, Physical Therapist).

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

5-digit ZIP code or wildcard prefix (e.g., 78701 or 787\*).

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

Filter by Individual (NPI-1) or Organization (NPI-2).

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

Organization or practice name filter (supports trailing wildcard \*).

## `limit` (type: `integer`):

Maximum number of deduplicated leads to return (1-2000). Automatically pages and shards when > 200.

## `deduplicateByPractice` (type: `boolean`):

Collapse duplicate NPIs and merge multi-location entries sharing the same normalized name and state.

## Actor input object example

```json
{
  "state": "TX",
  "city": "Austin",
  "taxonomyDescription": "Dentist",
  "enumerationType": "",
  "limit": 10,
  "deduplicateByPractice": true
}
```

# Actor output Schema

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

Flat CRM-ready dataset of deduplicated and scored CMS NPPES healthcare leads.

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

// Run the Actor and wait for it to finish
const run = await client.actor("b2btoolstudio/npi-healthcare-lead-enricher").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 = {
    "state": "TX",
    "city": "Austin",
    "taxonomyDescription": "Dentist",
    "limit": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("b2btoolstudio/npi-healthcare-lead-enricher").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 '{
  "state": "TX",
  "city": "Austin",
  "taxonomyDescription": "Dentist",
  "limit": 10
}' |
apify call b2btoolstudio/npi-healthcare-lead-enricher --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,b2btoolstudio/npi-healthcare-lead-enricher"
        }
    }
}
```

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/hxnPTr2uuvHR27vMr/builds/fNWCZ4wbfGfpzhCrW/openapi.json
