If you are confused with an odd Brand Name of a Drug, instead of using web search, using our simple cURL can give good amount of information. We Can Use RxNorm API or GoodRx API to Fetch Any Drug Details with cURL on Command Line Interface. It is Helpful to Both Doctors & Patients. We are showing some basic examples.
Fetch Drugs’ Details with cURL via API : Service Providers
There are not less number of service providers at this moment. All data can be accessed free of cost, some even do not need registration for authentication at all. Here are some URLs to check from the browser :
1 2 3 4 | http://rxnav.nlm.nih.gov/RxNormAPIs.html http://www.goodrx.com/developer/documentation https://open.fda.gov/drug/event/reference/ http://pillbox.nlm.nih.gov/developer.html#api |
Fetch Drugs’ Details with cURL via API : Basic Example with cURL
We expect that the reader is using GNU/Linux or OS X. cURL for Windows is also available, but not preferred.
---
If the unknown drug’s name is Augmentin, we can compose the request URI for rxnav.nlm.nih.gov
in this pattern :
1 | https://rxnav.nlm.nih.gov/REST/drugs?name=augmentin |
A simple cURL will fetch data in XML format :
1 | curl https://rxnav.nlm.nih.gov/REST/drugs?name=augmentin |
The result is here in this gist.
As it is impractical to read, use simple method to save it as xml file :
1 | curl https://rxnav.nlm.nih.gov/REST/drugs?name=augmentin > ~/Desktop/augmentin.xml |
~/Desktop/augmentin.xml
is our preferred location and file name. It could be /path/to/foo.xml
. If we drag and drop that file on Opera or Chrome browser, we can read it in somewhat in normal way. We are actually opening an url like this :
1 | file://localhost/Users/abhishekghosh/Desktop/augmentin.xml |
Pillbox and DailyMed has extensive support for the developers but need free registration :
1 | http://pillbox.nlm.nih.gov/developer.html#data |
The registration is difficult for eye blinding captcha.
Tagged With drugsdetails com , pharma api