Agent skill

Openfda Database

by google-deepmind in google-deepmind/science-skills

Query, search, and download data from the openFDA API for drugs, devices, foods, tobacco, cosmetics, animal and veterinary products, substances, and transparency data.

Apache-2.0Auto-check: notesBackend & APIs

Install Openfda Database

skills CLI
$ npx skills add google-deepmind/science-skills --skill openfda-database -a claude-code

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

GitHub CLI
$ gh skill install google-deepmind/science-skills openfda-database --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/google-deepmind/science-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/openfda_database .claude/skills/openfda-database && 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
openfda-database
GitHub stars
3.2k
Used in
2 other repos
Token cost
~2.5k tokens
SKILL.md length
1,012 words
Files
5 (incl. scripts, references)
Skills in repo
40
Repo updated
First seen
Licence
Apache-2.0

At a glance

Query, search, and download data from the openFDA API for drugs, devices, foods, tobacco, cosmetics, animal and veterinary products, substances, and transparency data.

  • Works in 3 steps: Search → Count → Download
  • FDA adverse events
  • SKILL.md covers Prerequisites, Core Rules, Utility Script and Entity Resolution: Using…, plus 6 more sections
  • Runs Python scripts from its folder; calls uv; needs FDA_API_KEY

What it does

Openfda Database is an agent skill from google-deepmind/science-skills. Query, search, and download data from the openFDA API for drugs, devices, foods, tobacco, cosmetics, animal and veterinary products, substances, and transparency data. Use for FDA adverse events, recalls, labeling, approvals, shortages, 510(k) clearances, NDC lookups, and any FDA safety or regulatory data query across all 28 API endpoints.

Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including scripts and reference files (for example `references/api_endpoints.md`, `references/recipes.md` and `scripts/openfda_query.py`).

It sits in Backend & APIs, covering REST APIs. The repository describes itself as: GDM Science Skills to speed up agentic scientific workflows with better grounding and higher token efficiency. Integrate insights from AlphaGenome, AFDB, UniProt and 30+ other… The licence is Apache-2.0.

When your agent uses it

  • FDA adverse events
  • 510(k) clearances
  • Regulatory data query across all 28 API endpoints

Example prompts

  • “/openfda-database”

Requirements

  • Python 3
  • A credential in FDA_API_KEY

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Search
  2. Count
  3. Download

What it can do on your machine

Read from SKILL.md and the folder at commit 6883275. 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

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • uv

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

  • Network

    Links to these hosts (documentation or services it may open):

    • open.fda.gov

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

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • FDA_API_KEY

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

Context cost

Openfda Database loads about 2.5k tokens when it runs, and up to ~5.7k if it reads all its reference files. Until then it costs about 90 tokens; SKILL.md has 1,012 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~90
When it runs · the whole SKILL.md, loaded when a task matches
~2.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.7k

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: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:22
    3.  **`.env` file**: Make sure the `.env` file exists in your home directory.
  • NoteMentions a .env fileSKILL.md:47
    elp the user add `FDA_API_KEY` to their `.env` file if this skill looks

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); the scripts in this folder are not scanned.

SKILL.md

The full file from google-deepmind/science-skills at commit 6883275, republished under its Apache-2.0 licence (© google-deepmind). 1,012 words, ~2,479 tokens.

Download SKILL.mdSave it as .claude/skills/openfda-database/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
openfda-database
description
Query, search, and download data from the openFDA API for drugs, devices, foods, tobacco, cosmetics, animal and veterinary products, substances, and transparency data. Use for FDA adverse events, recalls, labeling, approvals, shortages, 510(k) clearances, NDC lookups, and any FDA safety or regulatory data query across all 28 API endpoints.

openFDA Search and Query

Prerequisites

  1. uv: Read the uv skill and follow its Setup instructions to ensure uv is installed and on PATH.
  2. User Notification: If .licenses/openfda_database_LICENSE.txt does not already exist in the workspace root directory then (1) prominently notify the user to check the terms at https://open.fda.gov/apis/ and https://open.fda.gov/license, then (2) create the file recording the notification text and timestamp.
  3. .env file: Make sure the .env file exists in your home directory. Create one if it does not exist.
  4. FDA_API_KEY (optional but recommended): Raises the daily request limit from 1,000 to 120,000. The skill works without it, but an agent can easily exhaust the keyless limit in a single session. You can register for a free key at https://open.fda.gov/apis/authentication/. You MUST use the safe credentials protocol in the credentials skill to check for and request this key if this skill looks relevant to the user's request.

Core Rules

  • Use the Wrapper: ALWAYS execute the provided helper scripts to query the database rather than accessing the database directly. The scripts automatically enforce the required rate limit gracefully.

  • Rate Limiting: Respect openFDA rate limits. Without API key: 240 requests/min, 1,000 requests/day per IP. With API key: 240 requests/min, 120,000 requests/day per key. Always set an API key before running multi-query workflows.

