This post is part of a more technical series about working with provider data and how to query provider data in the most effective way. Provider data is very complex due to its many relationships that depend on different values. More often than not, a person looking for provider data does not necessarily want the entire data dump for a certain doctor, as this can mean hundreds of lines in JSON. Instead, one usually looks to just query a particular value to verify something. For example, one would query the addresses associated with a particular NPI. Long story short, the answer to having too much data to work with might be GraphQL.

In this first post of our technical series, we want to introduce data.npiql.com, which lets you query the API for the NPPES directory, otherwise known as the NPI directory. As NPPES puts it on their website, the “NPI Registry Public Search is a free directory of all active National Provider Identifier (NPI) records. Healthcare providers acquire their unique 10-digit NPIs to identify themselves in a standard way throughout their industry”.

Data.npiql.com is a simple GraphQL interface used to query the NPPES / NPI Database. We created this simple tool for ourselves and thought it would be helpful to share.

If you’re not familiar with GraphQL, check out the example below.

First Things First… What is GraphQL?

GraphQL was created by Facebook. In a nutshell, GraphQL is a great way for your apps to request data in the API, which is an application programming interface that developers use to access data. There are many ways to query APIs to pull data, but one reason GraphQL is so cool, is that with GraphQL you can ask for exactly what you need, and get exactly that. Nothing more, and nothing less.

Here’s a Simple Example

Let’s say you have an NPI number like this one: 1316276066

What you want to do is to get the First Name, Last Name, Credentials and Address for that provider from the NPI Database. Although there’s a lot more information available, let’s assume that this is all you really want to see and nothing more.

Step 1) Go to data.npiql.com.

Step 2) Copy and paste the code into the left panel on the screen.

Step 3) Click the “Play” button at the top of the page.

Step 4) Marvel at the awesomeness! Or, figure out what you did wrong.

# This is the code you want to copy
{
  npiSearch(number:1316276066){
    results{            
      basic{
        first_name
        last_name
        credential        
      }
      addresses{
        address_purpose
        address_1
        address_2
        city
        state
        postal_code
      }
    }
  }
}

If you did everything right then the result will look like this.

# This is the result you want to marvel at
{
  "data": {
    "npiSearch": {
      "results": [
        {
          "basic": {
            "first_name": "JARED",
            "last_name": "POOL",
            "credential": "D.D.S."
          },
          "addresses": [
            {
              "address_purpose": "LOCATION",
              "address_1": "1719 POWELL ST",
              "address_2": "",
              "city": "SAN FRANCISCO",
              "state": "CA",
              "postal_code": "941332808"
            },
            {
              "address_purpose": "MAILING",
              "address_1": "1719 POWELL ST",
              "address_2": "",
              "city": "SAN FRANCISCO",
              "state": "CA",
              "postal_code": "941332808"
            }
          ]
        }
      ]
    }
  }
}

Give it a try

Play around with this to see how you can add and remove different data attributes.

Use the Docs

Note that there is a button on the top right of the screen labeled “Docs”. If you click that, you’ll be able to see all of the available data attributes, descriptions and how to include them. Spoiler alert… it’s all of the available NPESS Data Attributes.

Learn More

GraphQL can do a whole lot more. If this short intro is making your developer senses all tingly then I have some good news. The internet is just chocked full of free tutorials and it’s super easy to get started. The offical GraphQL website is a great place to begin.

Access BetterDoctor provider data

If GraphQL is not for you for now, you can query our provider database with our easy live documentation, or any language that you prefer. Just sign up for our provider data API for free on our developer site and try it out yourself. If you would like to use our provider data for your product or service, we should talk.