RxNorm
 
RxNorm RESTful Web API

Overview

The RxNorm RESTful web API is a web service developed at the National Library of Medicine for accessing the RxNorm data. Representational state transfer (REST) is a style of software architecture for distributed hypermedia systems such as the World Wide Web. REST-style architectures consist of clients and servers. Clients initiate requests to servers; servers process requests and return appropriate responses. Requests and responses are built around the transfer of "representations" of "resources". A resource can be essentially any coherent and meaningful concept that may be addressed. A representation of a resource is typically a document that captures the current or intended state of a resource.

The RxNorm RESTful web API is a simple web service implemented using HTTP and can be thought of as a collection of resources, specified as URIs. Some characteristics of the RxNorm RESTful web API:
Clients of the RxNorm RESTful web API can be browsers, such as Internet Explorer or Firefox, or programs such as the Unix/Linux curl command, or user developed clients. For example, the Unix/Linux curl command could be used to get the RxNorm version:
curl https://rxnav.nlm.nih.gov/REST/version
(returns)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><rxnormdata><version>03-Feb-2020</version>
<apiVersion>2.9.109</apiVersion></rxnormdata>
The curl command takes a URL as part of its command sequence. The string https://rxnav.nlm.nih.gov/REST/version is a RxNorm RESTful web API resource. The Resources section details the RxNorm RESTful web API resources available to clients.

Currently, the RxNorm API RESTful web services return the data in XML form as the default. The API can also return the data in JSON. Here is the curl command, modified from above, to return the RxNorm version in JSON format:

curl -H "Accept:application/json" https://rxnav.nlm.nih.gov/REST/version
(returns)
{"version":"03-Feb-2020","apiVersion":"2.9.109"}
 
RxNorm