NDC to RxCUI, and back
If you exchange medication data with clinical systems, you will meet two identifiers: the NDC, which names a package, and the RxCUI, the RxNorm code that names a clinical drug. They answer different questions, and mixing them up causes most of the bugs we see in medication data.
Two identifiers, two jobs
An NDC names a package: the labeler, the product and the size. 50580-488-10 is a 100-count bottle of Tylenol Extra Strength. It changes when the maker, the package or the listing changes, and it’s the code barcodes, dispensing and claims run on.
An RxCUI names a drug concept: ingredient, strength and dose form. 198440 is acetaminophen 500 mg oral tablet. It changes when the drug itself does, and it’s the code clinical lists, interoperability and decision support run on.
The RxCUI is the more stable of the two. A common generic is sold by dozens of labelers in many package sizes, each with its own NDC, and they all share one RxCUI for the clinical drug. On the day this was written, lisinopril 10 mg oral tablet (314076) had 159 packages from 34 labelers.
If you came here looking for an RxNorm API, these two lookups are probably what you need.
NDC → RxCUI is a lookup
Going from a package to its drug takes one call:
GET /v1/drugs/ndc/50580-488-10
Authorization: Bearer pw_test_…
The answer, trimmed:
{
"as_of": "2026-10-22T09:35:18Z",
"drug": {
"id": "pw_d_5f50835041408f19",
"rxcui": "209459",
"tty": "SBD",
"names": {
"rxcui_name": "acetaminophen 500 MG Oral Tablet [Tylenol]"
},
"ingredients": [{ "name": "acetaminophen", "rxcui": "161" }],
"packages": [{ "display": "50580-488-10", "ndc11": "50580048810" }]
}
}
The RxCUI here is 209459, where you might have expected 198440. Tylenol is a branded product, so its package maps to the branded drug, which has a different RxCUI from the generic (more on levels below). The ingredient comes back with its own RxCUI too, 161, and that’s the one allergy checks want.
Most packages map to exactly one drug. Two kinds don’t, and your code should handle both as ordinary cases:
- No RxCUI. Some kits, devices and products that are new or unusual have none yet. Store the NDC and resolve it again later.
- More than one. Now and then a package is listed under two clinical drugs. When a code matches more than one drug, the lookup returns a
409instead of picking one for you.
RxCUI → NDC is one-to-many
Going the other way gives you a list:
GET /v1/drugs/rxcui/314076
GET /v1/drugs/{id}/packages
The first call finds the drug, and the second lists the packages that belong to it. Any of them is “right”. Which one matters depends on the job: the pharmacy’s stock, the plan’s formulary, or the bottle in the member’s hand. If you need one NDC from an RxCUI, you need a rule for choosing, and the rule is a business decision.
Brands, generics and levels
RxCUIs exist at several levels, and each has a term type (tty) you will see in responses:
| Level | tty |
Example |
|---|---|---|
| Ingredient | IN |
161: acetaminophen |
| Clinical drug | SCD |
198440: acetaminophen 500 mg oral tablet |
| Branded drug | SBD |
209459: acetaminophen 500 mg oral tablet [Tylenol] |
A branded drug and its generic are different RxCUIs that share an ingredient. An ingredient has no packages of its own: look up 161 and you get acetaminophen with an empty package list, because nobody sells “acetaminophen” without a strength and form.
Decide which level each feature needs:
- A member’s medication list: the clinical or branded drug, whichever they picked. If they take Tylenol, keep Tylenol.
- Allergy and interaction checks: the ingredient.
- Dispensing and claims: the NDC.
In code
A server-side lookup that keeps the edge cases explicit:
// NDC in, RxCUI (or a reason there isn't one) out.
async function rxcuiForNdc(ndc) {
const res = await fetch(`https://api.pillwise.dev/v1/drugs/ndc/${encodeURIComponent(ndc)}`, {
headers: { Authorization: `Bearer ${process.env.PILLWISE_KEY}` },
});
if (res.status === 404) return { status: "unknown_ndc" };
if (res.status === 409) return { status: "ambiguous" };
if (!res.ok) throw new Error(`lookup failed: ${res.status}`);
const { as_of, drug } = await res.json();
return {
status: drug.rxcui ? "ok" : "no_rxcui",
drug_id: drug.id,
rxcui: drug.rxcui ?? null,
level: drug.tty ?? null,
ingredients: drug.ingredients.map((i) => i.rxcui),
as_of,
};
}
Send the NDC in whatever shape you have it. NDC formats covers why a bare 10-digit code is matched only as listed, never padded by guesswork.
What to store
Store what you were given, what it resolved to, and when:
{
"ndc": "50580-0488-10",
"drug_id": "pw_d_5f50835041408f19",
"rxcui": "209459",
"as_of": "2026-10-22"
}
Codes get relisted, merged and retired. If you keep the original code and the date, you can always re-resolve it, and you can always explain what it meant on the day you saved it. When RxCUIs change covers how to keep stored codes current.
Both lookups are in every plan, including the free sandbox. Get a key or look up an NDC first.