Build NPI verification for provider onboarding
- Data
- NPI
- Endpoints
- /v1/providers/{npi}/validate/v1/providers/{npi}
- MCP tools
- validate_npi, lookup_provider
- Plan
- Runs on the Free plan
How it works
- Validate the NPI: format, check digit, whether CMS issued it and its status.
- If it's active, fetch the record and compare the name to what the user entered.
- Show the primary taxonomy (specialty) and license state for review.
The code
TypeScript with @healthcare.dev/sdk. Set HDEV_API_KEY to a free key and run it. Every response carries its source, release and license in meta.
import { HealthcareDev, isValidNpi } from "@healthcare.dev/sdk"; const hdev = new HealthcareDev(); export async function verifyProvider(npi: string, lastName: string) { if (!isValidNpi(npi)) return { ok: false, reason: "check digit doesn't match" }; // offline const { data: v } = await hdev.providers.validate(npi); if (!v.exists) return { ok: false, reason: "CMS hasn't issued this NPI" }; if (v.status !== "active") return { ok: false, reason: "NPI is deactivated" }; const { data: p } = await hdev.providers.get(npi); const primary = p.taxonomies.find((t) => t.primary); return { ok: p.name.last?.toLowerCase() === lastName.toLowerCase(), name: p.name.display, specialty: primary?.display, licenseState: primary?.license_state, }; }
Or ask your agent
Connect the MCP server and ask in plain language. It calls validate_npi, lookup_provider and cites what it found.
Is NPI 1245319599 valid and active? Who is it registered to and what's their specialty?
Take it further
- Search by name, state and taxonomy with
GET /v1/providersto build a directory. - Re-validate stored NPIs monthly to catch deactivations.
- Look up taxonomy codes with
/v1/taxonomiesto filter by specialty.
Reference data only, not medical advice or a coverage determination. Send codes, NDCs and NPIs, never patient information.
More examples
Claim code checker
Catch non-billable, retired and mistyped ICD-10-CM and HCPCS codes before a claim goes out. One batch call checks up to 100 codes, with the release each answer came from.
Recall and shortage alerts
Watch a list of NDCs for FDA recalls and drug shortages and alert when one appears. Class I recalls first, with the recalling firm, reason and lot codes.
Drug price lookup
Show what pharmacies pay for a drug: CMS's NADAC acquisition cost per unit, by NDC or name, with price history and the brand or generic classification.