canonical: https://jentic.com/apis/open.fda.gov/openfda

# Open Fda Gov openFDA Drug API

Jentic publishes the only available OpenAPI specification for openFDA Drug API, keeping it validated and agent-ready. openFDA is the U.S. Food and Drug Administration's open-data platform, and its Drug API exposes adverse-event reports (FAERS), product labeling, the National Drug Code (NDC) directory, recall enforcement reports, Drugs@FDA approvals, and drug-shortage information through a consistent JSON search interface. The API is keyless for low-volume use and accepts a Lucene-style search syntax over each dataset, so agents can return either matching records or aggregate counts.

## For AI agents

Search U.S. FDA drug data - adverse events, labels, NDC directory, recalls, approvals, and shortages - through a single keyless search API. Useful for clinical, regulatory, and safety-monitoring agents.

## Scope

Does not handle FDA device or food data, EHR access, or prescription writing - use for U.S. drug adverse-event, label, NDC, recall, approval, and shortage lookups only.

## Capabilities

- Search FAERS adverse-event reports for a drug name and aggregate by reaction or seriousness
- Look up the official FDA-approved product label for a drug, including indications and contraindications
- Resolve a brand name to its NDC and active ingredient via the NDC directory
- List enforcement reports for a drug recall and pull the classification, reason, and affected lots
- Pull Drugs@FDA approval records to see when a drug was approved and by which sponsor
- Check the current FDA drug-shortage list for an active ingredient or therapeutic class

## Use cases

### Pharmacovigilance Signal Search

Search FAERS adverse-event reports for a drug to surface the most frequently reported reactions and seriousness flags. GET /drug/event.json accepts a Lucene-style search clause and a count parameter, so a pharmacovigilance agent can pull the top reactions in one call rather than iterating reports by hand.

Example prompt: Call GET /drug/event.json with search='patient.drug.medicinalproduct:"IBUPROFEN"' and count='patient.reaction.reactionmeddrapt.exact' and return the 10 most frequent reactions.

### Drug Label Retrieval

Fetch the FDA-approved structured product label for a drug to extract indications, dosage, warnings, and contraindications. GET /drug/label.json returns a single JSON record per labeling submission, which a clinical-decision agent can parse into a structured summary for a clinician or patient-facing tool.

Example prompt: Call GET /drug/label.json with search='openfda.brand_name:"LIPITOR"' and return the indications_and_usage and contraindications fields from the first record.

### Drug-Shortage Monitoring

Track which drugs are currently flagged as in shortage by the FDA so a hospital pharmacy or supply-chain agent can plan substitutions. GET /drug/drugshortages.json returns the current shortage status, reason, and resolution date for a queried product.

Example prompt: Call GET /drug/drugshortages.json with search='generic_name:"AMOXICILLIN"' and return any records where status is 'Currently in Shortage'.

### Recall Tracking by Manufacturer

Pull every drug recall enforcement report for a manufacturer, with classification (Class I, II, III), reason, and the affected lot ranges. GET /drug/enforcement.json supports filtering by recalling firm and date so a regulatory agent can monitor a vendor's recall history continuously.

Example prompt: Call GET /drug/enforcement.json with search='recalling_firm:"Acme Pharma"' and return any Class I recalls in the last 12 months.

### AI Agent Clinical Lookup

Let a Jentic-orchestrated clinical agent answer questions about a drug - adverse events, label, recalls, shortages - through a single search that picks the right openFDA endpoint. The agent never holds the optional API key directly; Jentic appends it to raise the rate limit when needed.

Example prompt: Search Jentic for 'look up FDA adverse events for a drug', load the GET /drug/event.json schema, and execute with the drug name from the user's question, returning the top reactions.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /drug/event.json | Search FAERS adverse-event reports |
| GET | /drug/label.json | Search FDA-approved drug product labels |
| GET | /drug/ndc.json | Search the NDC directory |
| GET | /drug/enforcement.json | Search drug recall enforcement reports |
| GET | /drug/drugsfda.json | Search Drugs@FDA approval records |
| GET | /drug/drugshortages.json | Search FDA drug shortages |

