DEV Community

carrierone
carrierone

Posted on

How to Query 9 Million US Healthcare Providers via API (NPI Registry)

Querying US Healthcare Providers Using NPI Number: A Practical Guide

When developing healthcare applications that require integration with the National Provider Identifier (NPI) registry, being able to quickly and accurately look up providers by their NPI number is crucial. In this article, we'll explore how you can achieve this using an API endpoint provided by VeriSign's data services.

The Problem

Developing a healthcare app often involves needing to verify the provider information of doctors or other healthcare professionals. This could be for prior authorization processes, directory listings, or simply ensuring that all interactions are secure and compliant with regulations. One common way to access this information is through NPI numbers, but manually searching through databases can be time-consuming.

Python Code Example

Here’s a simple Python script using the requests library to make an API call to retrieve provider data based on their NPI number:


python
import requests

def get_npi_info(npi_number):
    url = f"https://api.verilexdata.com/api/v1/npi/sample/{npi_number}"
    response = requests.get(url)

    if response.status_code == 200:
        return response.json()
    else:
        return None

# Example usage
npi_number = "123456789"
npi_data = get_npi_info(npi_number)

if
Enter fullscreen mode Exit fullscreen mode

Top comments (0)