DocNPI is a website and webervice for searching information in the National Provider Index (NPI) Registry. The NPI Registry is maintained by HHS and is a registry of all physicians in the United States. The intersting part of DOCNPI for me is that it lets you fetch the information as JSON or CSV thus making it possible to query for this information and import it into other data sets as needed.

An Example

Let’s fetch all the docs in Washington D.C. We will just use the command line utility curl to fetch the data we need. DocNPI is a RESTFul API, so all we need to do is pass it some search parameters.

curl curl "" > all_docs_dc.json<br />

Now all of our doctors in Washington DC are in the file all_docs_dc.json. Cool. Now lets do the same thing and fetch the data as comma-separated values

curl curl "" > all_docs_dc.csv<br />

Now we have something we can import into a spreadsheet or other systems. Nice and easy and way better than trying to use the HHS site or do deal with the CSV dumps from HHS.