Healthcare Provider Data API — NPI, Taxonomy, PECOS & LEIE in One Call
Healthcare analytics platforms, SaaS products, and RCM tools often start with a list of NPIs and need to enrich them with taxonomy, address, Medicare enrollment, and exclusion status. Pulling this data from government sources means querying NPPES, the PECOS portal, and the OIG website separately and joining the results. The NPI Registry API returns all of these fields in a single REST call per provider, making provider data enrichment a straightforward pipeline: read your NPI list, call the API, write the enriched output.
Enrichment fields returned per provider
| Field | API path | Use case |
|---|---|---|
| NPI number | npi | Primary identifier for all downstream systems |
| Entity type (individual/org) | entity_type_cd | Route to individual vs. organization subfields |
| Provider name | organization.org_name or individual.first_name + last_name | Display name in directories and reports |
| Primary taxonomy code | taxonomy[0].taxonomy_code | Specialty segmentation, network configuration, billing |
| Taxonomy description | taxonomy[0].taxonomy_desc | Human-readable specialty for directories and analytics |
| Practice address | location[0].addr_fl, addr_city, addr_state, addr_post_cd | Directory display, geographic analytics, geocoding |
| Phone number | location[0].telephone | Directory contact, outreach, referral routing |
| Medicare enrollment (in_pecos) | entity_type[0].in_pecos | Billing eligibility validation, network credentialing |
| Enrollment ID | medicare_enrlmt[0].enrlmt_id | Payer enrollment audits, PECOS record linkage |
| PAC ID | medicare_enrlmt[0].pac_id | Claims when NPI unknown, provider profile linkage |
| Medicare provider type | medicare_enrlmt[0].provider_type_dec | Billing type routing, CMS program eligibility |
| OIG LEIE exclusion (in_leie) | entity_type[0].in_leie | Compliance screening, fraud risk flagging |
| NPI enumeration date | entity_type[0].enum_date | Provider tenure analysis, cohort segmentation |
Provider data enrichment pipeline (Python)
This pipeline reads a CSV of NPIs, enriches each with API data, and writes a flat enriched CSV ready to load into your analytics database or product:
import time, csv, requests
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://restapi.npidataservices.com/api/v1/findbyNPIId"
FIELDS = [
"npi", "name", "entity_type", "taxonomy_code", "taxonomy_desc",
"city", "state", "zip", "phone",
"in_pecos", "in_leie", "enrlmt_id", "pac_id", "provider_type", "enum_date"
]
def enrich_provider(npi):
r = requests.get(BASE_URL,
params={"NPIId": npi},
headers={"ApiKey": API_KEY},
timeout=5)
if r.status_code == 404:
return {"npi": npi, **{k: "" for k in FIELDS if k != "npi"}}
r.raise_for_status()
d = r.json()
entity = (d.get("entity_type") or [{}])[0]
tax = (d.get("taxonomy") or [{}])[0]
loc = (d.get("location") or [{}])[0]
enrlmt = (d.get("medicare_enrlmt") or [{}])[0]
org = (d.get("organization") or [{}])[0]
ind = (d.get("individual") or [{}])[0]
name = org.get("org_name") or (
f"{ind.get('first_name','')} {ind.get('last_name','')}".strip()
)
return {
"npi": npi,
"name": name,
"entity_type": d.get("entity_type_cd", ""),
"taxonomy_code": tax.get("taxonomy_code", ""),
"taxonomy_desc": tax.get("taxonomy_desc", ""),
"city": loc.get("addr_city", ""),
"state": loc.get("addr_state", ""),
"zip": loc.get("addr_post_cd", ""),
"phone": loc.get("telephone", ""),
"in_pecos": entity.get("in_pecos", ""),
"in_leie": entity.get("in_leie", ""),
"enrlmt_id": enrlmt.get("enrlmt_id", ""),
"pac_id": enrlmt.get("pac_id", ""),
"provider_type": enrlmt.get("provider_type_dec", ""),
"enum_date": entity.get("enum_date", ""),
}
# Read input NPI list
with open("npis.csv") as f:
npis = [row["npi"] for row in csv.DictReader(f)]
# Enrich
enriched = []
for npi in npis:
enriched.append(enrich_provider(npi))
time.sleep(0.1)
# Write enriched output
with open("providers_enriched.csv", "w", newline="") as f:
writer = csv.DictWriter(f, fieldnames=FIELDS)
writer.writeheader()
writer.writerows(enriched)
print(f"Enriched {len(enriched)} providers.")
Use cases by buyer type
| Buyer | What they enrich | Key fields used |
|---|---|---|
| Provider directories & health plans | Display data, specialty listing, location accuracy | name, taxonomy_desc, city, state, phone |
| Revenue cycle management (RCM) | Pre-claim billing validation, enrollment check | in_pecos, enrlmt_id, pac_id, provider_type |
| Compliance & credentialing platforms | Exclusion screening, PECOS enrollment verification | in_leie, in_pecos, enrlmt_id |
| Clinical analytics & life sciences | Specialty segmentation, geographic distribution, cohort analysis | taxonomy_code, state, zip, enum_date |
| Healthcare SaaS & marketplaces | Provider profile auto-fill, network search, referral routing | All fields — NPI as primary key for dynamic enrichment |
| Health plan network management | Network configuration, panel assignment, billing type routing | taxonomy_code, in_pecos, provider_type, state |
Enrichment at scale — throughput by plan
| Provider list size | At 100ms/req | Plan needed |
|---|---|---|
| 500 providers | ~1 min | Free (1,000/mo) |
| 5,000 providers | ~8 min | Starter (12.5k/mo) |
| 25,000 providers | ~42 min | Pro (125k/mo) |
| 100,000 providers | ~2.8 hrs | Pro (125k/mo) |
| 500,000+ providers | Custom schedule | Enterprise |
Run enrichment jobs nightly or weekly to keep your provider data current with weekly NPPES updates.
Why not build directly on the free NPPES API?
The free NPPES API at npiregistry.cms.hhs.gov returns NPI, taxonomy,
and address — but not Medicare PECOS enrollment, PECOS enrollment ID, PAC ID, or
OIG LEIE exclusion status. For a complete provider data enrichment pipeline, you
would need to:
- Query NPPES for NPI, taxonomy, and address
- Query the PECOS enrollment dataset (monthly flat-file download or separate API) for enrollment status and IDs
- Query the OIG LEIE (monthly flat-file) for exclusion status
- Join all three datasets on NPI
The NPI Registry API returns all fields in a single call with no data pipeline to maintain. See NPPES API vs NPI Registry API for the full comparison.
Related guides
- NPI Bulk Lookup API — batch enrichment pipeline with quota planning and throughput estimates
- Provider Directory API — sync enriched NPI data to a live provider directory
- Provider Credentialing Automation — use enrichment data as input for credentialing workflows
- NPPES API vs NPI Registry API — why a single enriched API call beats three government lookups
- PECOS API — Medicare enrollment fields returned in every enrichment call
- NPPES API Pagination — paginate the
searchProvidersendpoint for bulk enrichment by specialty or state - Provider Verification API — verification workflow that runs enrichment fields through a compliance gate
- OIG Exclusion Screening API — monthly LEIE re-screening for enriched provider records
- Medicare Enrollment Verification — enrollment validation for enriched billing provider records
- Provider Onboarding Automation — enrichment at the moment of provider onboarding
- LEIE API — OIG exclusion flag details and scope
- NPPES API Rate Limits — quota planning for enrichment jobs
- NPPES Error Codes — handle 429 and 404 in your enrichment pipeline
- API Uptime & Reliability — circuit breaker and fallback patterns for production enrichment
The NPI Registry API returns 13 structured fields per provider — taxonomy, address, PECOS enrollment, and LEIE exclusion flag — in a single REST call. No government portals, no flat-file joins. Start a free trial to test against your provider list.
Explore the API & start a free trial →Frequently asked questions
What is a healthcare provider data API?
A REST service that returns structured provider data — NPI, taxonomy, address, PECOS
enrollment, and LEIE exclusion — in a single query, replacing manual government portal
lookups or flat-file joins.
What fields does a provider data API return?
NPI, entity type, name, primary taxonomy code and description, all addresses and
phone numbers, Medicare PECOS enrollment status, enrollment ID, PAC ID, Medicare
provider type, OIG LEIE exclusion flag, and NPI enumeration date.
Can I use the API to enrich a CSV of provider records?
Yes — read a CSV of NPIs, call findbyNPIId for each with 100ms pacing,
and write enriched output. At 100ms/req, 5,000 NPIs complete in ~8 minutes on the
Starter plan.
What use cases does healthcare provider data enrichment support?
Provider directories, RCM claim pre-validation, compliance credentialing, clinical
analytics, health plan network configuration, and healthcare SaaS product enrichment.