RxClass API

Overview of RxClass describes the drug class types, the sources of drug-class relations and the relationships to the drug classes.

The RxClass API is a web service for accessing drug classes and drug members for a number of different drug class types. No license is needed to use the RxClass API.

Note: Please check the Terms of Service for restrictions on using the APIs.

The API can return the data in XML or JSON formats. The XML structure is described in the rxclassrest.xsd XML schema.

The base URI for the API is https://rxnav.nlm.nih.gov/REST/rxclass. A complete resource URI is formed by combining the base URI, a REST resource from the table below, ".json" if you want JSON instead of XML, and query parameters (described on the detail page of each resource). For example:

https://rxnav.nlm.nih.gov/REST/rxclass/class/byId.json?classId=B01AA

The API only supports the HTTP method GET.

Functions and Resources

The following table shows each function (also known as a REST resource) in the API.
Key:
REST Resource
URL pattern to reach the resource. The link leads to the parameters and other details of the resource
Functional Name
How the resource may be referenced in literature and RxMix
Description
Content of the resource
Functional Name REST Resource Description
findClassesById /class/byId Find the drug classes from a class identifier
findClassByName /class/byName Find drug classes from a class name
findSimilarClassesByClass /class/similar Find similar class membership
findSimilarClassesByDrugList /class/similarByRxcuis Find similar classes from a list of RxNorm drug identifiers
getAllClasses /allClasses Get all classes for each specified class type
getClassByRxNormDrugId /class/byRxcui Get the classes of a specified drug identifier
getClassByRxNormDrugName /class/byDrugName Get the classes of a specified drug name
getClassContexts /classContext Get the class paths from a specified class to the root of the class hierarchy
getClassGraphBySource /classGraph Get the class graph of ancestors
getClassMembers /classMembers Get the drug members of a specified class
getClassTree /classTree Get the descendents of a class
getClassTypes /classTypes Get the class types
getRelas /relas Get the relationships for a source of drug relations
getSimilarityInformation /class/similarInfo Get the similarity information between members of two classes
getSourcesOfDrugClassRelations /relaSources Get the sources of drug-class relations
getSpellingSuggestions /spellingsuggestions Get spelling suggestions for a drug or class name