NPI Registry Lookup
US healthcare provider lookup by 10-digit NPI or by name and state: entity type, status, specialty (taxonomy), license, practice address and phone.
- Price per call
- 1 credit
- per successful call
- Price ceiling
- 1 credit
- every call, same price
- Failed calls
- Free
- retried automatically
- Billed
- Per call
- only on success
Endpoint
api.primaryapi.com/ v1/ run/ npi. lookupAuth: API key with run or full access, or a dashboard session
Send the input below as a JSON body. The call is routed to a healthy upstream; if an attempt fails, it is retried automatically inside the same request and you pay only for the answer you get. To check an input and see the exact price without running anything, call POST /v1/quote/npi.lookup with the same body (free).
Example request
curl -sS -X POST "https://api.primaryapi.com/v1/run/npi.lookup" \
-H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"npi":"1003000126"}'const res = await fetch('https://api.primaryapi.com/v1/run/npi.lookup', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.PRIMARYAPI_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
npi: '1003000126',
}),
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.code}: ${body.error}`);
// found:false is a successful answer ("does not exist"), not an error
console.log(body.output.found ? body.output.data : body.output.reason, body.credits);import os
import requests
res = requests.post(
"https://api.primaryapi.com/v1/run/npi.lookup",
headers={"Authorization": f"Bearer {os.environ['PRIMARYAPI_API_KEY']}"},
json={
"npi": "1003000126",
},
timeout=60,
)
body = res.json()
if not res.ok:
raise RuntimeError(f"{body['code']}: {body['error']}")
# found=False is a successful answer ("does not exist"), not an error
print(body["output"]["data"] if body["output"]["found"] else body["output"]["reason"], body["credits"]){
"name": "run_api",
"arguments": {
"sku": "npi.lookup",
"input": {
"npi": "1003000126"
}
}
}Price this exact input first (free)
curl -sS -X POST "https://api.primaryapi.com/v1/quote/npi.lookup" \
-H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"npi":"1003000126"}'Returns credits (what the call is expected to cost) and maxCredits (the most it can cost, which is set aside while it runs). Invalid input fails here the same way it would on run.
Input
JSON body fields. Unknown fields are rejected with 400 invalid_input (never silently ignored). You may add the routing controls preferLatencyUnderMs and maxCredits to the same object.
npistring- 10-digit NPI, e.g. "1003000126"; the check digit is verified before any upstream call.pattern: ^\d{10}$
firstNamestring- First name, narrows a lastName search.max 50 chars
lastNamestring- Search individual providers by last name (when no NPI is given).max 60 chars
organizationNamestring- Search organizations by name, e.g. "Mayo Clinic" (when no NPI is given; wins over lastName).max 100 chars
statestring- Two-letter state of the practice location, narrows a name search, e.g. "MN".pattern: ^[A-Za-z]{2}$
Output
When output.found is true, output.data has these fields.
npistring- 10-digit NPI
entityTypeenum- individual (NPI-1) or organization (NPI-2)one of: individual, organization
namestring | null- Individual: first middle last; organization: legal business name
credentialstring | null- e.g. "M.D." (individuals)
statusenum | null- Registry status; null when the source has noneone of: active, deactivated
isActiveboolean | nullprimarySpecialtystring | null- Primary taxonomy description, e.g. "Hospitalist"
taxonomyCodestring | null- Primary taxonomy code, e.g. "208M00000X"
licenseNumberstring | null- License number of the primary taxonomy
licenseStatestring | nullpracticeAddressstring | null- Primary practice location, formatted
practicePhonestring | null- Practice phone, NNN-NNN-NNNN
mailingAddressstring | nullenumerationDatestring | null- Date the NPI was issued, YYYY-MM-DD
lastUpdatedstring | null- Date the record was last updated, YYYY-MM-DD
soleProprietorboolean | nulltaxonomiesobject[]- Every taxonomy (specialty + license) on the record
taxonomies[].codestring | nulltaxonomies[].descriptionstring | nulltaxonomies[].licenseNumberstring | nulltaxonomies[].licenseStatestring | nulltaxonomies[].primarybooleanpracticeLocationsstring[]- Additional practice locations, formatted
otherNamesstring[]- Former, professional or doing-business-as names
authorizedOfficialTitlestring | null- Organizations: title of the authorized official
nameSearchstring | null- The name searched (null for an NPI lookup)
matchCountinteger- Records returned for the query (1 for an NPI lookup)
matchesobject[]- Further name-search matches (up to 9)
matches[].npistringmatches[].namestring | nullmatches[].entityTypeenum- one of: individual, organization
matches[].primarySpecialtystring | nullmatches[].citystring | nullmatches[].statestring | null
TypeScript type
/** output.data when output.found is true */
type NpiLookup = {
/** 10-digit NPI */
npi: string;
/** individual (NPI-1) or organization (NPI-2) */
entityType: "individual" | "organization";
/** Individual: first middle last; organization: legal business name */
name: string | null;
/** e.g. "M.D." (individuals) */
credential: string | null;
/** Registry status; null when the source has none */
status: "active" | "deactivated" | null;
isActive: boolean | null;
/** Primary taxonomy description, e.g. "Hospitalist" */
primarySpecialty: string | null;
/** Primary taxonomy code, e.g. "208M00000X" */
taxonomyCode: string | null;
/** License number of the primary taxonomy */
licenseNumber: string | null;
licenseState: string | null;
/** Primary practice location, formatted */
practiceAddress: string | null;
/** Practice phone, NNN-NNN-NNNN */
practicePhone: string | null;
mailingAddress: string | null;
/** Date the NPI was issued, YYYY-MM-DD */
enumerationDate: string | null;
/** Date the record was last updated, YYYY-MM-DD */
lastUpdated: string | null;
soleProprietor: boolean | null;
/** Every taxonomy (specialty + license) on the record */
taxonomies: {
code: string | null;
description: string | null;
licenseNumber: string | null;
licenseState: string | null;
primary: boolean;
}[];
/** Additional practice locations, formatted */
practiceLocations: string[];
/** Former, professional or doing-business-as names */
otherNames: string[];
/** Organizations: title of the authorized official */
authorizedOfficialTitle: string | null;
/** The name searched (null for an NPI lookup) */
nameSearch: string | null;
/** Records returned for the query (1 for an NPI lookup) */
matchCount: number;
/** Further name-search matches (up to 9) */
matches: {
npi: string;
name: string | null;
entityType: "individual" | "organization";
primarySpecialty: string | null;
city: string | null;
state: string | null;
}[];
};If what you asked about does not exist, is private, or a search matches nothing, the call still succeeds: output.found is false, output.data is null and output.reason says why. Such misses are free unless the notes below say misses are billed, in which case a miss costs the price of one call.
Example response
Values are placeholders that follow the output schema (strings as "string", numbers as 0); credits shows what this call would cost at the usual price.
{
"output": {
"found": true,
"data": {
"npi": "1003000126",
"entityType": "individual",
"name": "string",
"credential": "string",
"status": "active",
"isActive": true,
"primarySpecialty": "string",
"taxonomyCode": "string",
"licenseNumber": "string",
"licenseState": "string",
"practiceAddress": "string",
"practicePhone": "string",
"mailingAddress": "string",
"enumerationDate": "string",
"lastUpdated": "string",
"soleProprietor": true,
"taxonomies": [
{
"code": "string",
"description": "string",
"licenseNumber": "string",
"licenseState": "string",
"primary": true
}
],
"practiceLocations": [
"string"
],
"otherNames": [
"string"
],
"authorizedOfficialTitle": "string",
"nameSearch": "string",
"matchCount": 0,
"matches": [
{
"npi": "1003000126",
"name": "string",
"entityType": "individual",
"primarySpecialty": "string",
"city": "string",
"state": "string"
}
]
}
},
"provider": "PrimaryAPI",
"credits": 1,
"items": 1,
"requestId": "req_01JBXK6Y2N9V8T4R3Q2P1M0A7Z"
}Pricing and reliability
Calls go only to upstreams that are healthy right now. If an attempt fails, the call is retried automatically inside the same request; a failed attempt costs nothing, and a call never costs more than its quote’s maxCredits. Live figures below are measured on real traffic.
Success rate, uptime, latency and call counts are measured live from real traffic over 30 days and show “—” until there is data.
Errors
Errors are JSON { code, error, requestId } and are never charged. The ones to handle for this endpoint:
- invalid_inputThe request failed validation before anything ran.
- unauthorizedNo valid API key or session was presented.
- insufficient_balanceThe balance cannot cover the most this call could cost.
- key_limit_reachedThe key’s own spend limit is used up for the current window.
- trial_cap_reachedAn agent trial key has used its whole trial budget.
- forbiddenThe credential is valid but may not do this.
- not_foundThe thing addressed by the URL does not exist for you.
- idempotency_conflictThe
Idempotency-Keyis already bound to a different request. - rate_limitedToo many requests in the current window.
- all_sources_failedThe call could not be answered, even after automatic retries.
- service_unavailableThis API cannot run in this deployment right now.
- timeoutThe request passed its deadline before it finished.
Notes
A name search returns the best match (active records first) flattened, plus up to 9 further matches; add state and firstName to narrow it. NPI numbers are checked (Luhn with the 80840 prefix) before any upstream call, so a typo is a free 400. Not found is free. Pair with an exclusion check for credentialing: an NPI is not proof of licensure or good standing.
Source: the CMS National Plan and Provider Enumeration System NPI Registry, US government public data. Provider names, addresses and phone numbers are personal data in many jurisdictions: use them for provider verification, not for marketing lists. An NPI does not prove licensure or good standing.
Generated from the PrimaryAPI catalog. Machine-readable contract: GET https://api.primaryapi.com/v1/apis/npi.lookup.