Build a drug price lookup with NADAC pharmacy costs
- Data
- NDC
- Endpoints
- /v1/drugs/nadac/v1/drugs/nadac/{ndc}
- MCP tools
- get_drug_price, search_drugs
- Plan
- Runs on the Free plan
How it works
- Search NADAC by drug name to list the packages and their current per-unit cost.
- Fetch one NDC for its price history to chart the trend.
- Multiply by quantity to estimate the pharmacy's cost for a fill.
The code
TypeScript with @healthcare.dev/sdk. Set HDEV_API_KEY to a free key and run it. Every response carries its source, release and license in meta.
import { HealthcareDev } from "@healthcare.dev/sdk"; const hdev = new HealthcareDev(); export async function priceOptions(name: string, quantity: number) { const { data } = await hdev.drugs.searchNadac({ q: name, limit: 10 }); return data .map((p) => ({ ndc: p.ndc, drug: p.ndc_description, type: p.classification_for_rate_setting, // brand or generic perUnit: Number(p.nadac_per_unit), unit: p.pricing_unit, estimate: Number(p.nadac_per_unit) * quantity, asOf: p.as_of_date, })) .sort((a, b) => a.estimate - b.estimate); } await priceOptions("atorvastatin 20 mg", 30);
Or ask your agent
Connect the MCP server and ask in plain language. It calls get_drug_price, search_drugs and cites what it found.
What does a pharmacy pay for 30 tablets of atorvastatin 20 mg, by NADAC? Cheapest first.
Take it further
- Pair with RxNorm to group every package of the same drug.
- Use the Medicare ASP data for physician-administered (Part B) drugs.
- Chart
/v1/drugs/nadac/{ndc}history to show price changes over time.
Reference data only, not medical advice or a coverage determination. Send codes, NDCs and NPIs, never patient information.
More examples
Claim code checker
Catch non-billable, retired and mistyped ICD-10-CM and HCPCS codes before a claim goes out. One batch call checks up to 100 codes, with the release each answer came from.
Recall and shortage alerts
Watch a list of NDCs for FDA recalls and drug shortages and alert when one appears. Class I recalls first, with the recalling firm, reason and lot codes.
NPI verification
Verify a provider's NPI at sign-up: check digit, whether CMS issued it, active or deactivated, and the name, specialty and license state on record.