## Key resources

- **Adverse Events** — Search FAERS reports and aggregate by reaction or seriousness.
- **Product Labeling** — FDA-approved structured product labels with indications, dosage, and warnings.
- **NDC Directory** — Resolve brand name to NDC, generic name, and active ingredient.
- **Enforcement** — Drug recall enforcement reports by manufacturer and classification.
- **Drugs@FDA** — Drug approval records including sponsor and approval date.
- **Drug Shortages** — Current and historical FDA drug-shortage status.

## Why Jentic

- **Setup:** Wiring the openFDA Drug API by hand means appending your api_key query parameter, learning the Elasticsearch-style search syntax, and paging results yourself. Through Jentic you install once, import the openFDA Drug API from the API Directory, store the API key once, and your agent calls it.
- **Permission scoping:** The openFDA Drug API is read-only and takes its search terms as query parameters rather than a resource id in the URL path, so limit the agent to the operations it needs, such as searching adverse events, labels, or recall enforcement reports. You credit the agent only with the operations you allow.
- **Credential handling:** Your openFDA API key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'search drug adverse-event reports' or 'look up an approved drug label', and Jentic returns the matching openFDA Drug operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **ClinicalTrials.gov API** — Search U.S. clinical-trial registrations and results.
- **NCBI Datasets API** — Access NIH-hosted biomedical datasets and gene/genome metadata.
- **NLM Clinical Tables API** — NIH-hosted clinical terminology lookup (RxTerms, drug names, conditions).
- **NLM API** — Broader National Library of Medicine API for biomedical literature and metadata.

## FAQ

### Why is there no official OpenAPI spec for openFDA Drug API?

openFDA publishes documentation per dataset on open.fda.gov but does not maintain a single OpenAPI document covering the Drug endpoints together. Jentic generates and maintains this spec so AI agents and developers can call openFDA Drug API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the openFDA Drug API use?

openFDA accepts an optional api_key query parameter. Without a key the limit is 40 requests per minute and 1,000 per day; with a key it rises to 240 requests per minute and 120,000 per day. Through Jentic the api_key is held in the vault and appended at execution time.

### Can I aggregate adverse events by reaction in a single call?

Yes. GET /drug/event.json supports a count parameter that returns aggregated counts grouped by a field, such as patient.reaction.reactionmeddrapt.exact, in one response. This is the canonical way to get top-N reactions without paging individual reports.

### What are the rate limits for the openFDA Drug API?

Without an API key: 40 requests per minute and 1,000 per day. With an API key: 240 per minute and 120,000 per day. The query-string api_key parameter is the only knob; there is no per-endpoint quota differentiation.

### How do I look up adverse events for a drug through Jentic?

Run pip install jentic and search for 'look up FDA adverse events for a drug'. Jentic returns the GET /drug/event.json operation; load the schema and execute with a search clause like 'patient.drug.medicinalproduct:"IBUPROFEN"' to receive matching reports or aggregate counts.

### Does openFDA cover devices and food as well as drugs?

openFDA also exposes Device and Food datasets, but this spec is the Drug API only - the six endpoints above are scoped to FAERS, label, NDC, enforcement, Drugs@FDA, and shortages. Device and food queries require separate openFDA endpoints not in this spec.

### Can I limit what my agent is allowed to do with the openFDA Drug API?

Yes. Because you run Jentic One yourself, you decide which openFDA Drug operations the agent may call, so you can allow only searching adverse-event reports, product labels, the NDC directory, recall enforcement reports, Drugs@FDA approvals, or drug shortages. The API is read-only and takes its search terms as query parameters rather than a resource id in the URL path, so there are no write actions to permit and the agent can only run the read operations you grant. Your rules also control the credential used, so the optional API key is applied only when you allow it.
