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 "http://docnpi.com/api/index.php?first_name=&last_name=&org_name=&address=&state=DC&city_name=Washington&zip=&taxonomy=&ident=&is_person=true&is_address=false&is_org=false&is_ident=false&format=json" > 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 "http://docnpi.com/api/index.php?first_name=&last_name=&org_name=&address=&state=DC&city_name=Washington&zip=&taxonomy=&ident=&is_person=true&is_address=false&is_org=false&is_ident=false&format=csv" > 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.