APIs

RxClass API

getRelas

Information returned
Relationships expressed by a source of drug relations
Service domain
https://rxnav.nlm.nih.gov
HTTP request
GET  /REST/rxclass/relas.xml?relaSource=value

Description

Get the drug-to-class relationships from a given source (relaSource parameter).

See the RxClass Overview for a table that shows the relationships each drug source uses to identify with the drug class.

Parameters

ParameterLocationUseDescriptionDefault
formatPathOptional

Notation for results

One of:
.xml
Get results in XML
.json
Get results in JSON
.xml
relaSourceQueryOptionalSource of drug relations

(See getSourcesOfDrugClassRelations for the menu.)

ALL

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
relaList
rela (array)
Relationship

Example: Drug-class relationships from DailyMed

XML: https://rxnav.nlm.nih.gov/REST/rxclass/relas?relaSource=dailymed

JSON: https://rxnav.nlm.nih.gov/REST/rxclass/relas.json?relaSource=dailymed

An XML result is shown below.

<rxclassdata>
    <relaList>
        <rela>has_chemical_structure</rela>
        <rela>has_epc</rela>
        <rela>has_moa</rela>
        <rela>has_pe</rela>
    </relaList>
</rxclassdata>