Open Source · Self-Hostable

FDA drug data,
one API call away

Ingest the complete NDC Directory and Drugs@FDA datasets daily. Serve via REST with sub-5ms lookups. Drop-in openFDA replacement.

$ docker compose up -d
<5ms
P95 NDC Lookup
112K+
Products Loaded
212K+
Packages Indexed
Daily
FDA Sync
Simple, powerful endpoints
RESTful API with key authentication. Explore interactively via the built-in Swagger UI.
GET /api/ndc/{ndc} Lookup by NDC code
Request
curl -H "X-API-Key: your-key" \
  https://your-host/api/ndc/0002-1433
Response
{
  "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"
    }
  ]
}
GET /api/ndc/search?q={query} Full-text search
Request
curl -H "X-API-Key: your-key" \
  "https://your-host/api/ndc/search?q=metformin&limit=2"
Response
{
  "results": [
    {
      "product_ndc": "0093-7214",
      "brand_name": "Metformin HCl",
      "generic_name": "Metformin Hydrochloride",
      "dosage_form": "TABLET",
      "route": ["ORAL"]
    }
  ],
  "total": 847,
  "limit": 2,
  "offset": 0
}
GET /api/openfda/ndc.json openFDA drop-in
Request
curl -H "X-API-Key: your-key" \
  "https://your-host/api/openfda/ndc.json?\
search=brand_name:Prozac&limit=1"
Response
{
  "meta": {
    "results": {
      "skip": 0,
      "limit": 1,
      "total": 3
    }
  },
  "results": [
    {
      "product_ndc": "0002-1433",
      "brand_name": "Prozac",
      "active_ingredients": [
        {
          "name": "FLUOXETINE HYDROCHLORIDE",
          "strength": "20mg"
        }
      ]
    }
  ]
}
GET /health Service health (no auth)
Request
curl https://your-host/health
Response
{
  "status": "ok",
  "version": "1.0.0",
  "uptime": "72h14m",
  "dependencies": [
    {
      "name": "postgres",
      "status": "connected",
      "latency_ms": 1
    }
  ]
}
Everything you need for drug data
Replace your openFDA dependency with a self-hosted API that's faster, more reliable, and fully under your control.
📦

FDA Data Ingestion

Automated daily download of NDC Directory and Drugs@FDA datasets. Atomic swap ensures consumers never see partial data.

🔍

NDC Lookup

Any NDC format accepted — hyphenated, unhyphenated, 2-segment, 3-segment. All FDA patterns handled. Sub-5ms P95.

Full-Text Search

PostgreSQL-powered search across brand names, generic names, and manufacturers. Prefix matching and relevance ranking.

🔄

openFDA Compatible

Drop-in replacement for /drug/ndc.json. Same response format, same search syntax. Zero code changes.

Up and running in minutes
rx-dag runs as a Docker Compose stack with PostgreSQL.
1

Clone and configure

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"
2

Start the stack

Docker Compose brings up PostgreSQL and rx-dag together.

docker compose up -d
3

Trigger a data load

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
4

Query drug data

Once loaded, start querying.

curl -H "X-API-Key: your-secret-key" \
  "http://localhost:8081/api/ndc/search?q=aspirin"

Ready to own your drug data?

Self-host the complete FDA NDC Directory. No rate limits, no external dependencies, sub-5ms lookups.