Ingest the complete NDC Directory and Drugs@FDA datasets daily. Serve via REST with sub-5ms lookups. Drop-in openFDA replacement.
curl -H "X-API-Key: your-key" \ https://your-host/api/ndc/0002-1433
{
"product_ndc": "0002-1433",
"brand_name": "Prozac",
"generic_name": "Fluoxetine Hydrochloride",
"dosage_form": "CAPSULE",
"route": ["ORAL"],
"manufacturer": "Eli Lilly and Company",
"packages": [
{
"package_ndc": "0002-1433-02",
"description": "100 CAPSULE in 1 BOTTLE"
}
]
}
curl -H "X-API-Key: your-key" \ "https://your-host/api/ndc/search?q=metformin&limit=2"
{
"results": [
{
"product_ndc": "0093-7214",
"brand_name": "Metformin HCl",
"generic_name": "Metformin Hydrochloride",
"dosage_form": "TABLET",
"route": ["ORAL"]
}
],
"total": 847,
"limit": 2,
"offset": 0
}
curl -H "X-API-Key: your-key" \ "https://your-host/api/openfda/ndc.json?\ search=brand_name:Prozac&limit=1"
{
"meta": {
"results": {
"skip": 0,
"limit": 1,
"total": 3
}
},
"results": [
{
"product_ndc": "0002-1433",
"brand_name": "Prozac",
"active_ingredients": [
{
"name": "FLUOXETINE HYDROCHLORIDE",
"strength": "20mg"
}
]
}
]
}
curl https://your-host/health
{
"status": "ok",
"version": "1.0.0",
"uptime": "72h14m",
"dependencies": [
{
"name": "postgres",
"status": "connected",
"latency_ms": 1
}
]
}
Automated daily download of NDC Directory and Drugs@FDA datasets. Atomic swap ensures consumers never see partial data.
Any NDC format accepted — hyphenated, unhyphenated, 2-segment, 3-segment. All FDA patterns handled. Sub-5ms P95.
PostgreSQL-powered search across brand names, generic names, and manufacturers. Prefix matching and relevance ranking.
Drop-in replacement for /drug/ndc.json. Same response format, same search syntax. Zero code changes.
Clone the repository and set your API key.
git clone https://github.com/finish06/ndc-loader.git cd ndc-loader export API_KEYS="your-secret-key"
Docker Compose brings up PostgreSQL and rx-dag together.
docker compose up -d
Kick off the initial FDA data ingestion. Runs daily automatically after this.
curl -X POST -H "X-API-Key: your-secret-key" \ http://localhost:8081/api/admin/load
Once loaded, start querying.
curl -H "X-API-Key: your-secret-key" \ "http://localhost:8081/api/ndc/search?q=aspirin"
Self-host the complete FDA NDC Directory. No rate limits, no external dependencies, sub-5ms lookups.