Skip to content

NPI lookup

POST /npi checks a National Provider Identifier's check digit and reads its NPPES record: name, credential, specialty, license, addresses and status, or searches by name.

POSThttps://api.qelka.com/v1/npi

Look up a National Provider Identifier (NPI), the 10-digit number every US health care provider uses on claims, or find one from a provider's name: you get the record the provider filed with NPPES, the national registry run by the Centers for Medicare & Medicaid Services (CMS), with name, credential, specialties, licenses, practice and mailing addresses, and status. Each lookup costs 1 credit, found or not; errors and test keys are never billed.

Request

Send either npi or name, never both.

npistring
The NPI to look up: 10 digits, sent as 1 to 20 characters. Spaces and dashes are removed.
namestring
A provider name to search, 2 to 120 characters: a person, as first name then last name or as Last, First, or an organization. Up to 10 matches are returned, best first, and the full record of the best one.
statestring
Two-letter US state code, in any case, that narrows a name search to providers with an address in that state. Only with name.
provider_typestringDefault any
Name search only: individual searches NPI-1 records (people), organization searches NPI-2 records (organizations, groups, facilities), any searches both.
freshbooleanDefault false
true skips the 7-day result cache and asks NPPES again.

A body with both npi and name, with neither, or with state but no name is a 400 invalid_request. The call waits for the NPPES API, so every snippet sets a 30-second client timeout.

curl https://api.qelka.com/v1/npi \
  --max-time 30 \
  -H "Authorization: Bearer $QELKA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"npi": "1003000126"}'
const response = await fetch('https://api.qelka.com/v1/npi', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.QELKA_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ npi: '1003000126' }),
  signal: AbortSignal.timeout(30_000),
})
const result = await response.json()
console.log(result)
import os

import requests

api_key = os.environ["QELKA_API_KEY"]
response = requests.post(
    "https://api.qelka.com/v1/npi",
    headers={"Authorization": f"Bearer {api_key}"},
    json={"npi": "1003000126"},
    timeout=30,
)
result = response.json()
print(result)
<?php
$ch = curl_init('https://api.qelka.com/v1/npi');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('QELKA_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode(['npi' => '1003000126']),
    CURLOPT_TIMEOUT => 30,
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
	"os"
	"time"
)

func main() {
	payload, _ := json.Marshal(map[string]any{"npi": "1003000126"})
	request, _ := http.NewRequest(http.MethodPost, "https://api.qelka.com/v1/npi", bytes.NewReader(payload))
	request.Header.Set("Authorization", "Bearer "+os.Getenv("QELKA_API_KEY"))
	request.Header.Set("Content-Type", "application/json")

	client := &http.Client{Timeout: 30 * time.Second}
	response, err := client.Do(request)
	if err != nil {
		panic(err)
	}
	defer response.Body.Close()

	var result map[string]any
	if err := json.NewDecoder(response.Body).Decode(&result); err != nil {
		panic(err)
	}
	fmt.Println(result)
}
require 'json'
require 'net/http'

uri = URI('https://api.qelka.com/v1/npi')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = "Bearer #{ENV.fetch('QELKA_API_KEY')}"
request['Content-Type'] = 'application/json'
request.body = JSON.generate({ npi: '1003000126' })

response = Net::HTTP.start(uri.host, uri.port, use_ssl: true, read_timeout: 30) do |http|
  http.request(request)
end
result = JSON.parse(response.body)
puts result

Response

Every lookup gets a 200, found or not. Read status first: found, not_found or invalid.