Warning: An automated agent can easily exhaust the 1,000-request daily limit in a single research session. Always set an API key before running multi-query workflows.

You MUST use the safe credentials protocol in the credentials skill to help the user add FDA_API_KEY to their .env file if this skill looks relevant to the user's request. The script will emit a warning to stderr if no API key is detected.

  • Always Use --output: All subcommands require --output <file> to write results to a file. This prevents large output becoming overwhelming. Use jq or code to read the output file.

  • Notification: If this skill is used, ensure this is mentioned in the output.

Utility Script

Single script for all operations:

bash
uv run scripts/openfda_query.py {search,count,download} --output <file> [options]

Search any of the 28 endpoints and save JSON results to a file.

bash
uv run scripts/openfda_query.py search \
  --category drug --endpoint event \
  --search "patient.drug.medicinalproduct:aspirin" \
  --limit 5 --output /tmp/fda_results.json

Stdout prints a compact summary:

json
{"status": "success", "output": "/tmp/fda_results.json", "results_in_file": 5, "total_matching": 601477}

Options:

  • --output: Output file for full JSON results (required).
  • --category: API category — drug, device, food, tobacco, other, animalandveterinary, cosmetic, transparency.
  • --endpoint: Endpoint within the category (e.g., event, label, 510k). See references/api_endpoints.md for full list.
  • --search: Query string (e.g., patient.drug.medicinalproduct:aspirin+AND+serious:1).
  • --sort: Sort field and order (e.g., receivedate:desc).
  • --limit: Max results (default 10, max 1000).
  • --skip: Pagination offset (default 0).
  • --api_key: API key (also reads FDA_API_KEY env var).
2. Count

Count unique values of a field within matching results.

bash
uv run scripts/openfda_query.py count \
  --category drug --endpoint event \
  --search "patient.drug.medicinalproduct:aspirin" \
  --count_field "patient.reaction.reactionmeddrapt.exact" \
  --summary 10 --output /tmp/aspirin_reactions.json

Stdout prints a summary with the top 5 terms. Full data is in the output file.

Additional options:

  • --count_field: Field to count (append .exact for whole-phrase counting).
  • --summary N: Return only the top N most frequent terms. Use this to avoid flooding the context with hundreds of infrequent terms.
3. Download

Download multiple pages of results to a file.

bash
uv run scripts/openfda_query.py download \
  --category drug --endpoint event \
  --search "patient.drug.medicinalproduct:aspirin" \
  --limit 100 --max_pages 5 \
  --output /tmp/aspirin_events.json

Additional options:

  • --max_pages: Maximum pages to fetch (default 10).

  • --all_results: Automatically paginate to fetch all matching results. Safety cap of 25,000 records maximum per download to prevent runaway downloads and prevent excessive API usage.

    Tip: Common drugs can have excessive reports. Use a date range (e.g., receivedate:[20250101+TO+20250131]) to limit the volume of download.

Entity Resolution: Using .exact for Precision

When searching for specific product names, drug names, or categorical terms, always use the .exact suffix on the field to get exact-match results. Without it, the API tokenizes multi-word values and returns noisy partial matches.

bash
# Precise: matches only "ADVIL"
uv run scripts/openfda_query.py search --category drug --endpoint label \
  --search 'openfda.brand_name.exact:"ADVIL"' \
  --limit 5 --output /tmp/advil_label.json

Note: Many brand names in the FDA database include variant suffixes (e.g., "TYLENOL Extra Strength" rather than just "TYLENOL"). If an .exact search returns 0 results, try without .exact to see the available brand name variants, then re-query with the full exact name.

The .exact suffix is also required when using --count_field to aggregate whole phrases instead of individual words.

Show full SKILL.md (370 more words)Show less

NDC Lookups: Hyphens & Discontinued Drugs

  1. Always Quote Hyphenated NDCs: In openFDA search syntax, an unquoted hyphen (-) acts as the boolean NOT operator (e.g., 51285-092 searches for 51285 AND NOT 092). Always enclose hyphenated NDC strings in escaped double quotes:

    bash
    uv run scripts/openfda_query.py search --category drug --endpoint ndc \
      --search 'product_ndc:"51285-092"' \
      --limit 5 --output /tmp/ndc.json
  2. Discontinued Drugs Fallback (drug/label): The drug/ndc endpoint only contains currently active/marketed products. If a valid NDC returns 0 results in drug/ndc, query the drug/label endpoint with exact phrase quotes (--search '"51285-092"'). Note that for discontinued drugs, the openfda metadata block may be empty ({}), so read brand name, active ingredients, and labeler from the label text fields (package_label_principal_display_panel, description, or spl_product_data_elements).

