pharmacopeia
NewSemantic retrieval, grounded tier, and webhooksv0 · early preview

An open API for medications

Drugs, classes, interactions, indications, and 2D structures — structured, versioned, free. A developer-first reference layer for the world’s pharmacopeia, available over REST, GraphQL, and first-party SDKs.

2,577DrugsRxNav · openFDA · PubChem
2,208ClassesATC · EPC · MoA
2,577IngredientsActive substances
2,522IndicationsICD-10 mapped

One fetch away from every prescription.

Predictable URLs. JSON in, JSON out. Every response is validated with Zod against the same schema that generates these docs, the SDKs, and the OpenAPI document — so the shape never surprises you.

GET /api/v1/drug/metforminjson
{
  "slug": "metformin",
  "name": "Metformin",
  "jurisdiction": "US-FDA",
  "classes": [
    { "slug": "biguanide", "name": "Biguanide", "kind": "epc" }
  ],
  "mechanism": {
    "summary": "Decreases hepatic glucose production via inhibition of mitochondrial glycerophosphate dehydrogenase …",
    "targets": ["AMP-activated protein kinase (AMPK)"]
  },
  "indications": [
    { "text": "Type 2 diabetes mellitus", "icd10": ["E11"] }
  ],
  "identifiers": {
    "rxcui": "6809",
    "atc": ["A10BA02"],
    "drugbank": "DB00331"
  }
}
@pharmacopeia/clientts
// npm i @pharmacopeia/client
import { Pharmacopeia } from "@pharmacopeia/client";

const pc = new Pharmacopeia();
const metformin = await pc.getDrug("metformin");
const pairs = await pc.checkInteractions([
  "warfarin",
  "ibuprofen",
]);
  • Strongly-typed schema for drugs, classes, interactions, and indications.
  • Open data — every entity has a verifiable source URL and hash.
  • Generated docs, SDKs, and OpenAPI 3.1 from the same Zod schema.
01 · Browse

Explore the dataset

Every entity is keyed by a stable slug and links back to the canonical public source it came from.

Drugs2,577

Mechanism, indications, dosing, identifiers, and 2D structures rendered offline from PubChem.

metformin
atorvastatin
aspirin
sertraline
omeprazole
lisinopril
ibuprofen
warfarin
Classes2,208

Pharmacological classes from FDA EPC, WHO ATC, MoA, and MeSH.

  • StatinHMG-CoA Reductase InhibitorEPC
  • BiguanidesA10BAATC
  • ACE inhibitorEC 3.4.15.1MoA
  • Antidepressive AgentsD000928MeSH
ATC tree

Walk the WHO Anatomical Therapeutic Chemical hierarchy, levels 1–5.

A  · Alimentary tract and metabolism
└─ A10  · Drugs used in diabetes
   └─ A10B · Blood glucose lowering
      └─ A10BA · Biguanides
         └─ metformin
MoA graph

Tripartite network of drugs, mechanism-of-action classes, and molecular targets.

targetdrugmoa
Brands

Brand-to-generic crosswalk. Land on Glucophage, pivot to metformin.

  • Glucophagemetformin
  • Lipitoratorvastatin
  • Tylenolacetaminophen
  • Zoloftsertraline
03 · Ground

Retrieval your LLM can cite

Every record is chunked into small, citable passages. Search them by meaning over plain REST — then reach for the grounded tier when a model needs a verifiable source behind every token.

POST /api/v1/groundedts
// POST /api/v1/grounded — retrieval built for LLMs
const res = await fetch("/api/v1/grounded", {
  method: "POST",
  headers: { Authorization: "Bearer pk_live_…" },
  body: JSON.stringify({ query: "metformin renal dosing" }),
});

const { passages, citations } = await res.json();
// every passage.grounding span maps to a citation with
// sourceUrl, sourceHash, extractedAt, confidence

A community project, made by and for the people who build with medical data.

pharmacopeia is unaffiliated with the FDA, NIH, or any regulatory agency. We host structured facts (mechanism, identifiers, dosing) and link out to the canonical source for every field. Educational and informational use only.

Search pharmacopeia

Search drugs, classes, and ingredients