RxNorm API
getAllNDCsByStatus
- Information returned
- NDCs having a specified NDC status
- Service domain
- https://rxnav.nlm.nih.gov
- HTTP request
- GETÂ /REST/allNDCstatus.xml?status=S
Description
The resource is a list of National Drug Codes (NDCs) that have appeared in RxNav's data sources. The list is optionally filtered by the status parameter.
- ACTIVE
- The NDC is recognized by RxNorm as active and is associated with an active concept. The RxCUI associated with the NDC is contained in the returned history data.
- OBSOLETE
- The NDC previously existed in RxNorm, but is no longer recognized as active. The history data will indicate the time periods and RxCUI(s) associated with the NDC.
- ALIEN
- The NDC is or was contained only in a source vocabulary other than RxNorm. This status means that the NDC has never been active in RxNorm.
- UNKNOWN
- The NDC is unknown or invalid. This means that the NDC has never been active in RxNorm, is not in a source vocabulary other than RxNorm, and no history data is available.
Scope
Current and Historical: concepts in current and previous RxNorm data sets
Parameters
Parameter | Location | Use | Description | Default |
---|---|---|---|---|
format | Path | Optional | Notation for results One of:
| .xml |
status | Query | Optional | NDC status(es) One or more of:
(Space-separated list.) | ALL |
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 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
- ndcList
- ndc (array)
- National Drug Code (NDC) in CMS 11-digit format
See also
Example: Active NDCs
XML: https://rxnav.nlm.nih.gov/REST/allNDCstatus?status=active
JSON: https://rxnav.nlm.nih.gov/REST/allNDCstatus.json?status=active
An XML result is shown below.
<rxnormdata> <ndcList> <ndc>00002015201</ndc> <ndc>00002021301</ndc> <ndc>00002024301</ndc> <ndc>00002115201</ndc> <ndc>00002121401</ndc> <ndc>00002124301</ndc> <ndc>00002134001</ndc> ... </ndcList> </rxnormdata>