APIs

APIs

Application Program Interfaces (APIs) are available to users to retrieve data from several drug information sources, including RxNorm, MED-RT and RxTerms. Currently these APIs are available:

The APIs are also available as part of RxNav-in-a-Box, which provides users with a locally-installable version of RxNav, RxClass, and the APIs.

The API resources can also be used interactively or in batch mode with RxMix.

We invite you to develop computer and mobile applications using National Library of Medicine (NLM) resources. We request that any application that makes use of NLM data include the following statement:

"This product uses publicly available data from the U.S. National Library of Medicine (NLM), National Institutes of Health, Department of Health and Human Services; NLM is not responsible for the product and does not endorse or recommend this or any other product."

Programmatic usage

Each API-function documentation page indicates the function's web address (URL) template and parameters, and illustrates combining those parts in a complete sample URL.

The APIs are accessed via the HTTP "GET" method, which is the usual (default) method of web browsers and common tools like "curl". For example:

curl https://rxnav.nlm.nih.gov/REST/sourcetypes.json

prints out:

{"sourceTypeList":{"sourceName":["ATC","CVX","DRUGBANK","GS","MDDB","MMSL","MMX","MSH","MTHCMSFRF","MTHSPL","NDDF","RXNORM","SNOMEDCT_US","USP","VANDF"]}}

Rate limit

RxNav's Terms of Service may limit the number of requests per second. A higher rate limit may apply to requests that provide an API key (see below).

To avoid rate-limit errors, your program may wait or "sleep" briefly between requests.

Your program may also cache the results from the APIs, and refer to the cache instead of making a second request for the same thing. The APIs are updated following each RxNorm full monthly release. The RxNorm release schedule can be found at the RxNorm Overview.

API keys

A higher rate limit may apply to requests that provide a UMLS API key, as described in RxNav's Terms of Service.

Additionally, an API key allows functions getProprietaryInformation and getApproximateMatch to return information from RxNorm source vocabularies that require a UMLS license.

RxNav accepts API keys provided by the NLM Unified Medical Language System (UMLS) Terminology Services (UTS). (The same API keys can also be used to download RxNorm files.)

How to get an API key:

  1. Sign up for a UTS account at https://uts.nlm.nih.gov/uts/signup-login.

  2. View or rotate your API key: Go to https://uts.nlm.nih.gov/, Sign In, and choose My Profile

How to use your API key with the RxNav APIs:

When sending a request to the APIs, specify your API key with the "Authorization" request header. Include your key after the word "Bearer". For example, the "curl" tool takes a --header option:

curl --header 'Authorization: Bearer 8a23xx8x-49x7-3x8x-80x8-25x6x9j697x7' 'https://rxnav.nlm.nih.gov/REST/approximateTerm.json?term=atarvastatin'