TL;DR
The FDA NDC (National Drug Code) API from openFDA provides searchable access to the complete US drug product listing. Every prescription and over-the-counter drug marketed in the US has a unique 10-digit NDC identifying the labeler, product, and package size. You can search by brand name, active ingredient, manufacturer, or NDC number. The API returns product details including marketing status, dosage form, route of administration, and listing expiration date.
Quick start: https://api.fda.gov/drug/ndc.json?search=ibuprofen&limit=1
No API key needed — just make a request!
How to Use This API
1. Search by Drug Name
https://api.fda.gov/drug/ndc.json?search=ibuprofen&limit=3
2. Search by NDC Code
https://api.fda.gov/drug/ndc.json?search=product.ndc:0006-0107
3. Filter by Manufacturer
https://api.fda.gov/drug/ndc.json?search=openfda.manufacturer_name:Pfizer&limit=5
4. JavaScript — Drug Lookup
fetch('https://api.fda.gov/drug/ndc.json?search=aspirin&limit=5')
.then(r => r.json())
.then(d => {
d.results.forEach(r => {
const of = r.openfda;
console.log(of.brand_name?.[0] || 'Generic', '-',
r.active_ingredients[0].name, r.active_ingredients[0].strength);
});
});
5. Python — Get NDC Details
import requests
resp = requests.get('https://api.fda.gov/drug/ndc.json', params={
'search': 'metformin',
'limit': 3
})
data = resp.json()
for r in data['results']:
print(f"{r['product_ndc']} | "
f"{r['nonproprietary_name']} | "
f"{r['dosage_form_name']}")
https://api.fda.gov/drug/ndc.json?search=ibuprofen&limit=2
API Details
- API URL
https://api.fda.gov/drug/ndc.json- Documentation
- open.fda.gov/drug/ndc/
- Category
- Health
- Authentication
- Not Required
- Geographic Coverage
- USA
Frequently Asked Questions
- What exactly is an NDC?
- A National Drug Code is a unique 10-digit, 3-segment identifier for each drug product in the US. It identifies the labeler (manufacturer/distributor), product, and package size.
- Can I search by active ingredient?
- Yes, search by
active_ingredients.name:acetaminophento find all products containing that ingredient, including combination products. - How often is the NDC database updated?
- The FDA updates the NDC directory daily as new products are approved and listed. The API reflects the latest data from the FDA's SPL (Structured Product Labeling) repository.
- What is openfda in the response?
- The
openfdafield contains normalized identifiers likebrand_name,generic_name,manufacturer_name,unii(unique ingredient identifier), andrxcui(RxNorm concept ID). - Does it include OTC (over-the-counter) drugs?
- Yes, the NDC directory includes both prescription and OTC drug products marketed in the US.
What You Can Build
- Drug information lookup tool for healthcare apps
- NDC barcode scanner web app
- Formulary database for insurance applications
- Drug interaction checker using active ingredient data
- Pharmacy inventory management system