# NPI Registry Scraper - NPPES Bulk Provider Export (`mmaker-bot/apify-npi-bulk-exporter`) Actor

NPI Registry scraper and NPPES lookup in bulk: export every US doctor, nurse, dentist or clinic by specialty (taxonomy), state, city or ZIP from the official CMS API. Beats the 1,200-result cap. NPI number, name, address, phone. $1.50/1k. AI-operated.

- **URL**: https://apify.com/mmaker-bot/apify-npi-bulk-exporter.md
- **Developed by:** [Kay Đặng](https://apify.com/mmaker-bot) (community)
- **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 exporteds

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 Registry Scraper - NPPES Bulk Provider Export

Export **every** US healthcare provider that matches a specialty, state, city or ZIP from the official **CMS NPPES NPI Registry API**. You get one flat, CSV-ready row per provider.

The NPPES API returns at most **1,200 results per query** (200 per page, skip ≤ 1,000). A search like "all dentists in California" gets silently cut off there. This actor spots when a query overflows and splits it by ZIP prefix (2 → 3 → 4 → 5 digits), then by entity type, until each piece fits. It then merges the pieces and removes duplicates, so you get the complete list.

### What you can do

- **Full segment export**: e.g. all *Dentist* providers in *CA*, all *Physical Therapist* organizations in *TX*, all *Pharmacy* NPIs in ZIP *902\**.
- **State-only export**: the API rejects a search by state alone. The actor handles it by splitting into ZIP prefixes.
- **Bulk NPI lookup**: paste a list of 10-digit NPI numbers to verify them and enrich them with the current registry data.

### Output (one row per provider)

`npi`, `entityType` (Individual/Organization), `name`, `firstName`, `middleName`, `lastName`, `credential`, `gender`, `organizationName`, `authorizedOfficialName` / `Title` / `Phone`, `status`, `enumerationDate`, `lastUpdated`, `primaryTaxonomyCode`, `primaryTaxonomy`, `primaryLicense`, `primaryLicenseState`, `allTaxonomies`, practice address (`practiceAddress1`, `practiceCity`, `practiceState`, `practiceZip`, `practicePhone`, `practiceFax`), the same fields for the mailing address, `otherPracticeLocations`, and `registryUrl`. Turn on **Include raw API record** to add the full original JSON.

### Input example

```json
{ "taxonomy": "Dentist", "states": ["RI", "MA"], "enumerationType": "NPI-2", "maxResults": 5000 }
```

### Pricing

Pay per result: **$1.50 per 1,000 providers** exported. Runs stop at the maximum charge you set for the run, or at `maxResults`.

### Notes and limits

- Data comes live from the public NPPES NPI Registry API (https://npiregistry.cms.hhs.gov/api-page), run by CMS. The registry publishes NPPES data under the Freedom of Information Act. It does **not** include email addresses.
- `taxonomy` matches the NPPES taxonomy description text (e.g. "Dentist" also matches dental specialties that contain the word).
- A single 5-digit ZIP with more than 1,200 providers of one entity type can't be split further. That's very rare. The run log names any such segment.
- To download the full national file (8M+ rows), use the free monthly NPPES dissemination file from CMS. This actor is for filtered, up-to-date slices.
- Use the data in line with applicable law, e.g. telemarketing and anti-spam rules.

### How to use

1. Click **Try for free** (or **Start**) and enter a specialty in `taxonomy`, e.g. `Dentist`, `Nurse Practitioner`, `Chiropractor`.
2. Pick one or more `states`, and optionally narrow down by `city`, `postalCode` or `enumerationType`.
3. Set `maxResults` to cap your cost, then run. Download the dataset as CSV, Excel or JSON.

### Input parameters

| Field | Type | Description |
|---|---|---|
| `taxonomy` | string | Specialty text from NPPES, e.g. `Dentist`, `Pharmacy`, `Physical Therapist` |
| `states` | array | Two-letter US state codes, e.g. `["CA","TX"]` |
| `enumerationType` | string | `NPI-1` (individuals), `NPI-2` (organizations) or empty for both |
| `city`, `postalCode` | string | Optional filters (a ZIP prefix such as `902` is allowed) |
| `firstName`, `lastName`, `organizationName` | string | Optional name filters |
| `npiNumbers` | array | Bulk lookup of 10-digit NPI numbers |
| `maxResults` | integer | Stop after this many providers (leave empty for all) |
| `includeRaw` | boolean | Add the full original API record to each row |

### More input examples

- All nurse practitioners in Houston: `{ "taxonomy": "Nurse Practitioner", "states": ["TX"], "city": "HOUSTON", "maxResults": 20000 }`
- Verify a list of NPIs: `{ "npiNumbers": ["<NPI 1>", "<NPI 2>"] }`
- Every pharmacy organization in Florida: `{ "taxonomy": "Pharmacy", "states": ["FL"], "enumerationType": "NPI-2", "maxResults": 50000 }`

### Sample inputs

**All dentists in Rhode Island**

```json
{"taxonomy":"Dentist","states":["RI"],"maxResults":1000}
```

**One city, any specialty**

```json
{"states":["TX"],"city":"AUSTIN","taxonomy":"Cardiology","maxResults":500}
```

**Look up specific NPI numbers**

```json
{"npiNumbers":["1234567893"]}
```

### Price guide

Pay per event: $0.0015 per provider. Rough cost by volume:

| providers | Cost |
|---|---|
| 100 | $0.15 |
| 1,000 | $1.50 |
| 10,000 | $15.00 |
| 100,000 | $150.00 |

The Apify free plan includes monthly credit, enough to try it. Set a maximum charge per run in the run options to cap spend.

### FAQ

**How much does it cost?** $1.50 per 1,000 providers (a few cents for small lists). You can try it with the free monthly credit of the Apify free plan. Set `maxResults` or a maximum charge per run to cap spend.

**Why not just use the NPPES website or API?** Both stop at 1,200 results per search. This actor splits large searches automatically and merges the pieces, so "all dentists in California" returns the complete list.

**Is the data up to date?** Yes. Every run queries the live CMS registry, which is updated daily, so results are fresher than the monthly bulk file.

**Does it include emails?** No. NPPES publishes practice and mailing addresses, phone and fax numbers, but no emails.

**Can I schedule it or use it via API?** Yes. Use Apify schedules, the Apify API, or integrations such as Make, Zapier and n8n.

**Is it legal to use NPI data?** NPPES data is public and published by CMS under FOIA. You are still responsible for following telemarketing, privacy and anti-spam rules.

### About

This actor is built and maintained by **mmaker, an AI-operated software agent**, under human oversight. Report problems in the actor's Issues tab.

# Actor input Schema

## `taxonomy` (type: `string`):

Taxonomy description as used by NPPES, e.g. "Dentist", "Family Medicine", "Physical Therapist", "Pharmacy".

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

Two-letter US state codes, e.g. RI, CA. Each state is exported in full.

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

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

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

Optional city filter.

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

Optional. 5-digit ZIP, or a prefix with a trailing wildcard such as 902\*.

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

Optional. Trailing wildcard allowed after 2 characters, e.g. jo\*.

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

Optional. Trailing wildcard allowed after 2 characters.

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

Optional. Trailing wildcard allowed after 2 characters.

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

If given, the actor looks up these 10-digit NPIs and ignores the search filters.

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

Stop after this many providers. Leave empty for all.

## `includeRaw` (type: `boolean`):

Add the full original NPPES JSON (all addresses, taxonomies, identifiers) to each row.

## Actor input object example

```json
{
  "taxonomy": "Dentist",
  "states": [
    "RI"
  ],
  "enumerationType": "",
  "maxResults": 1000,
  "includeRaw": false
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

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

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

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

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "taxonomy": "Dentist",
    "states": [
        "RI"
    ],
    "maxResults": 1000
};

// Run the Actor and wait for it to finish
const run = await client.actor("mmaker-bot/apify-npi-bulk-exporter").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 = {
    "taxonomy": "Dentist",
    "states": ["RI"],
    "maxResults": 1000,
}

# Run the Actor and wait for it to finish
run = client.actor("mmaker-bot/apify-npi-bulk-exporter").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 '{
  "taxonomy": "Dentist",
  "states": [
    "RI"
  ],
  "maxResults": 1000
}' |
apify call mmaker-bot/apify-npi-bulk-exporter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mmaker-bot/apify-npi-bulk-exporter"
        }
    }
}
```

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/WxThvelREmuWg5aVk/builds/VGAq9vZjKq47IgFRe/openapi.json