idstring
Identifier of this lookup: lkp_ followed by 26 characters.
objectstring
Always npi.
inputstring
The npi or name you sent, without surrounding spaces.
querystring
npi or name: how the lookup was made.
validboolean or null
true when the NPI has 10 digits, starts with 1 or 2 and has a correct check digit, false when it does not. null for a name search.
statusstring
found, not_found or invalid.
reasonstring or null
Why no record is returned: invalid_format, invalid_check_digit, not_in_nppes or no_match. null when one is found.
providerobject or null
The provider record: the NPI looked up, or the best match of a name search.
provider.npistring
The NPI, 10 digits.
provider.typestring
individual for an NPI-1 (a person), organization for an NPI-2.
provider.namestring
Display name: first, middle and last name followed by the credential, or the organization name.
provider.first_namestring or null
Individuals only.
provider.middle_namestring or null
Individuals only.
provider.last_namestring or null
Individuals only.
provider.credentialstring or null
Credential as the provider wrote it, such as M.D. or RN. Individuals only.
provider.organization_namestring or null
Organizations only.
provider.sole_proprietorboolean or null
Whether the individual reported being a sole proprietor. null for organizations or when not reported.
provider.statusstring
active or deactivated. The NPPES API only publishes active NPIs, so a deactivated NPI is answered not_found.
provider.enumeration_datestring or null
Date the NPI was assigned, YYYY-MM-DD.
provider.last_updatedstring or null
Date the record last changed, YYYY-MM-DD.
provider.certification_datestring or null
Date the provider last certified the record, YYYY-MM-DD.
provider.primary_taxonomyobject or null
The specialty the provider marked as primary, or the first one listed when none is marked. Same fields as provider.taxonomies.
provider.taxonomiesarray of objects
Every specialty reported, with the license that goes with it.
provider.taxonomies.codestring
Health Care Provider Taxonomy code, such as 207R00000X.
provider.taxonomies.descriptionstring or null
The specialty the code stands for, such as Internal Medicine.
provider.taxonomies.primaryboolean
true for the primary specialty.
provider.taxonomies.statestring or null
State that issued the license reported with this specialty.
provider.taxonomies.licensestring or null
License number reported with this specialty.
provider.location_addressobject or null
The primary practice location.
provider.location_address.linesarray of strings
Street lines.
provider.location_address.citystring or null
City.
provider.location_address.statestring or null
State code.
provider.location_address.postal_codestring or null
ZIP code, written 12345-6789 when NPPES has nine digits.
provider.location_address.countrystring or null
ISO 3166-1 alpha-2 code.
provider.location_address.phonestring or null
Phone number.
provider.location_address.faxstring or null
Fax number.
provider.mailing_addressobject or null
The mailing address, with the same fields as location_address.
provider.practice_locationsinteger
Number of secondary practice locations reported.
provider.other_namesarray of objects
Other names on the record, such as a former name or a doing-business-as name.
provider.other_names.typestring or null
The kind of name, as NPPES labels it.
provider.other_names.namestring
The name.
provider.authorized_officialobject or null
Organizations only: the person who signed the NPI application for the organization.
provider.authorized_official.namestring
Name of the official.
provider.authorized_official.titlestring or null
Title or position.
matchesarray of objects or null
For a name search: up to 10 candidates, best first. null for a lookup by NPI.
matches.npistring
NPI of the candidate.
matches.typestring
individual or organization.
matches.namestring
First and last name, or organization name.
matches.credentialstring or null
Credential.
matches.primary_taxonomystring or null
Description of the primary specialty.
matches.citystring or null
City of the practice location.
matches.statestring or null
State of the practice location.
credits_usedinteger
Credits debited for this call: 1 with a live key, 0 with a test key.
cachedboolean
true when the answer came from the 7-day cache.

The provider in this example reported five taxonomy and license pairs; two are shown.

