Verify a National Provider Identifier(NPI) - API Documentation

Verify if an NPI number appears to be valid by using the Luhn algorithm specified in the NPI Final Rule. This verification is similiar to a check of a credit card number before it is submitted. This tool can be used in front-end validation and data quality checks.

API Request

         curl https://hdu.cdcmeta.com/verify-npi/api/1144203563
    

API Response

The API response contains JSON indicating if the NPI is valid or not. If invalid, the response contains and `error` as well.

Example of a good response

{
"valid": true,
"number": "1144203563"
}
    

Example of a bad response using the NPI "1144203564".

         curl https://hdu.cdcmeta.com/verify-npi/api/1144203564
    

This call fails the Luhn check since the check digit should be 3 instead of 4.

{
  "valid": false,
  "number": "1144203564",
  "error": "Invalid NPI number"
}
 

Example of a bad response using the NPI "foobar".

         curl https://hdu.cdcmeta.com/verify-npi/api/foobar
    

This fails fails because it is not an integer.

{
  "valid": false,
  "number": "foobar",
  "error": "NPI must be numeric."
}