# NPI Healthcare Provider Search (NPPES Registry, no 1,200 cap) (`publicrecords-lab/npi-provider-search`) Actor

Search the official CMS NPPES NPI Registry by specialty, state, city, ZIP, name or NPI. Automatically splits big searches to get past the registry's 1,200-result limit, removes duplicates, and returns clean flat rows with address, phone, specialty, license and more.

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

## Pricing

from $1.50 / 1,000 provider returneds

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 Provider Search — NPPES Registry without the 1,200-result limit

Search the **official CMS NPPES NPI Registry** for doctors, dentists, nurse practitioners, therapists, pharmacies, clinics and every other US healthcare provider — by **specialty, state, city, ZIP code, name or NPI number** — and get back **clean, flat, deduplicated rows** ready for a spreadsheet or CRM.

The public registry API stops at **1,200 results per query**. This Actor detects when a query hits that cap and **automatically splits it** (by ZIP prefix, then provider type, then name prefix) until every slice fits, then merges and deduplicates the results. Example: *"Cardiovascular Disease" in California* returns **4,912 providers** instead of 1,200.

### What you can do with it

- **Build provider lead lists**: every dentist in Texas, every physical therapist in ZIP 021xx, all pharmacies in Chicago.
- **Find newly enumerated providers**: new NPIs issued in the last 30/90 days — new practices, new graduates, new clinics.
- **Enrich or verify a list of NPIs**: paste NPI numbers and get name, specialty, license, address and phone back.
- **Market sizing & research**: count providers by specialty and region with complete (not capped) results.
- **Credentialing & compliance checks**: active status, taxonomy codes, license numbers and states.

### Input

| Field | What it does |
|---|---|
| **Specialties** | Taxonomy descriptions as used by the registry, e.g. `Cardiovascular Disease`, `Dentist`, `Nurse Practitioner`, `Physical Therapist`, `Pharmacy`. Use a trailing `*` for prefix matches (`Psych*`). |
| **States** | 2-letter codes. Each specialty × state combination runs as its own search. |
| **City**, **ZIP codes or prefixes** | `Boston`; `02139` or `021*` (2+ digits). |
| **Provider type** | Any, individuals (NPI-1) or organizations (NPI-2). |
| **First / last / organization name** | Exact, or 2+ characters followed by `*`. |
| **Location fields match on** | Practice location (default), mailing, primary, secondary or any address. |
| **NPI numbers to look up** | Direct lookups (enrichment). |
| **Advanced: list of searches** | A JSON array of different searches, e.g. `[{"specialty":"Dentist","city":"Austin","state":"TX"},{"organizationName":"Kaiser*","state":"CA"}]` |
| **Filters** | Primary specialty must match · main practice address must be in the searched state · NPI issued within N days / after a date · updated within N days · active only |
| **Limits** | Max providers to output (default 1,000; 0 = unlimited) · auto-split on/off · request budget per search · politeness settings |

The registry requires something more specific than a state alone — add a specialty, city, ZIP or name.

### Output

One row per provider (NPI). Main fields:

`npi`, `entityType`, `name`, `firstName`, `lastName`, `credential`, `organizationName`, `authorizedOfficialName` / `Title` / `Phone`, `status`, `enumerationDate`, `lastUpdated`, `primaryTaxonomyCode`, `primaryTaxonomy`, `primaryTaxonomyLicense`, `primaryTaxonomyLicenseState`, `specialties`, `taxonomies[]`, `practiceAddress` (one line) plus `practiceAddress1/2`, `practiceCity`, `practiceState`, `practiceZip`, `practicePhone`, `practiceFax`, `mailingAddress` …, `otherPracticeLocations[]`, `otherNames[]`, `identifiers[]`, `directMessagingAddress`, `endpoints[]`, `registryUrl`, `searchLabel`.

Ready-made dataset views: **Providers** (overview), **Contact list** (name, address, phone, fax, official) and **Specialties & licenses**. Export to CSV, Excel, JSON or connect via API / integrations.

Example row (abridged):