MedDRA Term Resolution

openFDA adverse event data uses MedDRA (Medical Dictionary for Regulatory Activities) terms for reactions. The API reports Preferred Terms (PTs) but does not provide the MedDRA hierarchy (System Organ Class, High Level Terms, etc.).

Note: MedDRA is a proprietary ontology and is not indexed in the EMBL-EBI OLS. To approximate MedDRA hierarchy lookups, use the Human Phenotype Ontology (HP) or NCI Thesaurus (NCIT) as proxy ontologies — they cross-reference MedDRA IDs and provide parent/ancestor relationships.

bash
# Step 1: Get top reactions from openFDA
uv run scripts/openfda_query.py count \
  --category drug --endpoint event \
  --search "patient.drug.medicinalproduct:metformin" \
  --count_field "patient.reaction.reactionmeddrapt.exact" \
  --summary 5 --output /tmp/metformin_reactions.json

# Step 2: Look up the top reaction term using a biomedical ontology service
# skill (e.g. embl-ebi-ols skill).
# MedDRA is not available in OLS; use the Human Phenotype Ontology (HP) or
# NCI Thesaurus (NCIT) as a proxy to find the hierarchical classification of
# the reaction term.

Available Endpoints (28 total)

Category to endpoint mapping:

  • drug: event, label, ndc, enforcement, drugsfda, shortages
  • device: 510k, classification, enforcement, event, pma, recall, registrationlisting, udi, covid19serology
  • food: enforcement, event
  • tobacco: problem, researchpreventionads, researchdigitalads, researchsmokefree
  • other: historicaldocument, nsde, substance, unii
  • animalandveterinary: event
  • cosmetic: event
  • transparency: crl

Reference

Recipes

Common query patterns for drugs, devices, foods, tobacco, cosmetics, animal and veterinary products, substances, transparency data, adverse events, recalls, labeling, approvals, shortages, 510(k) clearances, NDC lookups, any FDA safety or regulatory data query, and more. See references/recipes.md for the full recipes.

Workflow

  1. Search for records using search with --output. Read the output file.
  2. Use count with --summary 10 --output to summarize field distributions.
  3. Use download (with --all_results for exhaustive pulls) to fetch larger datasets.
  4. Read and analyze the output file using standard tools.
  5. For MedDRA term hierarchy questions, use a biomedical ontology service skill (e.g. EMBL-EBI OLS skill with the HP or NCIT ontology) to look up the term.

© google-deepmind, 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

SKILL.md and 4 other files (scripts, references) in skills/openfda_database of google-deepmind/science-skills.

  • SKILL.md
  • references/api_endpoints.md
  • references/citation.bib
  • references/recipes.md
  • scripts/openfda_query.py

Open the folder on GitHubat commit 6883275

Used in 2 other repositories

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in google-deepmind/science-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Openfda Database 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.

Openfda Database compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Openfda Database this skillgoogle-deepmind/science-skills3.2k2 repos~2.5kAutomated safety check: NotesApache-2.0
API DesignerJeffallan/claude-skills12k2 repos~2kAutomated safety check: PassMIT
Paperclippaperclipai/paperclip99k—~9.6kAutomated safety check: PassMIT
Nodejs Backend Patternsever-works/ever-works15818 repos~4kAutomated safety check: PassAGPL-3.0
OpenAPI to MCP Servermcp-use/mcp-use11k—~5.2kAutomated safety check: PassApache-2.0
Use Yaakmountain-loop/yaak19k—~1.9kAutomated safety check: PassMIT

Similar skills

  • API Designer

    Jeffallan/claude-skills

    Designs REST and GraphQL APIs from resource modeling to an OpenAPI 3.1 contract, with versioning, pagination and RFC 7807 error handling.

    12k GitHub starsUsed in 2 repos~2k tokens
    Backend & APIsAuto-check passed
  • Paperclip

    paperclipai/paperclip

    Interact with the Paperclip control plane API for task coordination and governance.

    99k GitHub stars~9.6k tokensUpdated today
    Backend & APIsAuto-check passed
  • Nodejs Backend Patterns

    ever-works/ever-works

    Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication, database integration, and API design best practices.

    158 GitHub starsUsed in 18 repos~4k tokens
    Backend & APIsAuto-check passed
  • OpenAPI to MCP Server

    mcp-use/mcp-use

    Turns an OpenAPI or Swagger spec into an MCP server with the mcp-use TypeScript SDK, mapping each operation to a tool, wiring auth, testing and deploying.

    11k GitHub stars~5.2k tokensUpdated today
    Backend & APIsAuto-check passed
  • Use Yaak

    mountain-loop/yaak

    A skill your agent uses when the user mentions Yaak, a Yaak workspace, or the yaak command, or asks to call, hit, or smoke test HTTP/REST endpoints, save or organize API requests for reuse or manual…

    19k GitHub stars~1.9k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Covers the RuView `wifi-densepose` command line binary, its Axum REST API and the WebAssembly builds for browsers and ESP32, for embedding or scripting RuView.

    97k GitHub stars~1.2k tokensUpdated today
    Backend & APIsAuto-check: notes

