Agent skill

Querying Openfda Labels

by maziyarpanahi in maziyarpanahi/openmed

Looks up FDA drug labels, NDC directory entries, indications, boxed warnings, and recalls/enforcement actions via the free public OpenFDA API to enrich drugs that OpenMed extracts.

Apache-2.0Auto-check passed

Install Querying Openfda Labels

skills CLI
$ npx skills add maziyarpanahi/openmed --skill querying-openfda-labels -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install maziyarpanahi/openmed querying-openfda-labels --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/maziyarpanahi/openmed.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/querying-openfda-labels .claude/skills/querying-openfda-labels && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
querying-openfda-labels
GitHub stars
5.5k
Token cost
~1.9k tokens
SKILL.md length
626 words
Files
1
Skills in repo
74
Repo updated
First seen
Licence
Apache-2.0

At a glance

Looks up FDA drug labels, NDC directory entries, indications, boxed warnings, and recalls/enforcement actions via the free public OpenFDA API to enrich drugs that OpenMed extracts.

  • Works in 6 steps: Normalize the drug name first. Use… → Query /drug/label with… → Query /drug/ndc for package-level codes,… → …
  • The user wants the prescribing information for a drug
  • SKILL.md covers When to use, The three endpoints, Quick start (real OpenFDA… and Workflow, plus 3 more sections
  • Reaches api.fda.gov

What it does

Querying Openfda Labels is an agent skill from maziyarpanahi/openmed. Looks up FDA drug labels, NDC directory entries, indications, boxed warnings, and recalls/enforcement actions via the free public OpenFDA API to enrich drugs that OpenMed extracts. Use when the user wants the prescribing information for a drug, its boxed warning, approved indications, dosage forms and routes, package NDC codes, RxCUI, or whether a product has an open recall. Trigger keywords: OpenFDA, drug label, SPL, prescribing information, boxed warning, black box warning, indications, NDC, package code…

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: Local-first healthcare AI: clinical NER and HIPAA PII de-identification on hardware you control. 2,200+ medical models, 35 model-backed PII languages, and Python, MLX, Android… The licence is Apache-2.0.

When your agent uses it

  • The user wants the prescribing information for a drug
  • Its boxed warning
  • Approved indications
  • Dosage forms and routes

Example prompts

  • “Use the querying-openfda-labels skill to look up FDA drug labels, NDC directory entries, indications, boxed warnings, and recalls/enforcement…”
  • “/querying-openfda-labels”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Normalize the drug name first. Use openmed.analyze_text to get the span,
  2. Query /drug/label with openfda.generic_name:"" (or
  3. Query /drug/ndc for package-level codes, dosage form, and route.
  4. Query /drug/enforcement filtered to status:"Ongoing" to surface open
  5. Cache results — labels change rarely; you do not need to re-query per note.
  6. Attach the facts to the extracted drug keyed by RxCUI/NDC for traceability.

What it can do on your machine

Read from SKILL.md and the folder at commit 9dca507. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • api.fda.gov

    Also links to:

    • open.fda.gov
    • fda.gov
    • dailymed.nlm.nih.gov

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Querying Openfda Labels loads about 1.9k tokens when it runs. Until then it costs about 210 tokens; SKILL.md has 626 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~210
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from maziyarpanahi/openmed at commit 9dca507, republished under its Apache-2.0 licence (© maziyarpanahi). 626 words, ~1,872 tokens.

Download SKILL.mdSave it as .claude/skills/querying-openfda-labels/SKILL.md (or your agent's skills folder).
name
querying-openfda-labels
description
Looks up FDA drug labels, NDC directory entries, indications, boxed warnings, and recalls/enforcement actions via the free public OpenFDA API to enrich drugs that OpenMed extracts. Use when the user wants the prescribing information for a drug, its boxed warning, approved indications, dosage forms and routes, package NDC codes, RxCUI, or whether a product has an open recall. Trigger keywords: OpenFDA, drug label, SPL, prescribing information, boxed warning, black box warning, indications, NDC, package code, recall, enforcement, Class I recall, drug enrichment. Pairs adjacent to OpenMed NER: take a drug name (or RxNorm RxCUI) from openmed.analyze_text and resolve its label, NDC, and recall status. OpenFDA is public and free — no license barrier; send only de-identified drug names, never raw clinical notes.
license
Apache-2.0
metadata.project
OpenMed
metadata.category
safety-pharmacovigilance
metadata.pairs
adjacent
metadata.version
1.0

Querying OpenFDA drug labels, NDC, and recalls

Once OpenMed has pulled a drug name out of a note, you often need authoritative product facts: the boxed warning, approved indications, dosage form / route, package NDC codes, and whether the product is under recall. The FDA's OpenFDA API exposes the Structured Product Labeling (SPL), the NDC directory, and enforcement (recall) reports — all public and free.

This skill is enrichment: it attaches regulatory facts to an extracted drug. It is not clinical decision support — a label lookup informs a human, it does not prescribe.

When to use

  • You extracted a drug and need its boxed warning or indications for display, alerting, or expectedness checks.
  • You need NDC package codes, dosage form, or route for a product.
  • You want to know if a drug/lot is under an open recall (enforcement).
  • You want to map a brand name to its generic ingredient and RxCUI via the label's openfda block.

The three endpoints

EndpointUseKey fields
https://api.fda.gov/drug/label.jsonSPL prescribing infoboxed_warning, indications_and_usage, warnings, dosage_and_administration, openfda.brand_name, openfda.generic_name, openfda.rxcui, openfda.product_ndc
https://api.fda.gov/drug/ndc.jsonNDC directoryproduct_ndc, generic_name, brand_name, dosage_form, route, active_ingredients
https://api.fda.gov/drug/enforcement.jsonRecallsproduct_description, reason_for_recall, classification (Class I/II/III), recalling_firm, status, recall_initiation_date

No key needed to try it (240 req/min, 1,000/day per IP). A free api_key= raises the daily cap to 120,000.

Quick start (real OpenFDA queries)

python
import requests

def openfda(endpoint: str, search: str, limit: int = 1) -> list[dict]:
    url = f"https://api.fda.gov/drug/{endpoint}.json"
    r = requests.get(url, params={"search": search, "limit": limit}, timeout=30)
    if r.status_code == 404:        # OpenFDA returns 404 for zero matches
        return []
    r.raise_for_status()
    return r.json().get("results", [])

# 1) Label: boxed warning + indications for a generic drug.
label = openfda("label", 'openfda.generic_name:"warfarin"')
if label:
    rec = label[0]
    print("Boxed warning:", rec.get("boxed_warning", ["(none)"])[0][:200])
    print("Indication:", rec.get("indications_and_usage", ["(none)"])[0][:200])
    print("RxCUI:", rec.get("openfda", {}).get("rxcui"))

# 2) NDC: package codes, form, route.
ndc = openfda("ndc", 'generic_name:"warfarin"', limit=5)
for rec in ndc:
    print(rec["product_ndc"], rec.get("dosage_form"), rec.get("route"))

# 3) Enforcement: open recalls for a product.
recalls = openfda("enforcement",
                  'product_description:"warfarin"+AND+status:"Ongoing"', limit=5)
for rec in recalls:
    print(rec["classification"], "-", rec["reason_for_recall"][:120])

Workflow

  1. Normalize the drug name first. Use openmed.analyze_text to get the span, then prefer the RxNorm ingredient (see normalizing-rxnorm) as your query term — openfda.generic_name and the NDC generic_name index on the ingredient, so a normalized name hits far more records than raw note text.
  2. Query /drug/label with openfda.generic_name:"<ingredient>" (or openfda.rxcui:"<rxcui>" for an exact product). Read boxed_warning, indications_and_usage, warnings_and_cautions.
  3. Query /drug/ndc for package-level codes, dosage form, and route.
  4. Query /drug/enforcement filtered to status:"Ongoing" to surface open recalls; gate alerts on classification (Class I = most serious).
  5. Cache results — labels change rarely; you do not need to re-query per note.
  6. Attach the facts to the extracted drug keyed by RxCUI/NDC for traceability.
Show full SKILL.md (294 more words)Show less

Hand-off to / from OpenMed

OpenMed's analyze_text returns a dict; result["entities"] items carry text, label, confidence, start, end.

  • From extracting-clinical-entities: Pharmaceutical/Chemical entities are the query seeds. From normalizing-rxnorm: pass the RxCUI to openfda.rxcui:"..." for an exact label match.
  • To reporting-adverse-events: the boxed warning / indications support an expectedness judgment (is this reaction labeled?). To detecting-pv-signals: confirm whether a disproportionality signal is already on-label before escalating.
  • OpenMed runs NER on-device; only a de-identified drug name or RxCUI leaves the process to hit OpenFDA. Never send a raw note containing PHI to the API — de-identify with openmed.deidentify first if you must derive the query from patient text.

Edge cases & gotchas

  • OpenFDA returns 404 for an empty result set, not an empty results list — handle it as "no match" (the helper above does).
  • Multi-value fields are lists. boxed_warning, indications_and_usage, and most SPL sections are arrays of strings (rec["boxed_warning"][0]). Many products have no boxed warning — the key is simply absent.
  • Brand vs generic. openfda.brand_name and openfda.generic_name differ; query the generic (ingredient) for coverage, the brand for a specific product.
  • Labels are SPL snapshots, not real-time. OpenFDA mirrors DailyMed SPL; a brand-new labeling change may lag. For the definitive current label, cross-check DailyMed.
  • NDC formats vary (product_ndc is the 2-segment labeler-product code; package NDCs add a third segment). Normalize before joining to claims data.
  • Recall status is one of Ongoing, Completed, Terminated — filter to Ongoing for active risk; classification Class I > II > III by severity.
  • Public and free, but rate-limited. Register a free key and cache; do not hammer the API per-note in a batch pipeline.

Standards & references

© maziyarpanahi, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/querying-openfda-labels of maziyarpanahi/openmed.

Open the folder on GitHubat commit 9dca507

Compare with similar skills

Querying Openfda Labels next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Querying Openfda Labels compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Querying Openfda Labels this skillmaziyarpanahi/openmed5.5k—~1.9kAutomated safety check: PassApache-2.0
openFDA Regulatory Data Queriesdavila7/claude-code-templates33k11 repos~3.6kAutomated safety check: PassMIT
Drug Labels Searchwu-yc/LabClaw1.1k2 repos~1.2kAutomated safety check: PassMIT
GitHub Labels Querygithub/gh-aw5.4k—~490Automated safety check: PassMIT
ClickHouse Query Performance Validationcomet-ml/opik22k—~2.1kAutomated safety check: PassApache-2.0
Analyzing Experiment Query PerformancePostHog/posthog40k—~3.7kAutomated safety check: PassCustom licence

Similar skills

  • openFDA Regulatory Data Queries

    davila7/claude-code-templates

    Queries the openFDA API from Python for drug, device, food and veterinary data: adverse events, recalls, labels, approvals, NDC and UNII lookups.

    33k GitHub starsUsed in 11 repos~3.6k tokens
    Data & AnalyticsAuto-check passed
  • Drug Labels Search

    wu-yc/LabClaw

    Search FDA drug labels with natural language queries. An agent skill from wu-yc/LabClaw.

    1.1k GitHub starsUsed in 2 repos~1.2k tokens
    Research & ScienceAuto-check passed
  • Official

    List GitHub repository labels with perpage pagination and name filtering support.

    5.4k GitHub stars~490 tokensUpdated today
    Auto-check passed
  • Measures what a ClickHouse query change actually costs, turning a suspicion that a query is slow into numbers a reviewer can act on before it merges.

    22k GitHub stars~2.1k tokensUpdated today
    DatabasesAuto-check passed
  • Pull and interpret production experiment query-performance data from the staff-only /api/debugchqueries endpoints backing the /experiments/staff scene: slowest experiment queries, precompute…

    40k GitHub stars~3.7k tokensUpdated today
    DatabasesAuto-check passed
  • Frontend Query Mutation

    langflow-ai/langflow

    Guide for implementing Langflow frontend query and mutation patterns with Axios and TanStack React Query v5.

    155k GitHub stars~979 tokensUpdated today
    Frontend & DesignAuto-check passed

More from maziyarpanahi/openmed

All 74 skills in this repo
  • Checks OpenMed de-identified clinical text against the 18 HIPAA Safe Harbor identifier categories and reports gaps and residual re-identification risk.

    5.5k GitHub stars~1.7k tokensUpdated yesterday
    Auto-check passed
  • OpenMed Model Card Writer

    maziyarpanahi/openmed

    Fills in a model card for an OpenMed clinical NER or de-identification model from its evaluation reports: intended use, metrics, subgroups and limitations.

    5.5k GitHub stars~1.8k tokensUpdated yesterday
    Auto-check passed
  • Walks a data pipeline against the HIPAA Privacy and Security Rule checklist and produces a gap report before it processes patient data.

    5.5k GitHub stars~2k tokensUpdated yesterday
    Auto-check passed
  • ICD-10 Coding Assistant

    maziyarpanahi/openmed

    Suggests candidate ICD-10-CM diagnosis and ICD-10-PCS procedure codes for clinical text extracted by OpenMed, with rationale for a certified coder to review.

    5.5k GitHub stars~2k tokensUpdated yesterday
    Auto-check passed
  • OpenMed ETL to OMOP CDM

    maziyarpanahi/openmed

    Maps OpenMed-extracted, terminology-coded conditions, drugs and measurements into OMOP CDM v5.4 tables for OHDSI and ATLAS analytics.

    5.5k GitHub stars~1.9k tokensUpdated yesterday
    Auto-check passed
  • Extracting SDOH and Z-Codes

    maziyarpanahi/openmed

    Finds social risks such as housing instability or food insecurity in clinical notes and proposes matching ICD-10-CM Z-codes for a coder to confirm.

    5.5k GitHub stars~1.9k tokensUpdated yesterday
    Auto-check passed

Questions about Querying Openfda Labels

What does Querying Openfda Labels do?

Looks up FDA drug labels, NDC directory entries, indications, boxed warnings, and recalls/enforcement actions via the free public OpenFDA API to enrich drugs that OpenMed extracts. Querying Openfda Labels is an agent skill from maziyarpanahi/openmed. Looks up FDA drug labels, NDC directory entries, indications, boxed warnings, and recalls/enforcement actions via the free public OpenFDA API to enrich drugs that OpenMed extracts.

When should I use Querying Openfda Labels?

Querying Openfda Labels fits situations like: the user wants the prescribing information for a drug; its boxed warning; approved indications; dosage forms and routes.

How do I install Querying Openfda Labels in Claude Code?

Run `npx skills add maziyarpanahi/openmed --skill querying-openfda-labels -a claude-code`. Or copy the skill folder (skills/querying-openfda-labels in maziyarpanahi/openmed) into .claude/skills/querying-openfda-labels in your project. Claude Code loads it when a task matches its description.

How do I install Querying Openfda Labels in Codex?

Run `npx skills add maziyarpanahi/openmed --skill querying-openfda-labels -a codex`. Or copy the skill folder (skills/querying-openfda-labels in maziyarpanahi/openmed) into .agents/skills/querying-openfda-labels in your project. Codex loads it when a task matches its description.

Can I use Querying Openfda Labels in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add maziyarpanahi/openmed --skill querying-openfda-labels -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/querying-openfda-labels, .gemini/skills/querying-openfda-labels, .github/skills/querying-openfda-labels and .opencode/skills/querying-openfda-labels in your project.

What does Querying Openfda Labels need to run?

SKILL.md names no scripts, command-line tools or credentials: Querying Openfda Labels is instructions for the agent only. Our summary lists: Python 3.

Does Querying Openfda Labels access the network?

SKILL.md names 4 domains. In commands or code: api.fda.gov; the agent is likely to contact it when it follows the instructions. As links in the text: open.fda.gov, fda.gov and dailymed.nlm.nih.gov. This is read from the text; nothing was executed.

Is Querying Openfda Labels safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Querying Openfda Labels use?

Querying Openfda Labels is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Querying Openfda Labels use?

About 1.9k tokens (SKILL.md is roughly 7.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Querying Openfda Labels?

Skills that share tags, products or a category with Querying Openfda Labels: openFDA Regulatory Data Queries (davila7/claude-code-templates, 33k stars), Drug Labels Search (wu-yc/LabClaw, 1.1k stars), GitHub Labels Query (github/gh-aw, 5.4k stars) and ClickHouse Query Performance Validation (comet-ml/opik, 22k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Querying Openfda Labels?

maziyarpanahi (a GitHub user) maintains it in maziyarpanahi/openmed, which has 5,500 GitHub stars. The repository holds 74 skills in this directory. The repository was last updated on October 9, 2026.

Source: maziyarpanahi/openmed on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.