```json
{
  "npi": "1538568928",
  "entityType": "Organization",
  "name": "MAYO CLINIC",
  "primaryTaxonomy": "Clinic/Center, Multi-Specialty",
  "practiceAddress": "200 1ST ST SW, ROCHESTER, MN 55905-0001",
  "practicePhone": "507-284-2511",
  "authorizedOfficialName": "DENNIS DAHLEN",
  "authorizedOfficialTitle": "Chief Financial Officer",
  "enumerationDate": "2014-08-21",
  "registryUrl": "https://npiregistry.cms.hhs.gov/provider-view/1538568928"
}
```

A **run summary** (`RUN_SUMMARY` in the key-value store) shows, per search, how many providers were found, how many passed your filters, registry requests made, how many times the 1,200 cap was hit and split, and whether the search is **complete**.

### How the 1,200-result limit is handled

1. Each query is fetched page by page (200 per page). If the 1,200th result exists, the query is "capped".
2. A capped query is split by **ZIP prefix** (`00*`…`99*`, then 3, 4 and 5 digits), then by **provider type**, then by **name prefix** (`AA*`…`ZZ*`), recursively.
3. All slices are merged and **deduplicated by NPI**.

Splitting by ZIP is fast and exact. The name-prefix step is only needed when a *single ZIP code* has more than 1,200 matches (e.g. every provider in a big hospital ZIP with no specialty filter) — it can take a few thousand requests, so it is bounded by *Max registry requests per search* and the summary marks such a search as `partial` if the budget runs out. Adding a specialty avoids this almost always.

### Pricing (pay per event)

| Event | Price |
|---|---|
| Search started (each valid specialty/location/name search, or one batch of NPI lookups) | **$0.003** |
| Provider row returned | **$0.0015** |

You only pay for rows you receive: duplicates removed across searches and providers excluded by your filters are **not** charged, and searches the registry rejects are **not** charged. Examples:

- Cardiologists in Rhode Island (262 providers): 1 × $0.003 + 262 × $0.0015 ≈ **$0.40**
- 1,000 dentists in Texas (default cap): ≈ **$1.50**
- All 4,912 cardiologists in California: ≈ **$7.37**
- New NPIs in the last 30 days for 3 specialties in one state (say 60 rows): ≈ **$0.10**

Use *Max providers to output* or the run's maximum charge setting to cap spend.

### Good to know

- Data comes live from the public NPPES NPI Registry API (CMS). It is updated by providers themselves; addresses and phones can be out of date. Deactivated NPIs are generally not returned by the registry.
- Specialty matching follows the registry: a provider matches if **any** of their taxonomies matches. Turn on *Primary specialty must match* to keep only providers whose primary taxonomy matches.
- Location searches also match providers who list a *secondary* practice location in the area (shown in `otherPracticeLocations`). Turn on *Main practice address must be in the searched state* to drop them.
- Name searches in the registry also match other/former names, so a few rows may not literally contain the name you typed.
- Date filters (NPI issued / updated within N days) are applied after retrieval because the registry can't filter by date — use them with focused searches.
- The Actor is polite to the public registry: at most 3 parallel requests and ~4 requests per second by default, with retries and back-off.
- This Actor is not affiliated with or endorsed by CMS or HHS. NPI data is public information published by CMS; use it in line with applicable laws (e.g. telemarketing and anti-spam rules).

### FAQ

**Why does a specialty return nothing / an error?** The registry only accepts taxonomy descriptions it knows (e.g. `Dentist`, `General Practice`, `Cardiovascular Disease`). Check the spelling as shown on npiregistry.cms.hhs.gov, or use a prefix with `*`.

**Can I get emails?** The registry doesn't publish email addresses. When a provider has published a Direct secure messaging address it is returned in `directMessagingAddress`.

**Can I schedule it?** Yes — schedule a run (e.g. weekly with *NPI issued within 7 days*) to get a feed of newly registered providers.

# Actor input Schema

## `specialties` (type: `array`):

NUCC taxonomy description as used by the NPI Registry, e.g. 'Cardiovascular Disease', 'Dentist', 'Nurse Practitioner', 'Physical Therapist', 'Pharmacy'. A trailing \* matches by prefix (e.g. 'Psych\*'). Each specialty is searched separately (and combined with each state / ZIP below).

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

2-letter state codes (e.g. CA, NY). Each state is a separate search. The registry needs another criterion besides state (specialty, city, ZIP or name).

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

Optional city name, e.g. 'Boston'.

