APIs

RxClass API

findClassesById

Information returned
Drug classes with a specified class identifier
Service domain
https://rxnav.nlm.nih.gov
HTTP request
GET  /REST/rxclass/class/byId.xml?classId=value

Description

Retrieve class information for classes identified by classId.

Class ID examples:

classId ExampleID TypeClass Types
B01AAATC IDATC1-4
D000998MeSH IDCHEM, DISEASE
M0545196MeSH Concept UICHEM, DISEASE
N0000000133NUIEPC, MOA, PE, PK
MS140VA Class IDVA
324643005SNOMED CT IDDISPOS, STRUCT
Schedule3Drug ScheduleSCHEDULE

NOTE: If the ID is a MeSH Concept UI, the response reflects the corresponding MeSH ID.

Parameters

ParameterLocationUseDescriptionDefault
formatPathOptional

Notation for results

One of:
.xml
Get results in XML
.json
Get results in JSON
.xml
classIdQueryRequiredClass identifier

All query parameters are case-insensitive.

Note that HTTP requires that query parameters be "URL encoded". 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:

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

Example: Class identified by ATC B01AA

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

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

An XML result is shown below.

<rxclassdata>
    <rxclassMinConceptList>
        <rxclassMinConcept>
            <classId>B01AA</classId>
            <className>Vitamin K antagonists</className>
            <classType>ATC1-4</classType>
        </rxclassMinConcept>
    </rxclassMinConceptList>
</rxclassdata>

Example: Multiple classes identified by SNOMED CT identifier 323508007

XML: https://rxnav.nlm.nih.gov/REST/rxclass/class/byId?classId=323508007

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

An XML result is shown below.

<rxclassdata>
    <rxclassMinConceptList>
        <rxclassMinConcept>
            <classId>323508007</classId>
            <className>Broad spectrum penicillin antibacterial agent</className>
            <classType>DISPOS</classType>
            <classUrl>http://snomed.info/id/323508007</classUrl>
        </rxclassMinConcept>
        <rxclassMinConcept>
            <classId>323508007</classId>
            <className>Broad spectrum penicillin antibacterial agent</className>
            <classType>STRUCT</classType>
            <classUrl>http://snomed.info/id/323508007</classUrl>
        </rxclassMinConcept>
        <rxclassMinConcept>
            <classId>323508007</classId>
            <className>Broad spectrum penicillin antibacterial agent</className>
            <classType>THERAP</classType>
            <classUrl>http://snomed.info/id/323508007</classUrl>
        </rxclassMinConcept>
    </rxclassMinConceptList>
</rxclassdata>