惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
Microsoft Azure Blog
Microsoft Azure Blog
Stack Overflow Blog
Stack Overflow Blog
Jina AI
Jina AI
Vercel News
Vercel News
H
Help Net Security
Martin Fowler
Martin Fowler
美团技术团队
云风的 BLOG
云风的 BLOG
Y
Y Combinator Blog
阮一峰的网络日志
阮一峰的网络日志
MyScale Blog
MyScale Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
博客园 - 司徒正美
人人都是产品经理
人人都是产品经理
Engineering at Meta
Engineering at Meta
G
Google Developers Blog
Blog — PlanetScale
Blog — PlanetScale
MongoDB | Blog
MongoDB | Blog
宝玉的分享
宝玉的分享
小众软件
小众软件
T
Tailwind CSS Blog
WordPress大学
WordPress大学

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
How to Look Up Healthcare Providers by NPI with an API (r...
Chin Ramamoorthi at VBC Risk Analytics · 2026-06-03 · via DEV Community

Chin Ramamoorthi at VBC Risk Analytics

If you build anything in healthcare — a provider directory, a credentialing tool, an EHR integration, or a claims pipeline — sooner or later you need to look up a provider by their NPI (National Provider Identifier) and get back clean, structured data.

In this tutorial we'll do exactly that with the NPI Registry API: look up a provider by NPI, search by name/taxonomy/location, and read the enriched fields it returns (taxonomy, practice locations, Medicare enrollment, PECOS and LEIE flags).

NPI Registry API vs. the free NPPES API. CMS publishes a free NPPES API at npiregistry.cms.hhs.gov — great for light, occasional use, but rate-limited and bare-bones. The commercial NPI Registry API used here adds enrichment (Medicare/PECOS/LEIE, similar providers) and a consistent JSON shape. Full comparison: NPPES API vs. NPI Registry API.

1. Get an API key

Sign up for a free trial and your API key arrives by email in seconds. You authenticate by sending it in an ApiKey header. Base URL:

https://restapi.npidataservices.com/api/v1

2. Your first request (cURL)

Look up the provider with NPI 1053500652:

curl -X GET \
  'https://restapi.npidataservices.com/api/v1/findbyNPIId?NPIId=1053500652' \
  -H 'accept: application/json' \
  -H 'ApiKey: YOUR_API_KEY'

A trimmed response:

{
  "npi": 1053500652,
  "status": "success",
  "entity_types": ["Organization"],
  "organization": [{ "org_name": "LEVEL HOME HEALTH INC.", "auth_official_last_name": "DECKELMAN" }],
  "taxonomy": [{ "taxonomy_code": "251E00000X", "taxonomy_desc": "Agencies:Home Health" }],
  "location": [{ "addr_city": "PASADENA", "addr_state": "CA", "telephone": "9492060691" }],
  "medicare_enrlmt": [{ "pac_id": "4284711805", "provider_type_dec": "PART A PROVIDER - HOME HEALTH AGENCY" }],
  "entity_type": [{ "in_pecos": "Y", "in_leie": "N" }]
}

3. Python

import os, requests

API_KEY = os.environ.get("NPI_API_KEY", "YOUR_API_KEY")
BASE = "https://restapi.npidataservices.com/api/v1"
HEADERS = {"accept": "application/json", "ApiKey": API_KEY}

def find_by_npi(npi):
    r = requests.get(f"{BASE}/findbyNPIId", params={"NPIId": npi}, headers=HEADERS, timeout=15)
    r.raise_for_status()
    return r.json()

data = find_by_npi("1053500652")
org = (data.get("organization") or [{}])[0]
tax = (data.get("taxonomy") or [{}])[0]
print(org.get("org_name"), "", tax.get("taxonomy_desc"))

4. JavaScript (Node 18+)

const API_KEY = process.env.NPI_API_KEY || "YOUR_API_KEY";
const BASE = "https://restapi.npidataservices.com/api/v1";

async function findByNpi(npi) {
  const res = await fetch(`${BASE}/findbyNPIId?NPIId=${npi}`, {
    headers: { accept: "application/json", ApiKey: API_KEY },
  });
  if (!res.ok) throw new Error(`HTTP ${res.status}`);
  return res.json();
}

const data = await findByNpi("1053500652");
console.log(data.organization?.[0]?.org_name, "", data.taxonomy?.[0]?.taxonomy_desc);

5. The other search methods

Beyond NPI lookup, the NPI search API supports:

Endpoint Find providers by
GET /findbyPACId PECOS PAC ID
GET /findbyPACENRLId PECOS enrollment ID
GET /findOrganizationByName organization name + ZIP
GET /findIndividualProviderByName first/last name + ZIP
GET /findProvidersByTaxonomyCode entity type + taxonomy + ZIP
GET /findProviderByName org/last/first name + state

Wrap-up

That's real-time NPI lookup and provider search in a few lines. Try every endpoint live in the interactive NPI Registry API documentation.

Built on NPPES data by VBC Risk Analytics.