# NPI Registry Lookup — Deactivated vs Never-Issued Check (`malekh/npi-registry-lookup-deactivation-check`) Actor

Batch NPI lookup that returns a verdict instead of a silence: ACTIVE with provider detail, DEACTIVATED with the CMS deactivation date, NEVER\_ISSUED, or INVALID\_FORMAT. The NPPES API removes deactivated NPIs instead of flagging them, so it answers both identically — this joins the CMS file.

- **URL**: https://apify.com/malekh/npi-registry-lookup-deactivation-check.md
- **Developed by:** [Malek H](https://apify.com/malekh) (community)
- **Categories:** Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## NPI Registry Lookup — Deactivated vs Never-Issued Check

Batch **NPI registry lookup** that returns a verdict instead of a silence.

Submit a list of NPIs. Every one comes back resolved into one of four states:

| Verdict | Meaning |
|---|---|
| `ACTIVE` | Live in the NPPES registry, returned with name, entity type, credential, primary taxonomy, licence number and state, and practice location |
| `DEACTIVATED` | CMS deactivated this NPI — returned **with the CMS deactivation date** |
| `NEVER_ISSUED` | Structurally a valid NPI, but CMS has never issued it and never deactivated it |
| `INVALID_FORMAT` | Not a possible NPI: fails the 80840-prefixed check digit, or is not ten digits |

### Why this needs two sources

**CMS does not flag a deactivated NPI in the registry API. It removes it.**

That single fact is why an NPI lookup built on the registry API alone cannot
answer the question buyers actually have. Two consequences follow, and both are
measurable against the source:

1. **`basic.status` is a constant.** Sampled 1,400 live NPPES API records on
   2026-08-06: 1,400 of 1,400 return `"A"`. A status column fed by that
   endpoint is structurally incapable of ever saying anything else.
2. **The API's answer for a deactivated provider is silence** — `result_count: 0`,
   byte-identical to its answer for a number that was never issued at all.

You can check this yourself without running anything. These NPIs are in the
[CMS Monthly NPI Deactivation File](https://download.cms.gov/nppes/NPI_Files.html):

| NPI | CMS deactivation date |
|---|---|
| 1982883625 | 2023-11-29 |
| 1366509945 | 2020-08-17 |
| 1003027293 | 2016-02-01 |

Query any of them against
`https://npiregistry.cms.hhs.gov/api/?version=2.1&number=1982883625` and you get
`{"result_count": 0, "results": []}` — no reason, no date, and exactly the same
response as an unissued number.

This Actor joins the registry API to the CMS deactivation file (349,557 rows as
of 2026-07-13, published monthly on a different host) so the difference is
visible. That difference is not academic:

- Submitting a claim under a **deactivated** NPI is a hard denial — remediation
  is re-credentialing or a corrected claim.
- A **never-issued** NPI in your file is a data-entry error — remediation is
  fixing the number.
- Credentialing a provider against a deactivated NPI is a payer-audit finding.

### Input

```json
{
  "npis": ["1366148975", "1982883625", "1003027293", "1234567890"]
}
```

Up to 5,000 NPIs per run. Spaces, dashes and stray punctuation are stripped, so
you can paste straight out of a claims file or a credentialing export.

### Output

One row per NPI:

```json
{
  "inputValue": "1982883625",
  "npi": "1982883625",
  "verdict": "DEACTIVATED",
  "isActive": false,
  "deactivationDate": "2023-11-29",
  "checkDigitValid": true,
  "guidance": "CMS deactivated this NPI. It is absent from the registry API entirely -- claims submitted under it will deny and credentialing against it will not stand up to a payer audit.",
  "providerName": null,
  "entityType": null,
  "primaryTaxonomy": null,
  "licenseNumber": null,
  "licenseState": null,
  "city": null,
  "state": null,
  "checkedAt": "2026-08-06T06:15:59+00:00",
  "deactivationFileAsOf": "2026-07-13",
  "deactivationFileRows": 349557
}
```

An `ACTIVE` row carries the provider detail instead: `providerName`,
`entityType`, `credential`, `enumerationDate`, `lastUpdated`,
`primaryTaxonomy`, `primaryTaxonomyCode`, `licenseNumber`, `licenseState`,
`city`, `state`, `postalCode`.

Every row states `deactivationFileAsOf` — the CMS file's own as-of date — so you
always know the vintage of the answer rather than having to assume it.

#### Reactivation

An NPI that was deactivated and later reactivated is live in the registry *and*
present in the cumulative CMS file. Those rows come back `ACTIVE` with
`previouslyDeactivated: true` and `priorDeactivationDate` set — the registry
wins, and the history is surfaced beside it rather than silently dropped.

### Freshness — the run aborts rather than guessing

The CMS deactivation file is published monthly and its filename embeds a date,
so it has to be discovered from the CMS index page. If that discovery or the
file itself looks wrong, **the run fails loudly and returns no rows**. It never
degrades into "no deactivations found", because every one of these failures
would silently reclassify deactivated NPIs as never issued:

- no deactivation ZIP link on the CMS index page
- header row is not exactly `NPI` / `NPPES Deactivation Date`
- fewer than 300,000 data rows (the file is cumulative since 2005 and never
  shrinks)
- the file's own as-of date is more than 75 days old — two fully missed monthly
  releases

A wrong answer delivered confidently is worse than no answer.

### Sources

Both are keyless US federal public-domain data:

- **NPPES registry API v2.1** — `https://npiregistry.cms.hhs.gov/api/`
- **CMS Monthly NPI Deactivation File** —
  `https://download.cms.gov/nppes/NPI_Files.html`

No API key, no account, no scraping of a login-gated site.

### Pricing

Pay per event:

- **Deactivation file load** — once per run, covering the download and indexing
  of the full CMS deactivation file. Charged only once the file is in hand, so
  an aborted run costs you nothing.
- **NPI checked** — per NPI checked against the registry. NPIs rejected on the
  check digit alone are not charged.

# Actor input Schema

## `npis` (type: `array`):

The 10-digit NPI numbers to check, up to 5,000 per run. Spaces, dashes and stray punctuation are stripped, so you can paste straight out of a claims file or credentialing export. Every NPI comes back with one of four verdicts: ACTIVE, DEACTIVATED (with the CMS deactivation date), NEVER\_ISSUED, or INVALID\_FORMAT.

## Actor input object example

```json
{
  "npis": [
    "1366148975",
    "1982883625",
    "1003027293",
    "1234567890"
  ]
}
```

# 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 = {
    "npis": [
        "1366148975",
        "1982883625",
        "1003027293",
        "1234567890"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("malekh/npi-registry-lookup-deactivation-check").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 = { "npis": [
        "1366148975",
        "1982883625",
        "1003027293",
        "1234567890",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("malekh/npi-registry-lookup-deactivation-check").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 '{
  "npis": [
    "1366148975",
    "1982883625",
    "1003027293",
    "1234567890"
  ]
}' |
apify call malekh/npi-registry-lookup-deactivation-check --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,malekh/npi-registry-lookup-deactivation-check"
        }
    }
}

```

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/l6g5eyGrjXwRULRev/builds/ZIYoqOTyVhstmmO5b/openapi.json