Response
{
  "id": "lkp_01M8CFQ9KB0CNKCG2MQB3RDZ6N",
  "object": "npi",
  "input": "1003000126",
  "query": "npi",
  "valid": true,
  "status": "found",
  "reason": null,
  "provider": {
    "npi": "1003000126",
    "type": "individual",
    "name": "ARDALAN ENKESHAFI, M.D.",
    "first_name": "ARDALAN",
    "middle_name": null,
    "last_name": "ENKESHAFI",
    "credential": "M.D.",
    "organization_name": null,
    "sole_proprietor": false,
    "status": "active",
    "enumeration_date": "2007-08-31",
    "last_updated": "2026-11-17",
    "certification_date": "2026-11-17",
    "primary_taxonomy": {
      "code": "208M00000X",
      "description": "Hospitalist",
      "primary": true,
      "state": "DC",
      "license": "MD600003480"
    },
    "taxonomies": [
      {
        "code": "208M00000X",
        "description": "Hospitalist",
        "primary": true,
        "state": "DC",
        "license": "MD600003480"
      },
      {
        "code": "207R00000X",
        "description": "Internal Medicine",
        "primary": false,
        "state": "VA",
        "license": "0101254037"
      }
    ],
    "location_address": {
      "lines": ["6410 ROCKLEDGE DR STE 304"],
      "city": "BETHESDA",
      "state": "MD",
      "postal_code": "20817-1841",
      "country": "US",
      "phone": "443-602-6207",
      "fax": null
    },
    "mailing_address": {
      "lines": ["601 MEMORY LN"],
      "city": "YORK",
      "state": "PA",
      "postal_code": "17402-2231",
      "country": "US",
      "phone": "717-851-1405",
      "fax": "717-851-6969"
    },
    "practice_locations": 4,
    "other_names": [],
    "authorized_official": null
  },
  "matches": null,
  "credits_used": 1,
  "cached": false
}

Act on the status

status reason What it means What to do
found null NPPES has a record for the NPI, or for the best match of the name. Compare provider.name, provider.type and the licenses in provider.taxonomies with what the provider told you. After a name search, confirm that the record is the provider you meant: the other candidates are in matches.
invalid invalid_format The value is not 10 digits once spaces and dashes are removed. NPPES is not called. Ask for the NPI again.
invalid invalid_check_digit The NPI has 10 digits but does not start with 1 or 2, or its last digit does not match the others. NPPES is not called. Ask the provider to check each digit: it is usually a typo.
not_found not_in_nppes The NPI is well formed but NPPES has no active record of it: it was never assigned, or it was deactivated. Ask for the NPI again, or search by name.
not_found no_match No provider matches the name, in the state when you sent one. matches is empty. Try the legal name as registered, without the credential, or drop state.

Every status is billed 1 credit, because the lookup ran. Answers with status: "invalid" are never cached.

Test keys never call NPPES. They know two fictional providers: NPI 1234567893, JANE SAMPLE, M.D., an internal medicine physician in Springfield, IL, and NPI 1245319599, SAMPLE HEALTH CLINIC, an organization. A name search finds them when every word you send starts a word of their name, any other well-formed NPI is not_found with not_in_nppes, and NPIs with a wrong check digit are still invalid.

How the check digit works

An NPI is nine digits followed by a check digit. Put 80840 in front of the first nine digits, the prefix ISO 7812 gives to US health care identifiers, and compute the Luhn check digit of those 14 digits: it must equal the tenth digit of the NPI. NPIs also start with 1 or 2. A single mistyped digit always fails the check, so the API catches it before any call to NPPES.

How the name search works

A name with a comma is read as Last, First. Otherwise the first word is the first name and the last word the last name; a single word is a last name. An organization name matches the start of registered names, so a short name also finds the longer names that begin with it. With provider_type: "any", people and organizations are both searched, and a name with words such as Clinic, Hospital, Pharmacy or LLC searches organizations first. Candidates are ranked by how close their name is to the one you sent.

What the API keeps

The request log keeps the NPI with its middle digits hidden (100***26), or the first letter of a searched name, never the full name or the state.

Where the data comes from

Records come from the NPPES NPI Registry API of CMS, queried at request time. NPPES data is published by the U.S. Department of Health and Human Services for public use; works of the U.S. Government are in the public domain. Specialty descriptions are the ones NPPES returns for each taxonomy code. See the data sources page.

Search by name

Send name, and state to narrow the search. The best candidate's full record comes back, and every candidate is in matches, best first. With a test key in QELKA_API_KEY, this request returns:

curl https://api.qelka.com/v1/npi \
  --max-time 30 \
  -H "Authorization: Bearer $QELKA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Jane Sample", "state": "IL"}'
const response = await fetch('https://api.qelka.com/v1/npi', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.QELKA_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ name: 'Jane Sample', state: 'IL' }),
  signal: AbortSignal.timeout(30_000),
})
const result = await response.json()
console.log(result)
import os

import requests

