Skip to content

Latest commit

 

History

History
73 lines (51 loc) · 1.91 KB

README.md

File metadata and controls

73 lines (51 loc) · 1.91 KB

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