More from google-deepmind/science-skills

All 40 skills in this repo
  • Clinical Trials Database

    google-deepmind/science-skills

    Query ClinicalTrials.gov via APIv2. An agent skill from google-deepmind/science-skills.

    3.2k GitHub starsUsed in 3 repos~3.2k tokens
    Auto-check passed
  • Dbsnp Database

    google-deepmind/science-skills

    A skill your agent uses when you want to look up, map, and search for short genetic variants (SNPs, indels) in NCBI's dbSNP database.

    3.2k GitHub starsUsed in 3 repos~3.4k tokens
    Auto-check: notes
  • Gtex Database

    google-deepmind/science-skills

    A skill your agent uses when you want to retrieve quantitative RNA expression data and variant eQTL information from the GTEx (Genotype-Tissue Expression) Project across 54 non-diseased tissue sites.

    3.2k GitHub starsUsed in 3 repos~1.5k tokens
    Auto-check passed
  • Human Protein Atlas Database

    google-deepmind/science-skills

    A skill your agent uses when you want to retrieve semi-quantitative protein expression and spatial localisation data from the Human Protein Atlas (HPA).

    3.2k GitHub starsUsed in 3 repos~1.6k tokens
    Auto-check passed
  • Alphafold Database Fetch And Analyze

    google-deepmind/science-skills

    Retrieve and analyze AlphaFold predicted structures for a protein.

    3.2k GitHub starsUsed in 2 repos~1.2k tokens
    Auto-check passed
  • Alphagenome Single Variant Analysis

    google-deepmind/science-skills

    Analyzes genetic variant effects on gene expression (RNA-seq), chromatin accessibility (DNASE), histone marks (ChIP), and transcription factors using the AlphaGenome API.

    3.2k GitHub starsUsed in 2 repos~3k tokens
    Auto-check: notes

Categories

Questions about Openfda Database

What does Openfda Database do?

Query, search, and download data from the openFDA API for drugs, devices, foods, tobacco, cosmetics, animal and veterinary products, substances, and transparency data. Openfda Database is an agent skill from google-deepmind/science-skills. Query, search, and download data from the openFDA API for drugs, devices, foods, tobacco, cosmetics, animal and veterinary products, substances, and transparency data.

When should I use Openfda Database?

Openfda Database fits situations like: FDA adverse events; 510(k) clearances; regulatory data query across all 28 API endpoints.

How do I install Openfda Database in Claude Code?

Run `npx skills add google-deepmind/science-skills --skill openfda-database -a claude-code`. Or copy the skill folder (skills/openfda_database in google-deepmind/science-skills) into .claude/skills/openfda-database in your project. Claude Code loads it when a task matches its description.

How do I install Openfda Database in Codex?

Run `npx skills add google-deepmind/science-skills --skill openfda-database -a codex`. Or copy the skill folder (skills/openfda_database in google-deepmind/science-skills) into .agents/skills/openfda-database in your project. Codex loads it when a task matches its description.

Can I use Openfda Database 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 google-deepmind/science-skills --skill openfda-database -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/openfda-database, .gemini/skills/openfda-database, .github/skills/openfda-database and .opencode/skills/openfda-database in your project.

What does Openfda Database need to run?

Going by SKILL.md and its folder, Openfda Database needs Python for the scripts in its folder, the command-line tools its instructions call (uv) and credentials named FDA_API_KEY. Our summary lists: Python 3; A credential in FDA_API_KEY.

Does Openfda Database access the network?

SKILL.md names 1 domain. As links in the text: open.fda.gov. This is read from the text; nothing was executed.

Is Openfda Database safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Openfda Database use?

Openfda Database is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Openfda Database use?

About 2.5k tokens (SKILL.md is roughly 9.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.2k tokens, read only when the agent opens those files.

What are the alternatives to Openfda Database?

Skills that share tags, products or a category with Openfda Database: API Designer (Jeffallan/claude-skills, 12k stars), Paperclip (paperclipai/paperclip, 99k stars), Nodejs Backend Patterns (ever-works/ever-works, 158 stars) and OpenAPI to MCP Server (mcp-use/mcp-use, 11k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Openfda Database?

google-deepmind (a GitHub organization) maintains it in google-deepmind/science-skills, which has 3,220 GitHub stars. The repository holds 40 skills in this directory. The repository was last updated on September 15, 2026.

Source: google-deepmind/science-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.