Skip to content

ForcuraCo/npi-api-net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPPES API for .NET

NuGet

This is a .NET wrapper for interacting with the CMS National Plan and Provider Enumeration System NPPES National Provider Identifier (NPI) lookup system

For more information visit the NPI registry

Usage

Requests are as simple as providing an NPI number to lookup:

var results = await NPPESApiClient.SearchAsync("8942315671");

OR

var results = await NPPESApiClient.SearchAsync(new NPPESRequest
{
   Number = "5631047582"
});

For more complicated queries, use the other provided fields on the NPPESRequest object:

var results = await NPPESApiClient.SearchAsync(new NPPESRequest
{
   FirstName = "John",
   LastName = "Doe"
});

Using the builder:

var builder = new NPPESRequestBuilder();
var request = builder
    .Version(NPPESVersion.v1_0)
    .Number("1234567890")
    .Build();

var results = await NPPESApiClient.SearchAsync(request);

Dependency Injection

For netcore/net5+ you can register this with the IServiceCollection through the extension method:

using Forcura.NPPES.DependencyInjection;

// simple approach
IServiceCollection serviceCollection = ...;
serviceCollection.AddNPPESApi();

// for any customizations of the IHttpClientBuilder
IServiceCollection serviceCollection = ...;
serviceCollection.AddHttpClient<NPPESApiClient>();

It is important to note that the NPPES API by default, accesses the latest public api version, as currently it is backward compatible, this is something to be aware of.

License

Copyright 2022 Forcura

Licensed under the Apache 2.0 license

Resources