# National Provider Identifier Lookup & Search Tool (`dataspryva/national-provider-identifier-lookup-and-search`) Actor

Search US healthcare providers and organizations by name, state, city, ZIP, or specialty, or look up an exact National Provider Identifier number, and get practice address, phone, credentials, and status.

- **URL**: https://apify.com/dataspryva/national-provider-identifier-lookup-and-search.md
- **Developed by:** [Dataspryva](https://apify.com/dataspryva) (community)
- **Categories:** Automation, Lead generation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 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

## National Provider Identifier Lookup & Search Tool

Look up US healthcare providers and organizations the way medical billing, credentialing, and verification teams already do — by their 10-digit National Provider Identifier (NPI), or by name, location, and specialty. This actor reads the federal public registry that assigns NPIs to every individual provider and healthcare organization in the United States.

### What this actor does

- **Four search modes:** search individual providers, resolve one exact NPI number, search by specialty/taxonomy, or search organizations
- **Location narrowing:** filter by state, city, and ZIP code on any search mode
- **Full contact detail:** practice and mailing addresses, phone number, and credential/specialty data per provider
- **Both entity types:** individual providers (NPI-1) and organizations (NPI-2), filterable via `enumerationType`
- **Empty fields are omitted** — a provider record only includes the fields that registry actually has on file for them

### Output per provider

- `npi` — the 10-digit National Provider Identifier
- `entityType` — `individual` or `organization`
- `firstName`, `lastName` — individual provider's name
- `organizationName` — organization name
- `credential` — professional credential (e.g. `MD`, `DO`, `NP`)
- `gender` — `M` or `F`, for individual providers
- `primarySpecialty` — the provider's primary taxonomy/specialty
- `specialties` — every taxonomy/specialty on file for the provider
- `practiceAddress`, `practiceCity`, `practiceState`, `practiceZip` — practice location
- `practicePhone` — practice phone number
- `mailingAddress`, `mailingCity`, `mailingState` — mailing address, when it differs from practice
- `enumerationDate` — the date the NPI was first issued
- `certificationDate` — date of the most recent certification or update
- `status` — `A` (active) or `D` (deactivated)
- `url` — the provider's public registry profile page
- `scrapedAt` — when the record was fetched

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `searchProviders` | `searchProviders`, `lookupByNPI`, `searchBySpecialty`, or `searchByOrganization` |
| `firstName` | string | – | Provider first name (modes `searchProviders`, `searchBySpecialty`) |
| `lastName` | string | – | Provider last name (modes `searchProviders`, `searchBySpecialty`) |
| `organizationName` | string | – | Organization or group name (mode `searchByOrganization`) |
| `npiNumber` | string | – | Exact 10-digit NPI to resolve (mode `lookupByNPI`) |
| `specialtyDescription` | string | – | Free-text specialty/taxonomy to filter by, e.g. `Cardiology` |
| `state` | string | – | Two-letter US state code to filter providers by |
| `city` | string | – | City name to filter providers by |
| `postalCode` | string | – | 5-digit US ZIP code to filter providers by |
| `enumerationType` | string | – | `NPI-1` (individuals), `NPI-2` (organizations), or leave blank for both (mode `searchProviders`) |
| `maxItems` | integer | `50` | Maximum number of provider records to return (1–2000) |

#### Example: search individual providers by name and state

```json
{
  "mode": "searchProviders",
  "firstName": "John",
  "lastName": "Smith",
  "state": "CA",
  "maxItems": 50
}
```

#### Example: resolve an exact NPI number

```json
{
  "mode": "lookupByNPI",
  "npiNumber": "1234567890"
}
```

#### Example: search by specialty within a state

```json
{
  "mode": "searchBySpecialty",
  "specialtyDescription": "Cardiology",
  "state": "NY",
  "maxItems": 100
}
```

#### Example: search for an organization by name

```json
{
  "mode": "searchByOrganization",
  "organizationName": "Mayo Clinic",
  "state": "MN"
}
```

### Use cases

- **Healthcare lead generation** — build lists of providers or organizations by state and specialty
- **Provider directory maintenance** — refresh practice addresses and contact details against the registry
- **NPI verification** — confirm a provider's NPI, status, and credentials before onboarding or billing
- **Specialty market mapping** — see how many providers of a given specialty practice in a state or city
- **Research and analytics** — study provider distribution across geography and specialty

### FAQ

**Is this affiliated with CMS or the federal government?**
No. This is an independent, third-party actor that reads the publicly available NPI registry data; it is not affiliated with or endorsed by the Centers for Medicare & Medicaid Services.

**What is an NPI number?**
A National Provider Identifier is a unique 10-digit number assigned to every individual healthcare provider and healthcare organization in the US, required for HIPAA-covered transactions like insurance claims.

**Do I need a login or API key?**
No. The registry this actor reads is a free public database with no authentication required.

**Can I search for hospitals and clinics instead of individuals?**
Yes — use `mode: "searchByOrganization"` with `organizationName` to search group practices, hospitals, pharmacies, and other organizations.

**Why are some fields missing on a provider record?**
Not every provider's registration includes every field — older records in particular may lack a credential, phone number, or mailing address. The actor leaves those fields out rather than sending an empty value.

**Can I filter by ZIP code or city instead of state?**
Yes. `city` and `postalCode` work alongside `state` on every mode except `lookupByNPI`, which resolves a single exact record.

**What's the difference between `primarySpecialty` and `specialties`?**
`primarySpecialty` is the provider's main taxonomy classification. `specialties` lists every taxonomy/specialty on file for that provider, which can include more than one.

**How current is the data?**
The registry is updated regularly with new registrations and address changes, and each run reads it live, so results reflect what's published at run time.

# Actor input Schema

## `mode` (type: `string`):

What to search in the NPI Registry.

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

Provider first name (modes: searchProviders, searchBySpecialty).

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

Provider last name (modes: searchProviders, searchBySpecialty).

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

Organization or group name (mode=searchByOrganization).

## `npiNumber` (type: `string`):

10-digit National Provider Identifier.

## `specialtyDescription` (type: `string`):

Free-text taxonomy or specialty description to filter by, e.g. 'Internal Medicine', 'Family Practice', 'Cardiology'.

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

US state abbreviation to filter providers.

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

Filter results to providers in this city.

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

Filter results by 5-digit US ZIP code.

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

Filter by provider type. NPI-1 = individual providers, NPI-2 = organizations. Leave blank for all. Applies to mode=searchProviders.

## `maxItems` (type: `integer`):

Maximum number of provider records to return.

## Actor input object example

```json
{
  "mode": "searchProviders",
  "firstName": "John",
  "lastName": "Smith",
  "state": "CA",
  "enumerationType": "",
  "maxItems": 50
}
```

# Actor output Schema

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

Dataset containing all scraped NPI Registry healthcare providers.

# 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 = {
    "mode": "searchProviders",
    "firstName": "John",
    "lastName": "Smith",
    "state": "CA",
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("dataspryva/national-provider-identifier-lookup-and-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 = {
    "mode": "searchProviders",
    "firstName": "John",
    "lastName": "Smith",
    "state": "CA",
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("dataspryva/national-provider-identifier-lookup-and-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 '{
  "mode": "searchProviders",
  "firstName": "John",
  "lastName": "Smith",
  "state": "CA",
  "maxItems": 50
}' |
apify call dataspryva/national-provider-identifier-lookup-and-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dataspryva/national-provider-identifier-lookup-and-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/S9wvGoIaOTHkCI3hD/builds/6nNoA7ynjgv4Gt66N/openapi.json
