Send a GET request to https://npiregistry.cms.hhs.gov/api/ with query parameters such as number (for direct NPI lookup), first_name, last_name, organization_name, or taxonomy_description.
Include version=2.1 in the query string to use the current API version, which returns richer address and taxonomy data.
Parse the JSON response: results[] contains provider records; each has basic (name, NPI, enumeration type) and addresses[] and taxonomies[] arrays.
Filter results by taxonomy code if you need providers of a specific specialty (e.g. 207Q00000X for family medicine); taxonomy codes follow the NUCC Health Care Provider Taxonomy.
Use the limit and skip parameters for pagination when a query may return many results (default and maximum limits are documented in the API spec).
NPI records are public data and require no API key; however, build in retry logic and respect rate limits to avoid being throttled.
Known gotchas
NPI records reflect self-reported data at time of registration and may be outdated; an NPI listed as active does not guarantee the provider currently practices at that address or within that specialty.
Individual providers (Type 1) and organizations (Type 2) both have NPIs; ensure your search and parsing logic handles both enumeration types, as the name fields differ between them.
Deactivated or deactivated-and-replaced NPIs are included in search results; check the enumeration_date and last_updated fields and filter out records with a deactivation_date if you need only active providers.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp