RxClass API


Information returned
Drug classes with a specified class name
Service domain
HTTP request
GET  /REST/rxclass/class/byName.xml?className=value&classTypes=values


Retrieve class information for a class indicated by className. The specified name may be a synonym for the class. If classTypes is specified, only classes of those types are returned.



Notation for results

One of:
Get results in XML
Get results in JSON
classNameQueryRequiredName of the class
classTypesQueryOptionalClass type(s)

(Space-separated list. See getClassTypes for the menu.)


All query parameters are case-insensitive.

Note that HTTP requires that query parameters be "URL encoded". For instance, a "space-separated list" will, in practice, usually appear to use either a plus sign (+) or %20 as the separator. For full information on URL encoding, please refer to IETF RFC 3986, "Uniform Resource Identifier".

Output structure

Results are available as either XML or JSON.

  • The XML result has the root element rxclassdata. It is described in the XML Schema for the RxClass API; the relevant element structure is summarized below. Elements that would be empty might be left out.

  • The JSON result is an object {...}, analogous to the content of the XML rxclassdata. Fields that might occur multiple times in the XML are expressed as an array. Fields that would be empty might be null or left out. Numbers are expressed as strings.

Both XML and JSON results follow the same outline:

Root element in XML, or anonymous object in JSON
Drug classes
rxclassMinConcept (array)
Drug class
Class identifier (an ID in the namespace of the class source)
Class name
Class type (ATC1-4, CHEM, DISPOS, EPC, VA, etc.)
Link to the class source

Example: Class named "radiopharmaceuticals"

XML: https://rxnav.nlm.nih.gov/REST/rxclass/class/byName?className=radiopharmaceuticals

JSON: https://rxnav.nlm.nih.gov/REST/rxclass/class/byName.json?className=radiopharmaceuticals

An XML result is shown below.