## `postalCodes` (type: `array`):

5-digit ZIP codes or prefixes of 2+ digits (e.g. '021' or '021\*' = all ZIPs starting 021). Each entry is a separate search.

## `entityType` (type: `string`):

Restrict to individual providers (NPI-1) or organizations (NPI-2).

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

Individuals only. Exact, or 2+ letters followed by \* for prefix match.

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

Individuals only. Exact, or 2+ letters followed by \*.

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

Organizations only, e.g. 'Mayo\*'. Exact, or 2+ characters followed by \*.

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

Which address the state / city / ZIP criteria apply to.

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

Optional 2-letter country code for providers with foreign addresses.

## `npiNumbers` (type: `array`):

Optional list of 10-digit NPI numbers to fetch directly (enrichment mode). Can be combined with searches.

## `searches` (type: `array`):

Run many different searches in one go. Each object can have: specialty, state, city, postalCode, entityType, firstName, lastName, organizationName, addressPurpose, countryCode, label. Example: \[{"specialty":"Dentist","city":"Austin","state":"TX"},{"organizationName":"Kaiser\*","state":"CA"}]

## `primarySpecialtyOnly` (type: `boolean`):

The registry matches a specialty listed anywhere on a provider's record. Turn this on to keep only providers whose PRIMARY taxonomy matches the searched specialty.

## `primaryLocationInStateOnly` (type: `boolean`):

The registry also matches providers who list a secondary practice location in the state. Turn on to keep only providers whose main practice address is in the searched state.

## `enumeratedWithinDays` (type: `integer`):

Keep only providers whose NPI was issued recently - great for finding newly licensed / newly opened practices. Note: the full search still runs (the registry can't filter by date), so this works best with focused searches.

## `enumeratedAfter` (type: `string`):

Keep only providers whose NPI was issued on or after this date.

## `updatedWithinDays` (type: `integer`):

Keep only providers whose registry record changed in the last N days.

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

Skip deactivated NPIs.

## `dedupe` (type: `boolean`):

Each NPI is output (and charged) once per run, even if several searches find it.

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

Stop after this many provider rows in total (0 = no limit). Protects your budget on very broad searches.

## `autoSplit` (type: `boolean`):

The registry returns at most 1,200 results per query. When a query hits that cap, the Actor re-runs it by ZIP prefix, then provider type, then name prefix, and merges the results.

## `maxApiRequestsPerSearch` (type: `integer`):

Safety cap on splitting work for one search. If reached, the run summary marks that search as partial.

## `maxConcurrency` (type: `integer`):

Parallel requests to the registry (be polite; 3 is plenty).

## `requestIntervalSecs` (type: `number`):

Polite spacing between requests to the public registry.

## Actor input object example

```json
{
  "specialties": [
    "Cardiovascular Disease"
  ],
  "states": [
    "RI"
  ],
  "entityType": "any",
  "addressPurpose": "LOCATION",
  "primarySpecialtyOnly": false,
  "primaryLocationInStateOnly": false,
  "activeOnly": true,
  "dedupe": true,
  "maxResults": 1000,
  "autoSplit": true,
  "maxApiRequestsPerSearch": 2000,
  "maxConcurrency": 3,
  "requestIntervalSecs": 0.25
}
```

# Actor output Schema

## `providers` (type: `string`):

Flattened provider rows; fields described in the dataset schema.

## `contacts` (type: `string`):

Name, address, phone, fax and official per provider.

## `runSummary` (type: `string`):

Per-search counts, registry requests, cap hits auto-split and completeness.

# 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 = {
    "specialties": [
        "Cardiovascular Disease"
    ],
    "states": [
        "RI"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("publicrecords-lab/npi-provider-search").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 = {
    "specialties": ["Cardiovascular Disease"],
    "states": ["RI"],
}

# Run the Actor and wait for it to finish
run = client.actor("publicrecords-lab/npi-provider-search").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 '{
  "specialties": [
    "Cardiovascular Disease"
  ],
  "states": [
    "RI"
  ]
}' |
apify call publicrecords-lab/npi-provider-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,publicrecords-lab/npi-provider-search"
        }
    }
}
```

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/u1R8wVNufg37XsJ9X/builds/taLNBRD690TTYRzNi/openapi.json
