APIs

RxClass API

getSourcesOfDrugClassRelations

Information returned
Sources of drug-class relations
Service domain
https://rxnav.nlm.nih.gov
HTTP request
GET  /REST/rxclass/relaSources.xml

Description

Get the list of sources that associate generic drugs to the class types. Resources getClassByRxNormDrugName and getClassMembers use drug sources as function inputs.

See the RxClass Overview for more details on the drug sources and the classes they map into.

Parameters

ParameterLocationUseDescriptionDefault
formatPathOptional

Notation for results

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

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
relaSourceList
relaSourceName (array)
Relationship source

Example: Sources that relate drug classes to members

XML: https://rxnav.nlm.nih.gov/REST/rxclass/relaSources

JSON: https://rxnav.nlm.nih.gov/REST/rxclass/relaSources.json

An XML result is shown below.

<rxclassdata>
    <relaSourceList>
        <relaSourceName>ATC</relaSourceName>
        <relaSourceName>ATCPROD</relaSourceName>
        <relaSourceName>CDC</relaSourceName>
        <relaSourceName>DAILYMED</relaSourceName>
        <relaSourceName>FDASPL</relaSourceName>
        <relaSourceName>FMTSME</relaSourceName>
        <relaSourceName>MEDRT</relaSourceName>
        <relaSourceName>RXNORM</relaSourceName>
        <relaSourceName>SNOMEDCT</relaSourceName>
        <relaSourceName>VA</relaSourceName>
    </relaSourceList>
</rxclassdata>