api_key = os.environ["QELKA_API_KEY"]
response = requests.post(
    "https://api.qelka.com/v1/npi",
    headers={"Authorization": f"Bearer {api_key}"},
    json={"name": "Jane Sample", "state": "IL"},
    timeout=30,
)
result = response.json()
print(result)
Response
{
  "id": "lkp_01M8CGA3WQ4T7N2B9XKD5RZ1HE",
  "object": "npi",
  "input": "Jane Sample",
  "query": "name",
  "valid": null,
  "status": "found",
  "reason": null,
  "provider": {
    "npi": "1234567893",
    "type": "individual",
    "name": "JANE SAMPLE, M.D.",
    "first_name": "JANE",
    "middle_name": null,
    "last_name": "SAMPLE",
    "credential": "M.D.",
    "organization_name": null,
    "sole_proprietor": false,
    "status": "active",
    "enumeration_date": "2010-05-12",
    "last_updated": "2025-03-04",
    "certification_date": "2025-03-04",
    "primary_taxonomy": {
      "code": "207R00000X",
      "description": "Internal Medicine",
      "primary": true,
      "state": "IL",
      "license": "TEST-0001"
    },
    "taxonomies": [
      {
        "code": "207R00000X",
        "description": "Internal Medicine",
        "primary": true,
        "state": "IL",
        "license": "TEST-0001"
      }
    ],
    "location_address": {
      "lines": ["100 TEST AVENUE"],
      "city": "SPRINGFIELD",
      "state": "IL",
      "postal_code": "62701-0000",
      "country": "US",
      "phone": "555-010-0100",
      "fax": null
    },
    "mailing_address": {
      "lines": ["PO BOX 100"],
      "city": "SPRINGFIELD",
      "state": "IL",
      "postal_code": "62701",
      "country": "US",
      "phone": null,
      "fax": null
    },
    "practice_locations": 0,
    "other_names": [],
    "authorized_official": null
  },
  "matches": [
    {
      "npi": "1234567893",
      "type": "individual",
      "name": "JANE SAMPLE",
      "credential": "M.D.",
      "primary_taxonomy": "Internal Medicine",
      "city": "SPRINGFIELD",
      "state": "IL"
    }
  ],
  "credits_used": 0,
  "cached": false
}

Catch a mistyped NPI

The last digit is wrong, so the check digit fails and NPPES is not called. The answer is billed, because the check ran.

curl https://api.qelka.com/v1/npi \
  --max-time 30 \
  -H "Authorization: Bearer $QELKA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"npi": "1234567890"}'
const response = await fetch('https://api.qelka.com/v1/npi', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.QELKA_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ npi: '1234567890' }),
  signal: AbortSignal.timeout(30_000),
})
const result = await response.json()
console.log(result)
import os

import requests

api_key = os.environ["QELKA_API_KEY"]
response = requests.post(
    "https://api.qelka.com/v1/npi",
    headers={"Authorization": f"Bearer {api_key}"},
    json={"npi": "1234567890"},
    timeout=30,
)
result = response.json()
print(result)
Response
{
  "id": "lkp_01M8CGA4E8YV6P0M3JQF2SN7TB",
  "object": "npi",
  "input": "1234567890",
  "query": "npi",
  "valid": false,
  "status": "invalid",
  "reason": "invalid_check_digit",
  "provider": null,
  "matches": null,
  "credits_used": 1,
  "cached": false
}

Errors

Status Type When
400 invalid_request Both or neither of npi and name, state without name, npi empty or longer than 20 characters, name shorter than 2 or longer than 120 characters, state not two letters, provider_type not any, individual or organization, a body that is not a JSON object, or a field the request table does not list
401 invalid_api_key The key is missing, unknown or revoked
402 insufficient_credits Your balance is less than 1 credit (live keys only)
403 forbidden The key is restricted to other endpoints
405 invalid_request The method is not POST
422 unprocessable_input The name has no word of two letters or more
429 rate_limited Too many requests: wait Retry-After seconds
500 internal_error Unexpected error on our side: retry with backoff
502 upstream_unavailable The NPPES API could not be reached, answered with an error or did not answer within 8 seconds: retry later

No error is billed. An NPI that NPPES does not know is not an error: it is a 200 with status: "not_found".