APIs

Prescribable RxNorm API

findRxcuiByString

Information returned
Concepts with a specified name
Service domain
https://rxnav.nlm.nih.gov
HTTP request
GET  /REST/Prescribe/rxcui.xml?name=yourName&allsrc=0or1&srclist=yourSources&search=0or1or2

Description

Searches for a name (from any vocabulary in RxNorm) and returns the RxCUIs associated with the name.

The scope of the search is either Active concepts (allsrc=0) or Current concepts (allsrc=1). When the scope is Current concepts, only concepts that have at least one atom from a source in the srclist parameter are returned.

The precision of the search is adjustable with the search parameter. An exact search ignores only upper/lowercase. A normalized search is less strict. A combination search tries an exact search, then a normalized search if nothing was found.

Normalized matching broadens the recall of the exact match by eliminating sources of discrepancies that are usually not meaningful in drug names:

  • Word order

  • Case sensitivity

  • Punctuation

  • Suffixes that might be English inflections

  • Abbreviations, e.g., "hctz" is expanded to "hydrochlorothiazide"

  • Salts forms, e.g. "morphine sulfate" becomes "morphine"

Scope

Selectable (see parameters):

  • Active: concepts in the current RxNorm data set that have an atom with SAB=RXNORM and SUPPRESS=N

  • Current: concepts in the current RxNorm data set that have an atom with SUPPRESS=N

Parameters

ParameterLocationUseDescriptionDefault
formatPathOptional

Notation for results

One of:
.xml
Get results in XML
.json
Get results in JSON
.xml
nameQueryRequiredName of concept to find
allsrcQueryOptionalScope of search
One of:
0
Active concepts
1
Current concepts
0
srclistQueryOptionalSource vocabularies to search (if allsrc=1)

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

ALL
searchQueryOptionalPrecision
One of:
0
Exact match only
1
Normalized match
2
Best match (exact or normalized)
0

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 rxnormdata. It is described in the XML Schema for the Prescribable RxNorm 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 rxnormdata. 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:

rxnormdata
Root element in XML, or anonymous object in JSON
idGroup
rxnormId (array)
A concept associated with the requested ID

Example: Find drug by name

XML: https://rxnav.nlm.nih.gov/REST/Prescribe/rxcui?name=lipitor

JSON: https://rxnav.nlm.nih.gov/REST/Prescribe/rxcui.json?name=lipitor

An XML result is shown below.

<rxnormdata>
    <idGroup>
        <rxnormId>153165</rxnormId>
    </idGroup>
</rxnormdata>