openfda-database
This skill queries the openFDA API across 28 endpoints to retrieve data on drugs, devices, foods, tobacco, cosmetics, and other regulated products.
Identity proven by GitHub's verified organisation badge (flutter, google)
- Agents
- Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode
- License
- Apache-2.0 (permissive)
- Pin
- 6883275pinned Oct 9, 2026
- Context cost
- about 2,400 tokenswhen the skill loads
- GitHub stars
- 3,224on google-deepmind/science-skills
- Scripts
- 1 script
What it does
“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.”
Generated summary from the skill's own text
This skill queries the openFDA API across 28 endpoints to retrieve data on drugs, devices, foods, tobacco, cosmetics, and other regulated products. It provides search, count, and download operations for adverse events, recalls, labeling, NDC lookups, and regulatory information. The agent uses a Python wrapper script that enforces rate limiting and requires output to be written to files.
When to use it
- Looking up drug or device adverse events and safety reports.
- Searching FDA enforcement actions, recalls, or product labeling information.
- Retrieving regulatory data like NDC codes, 510(k) clearances, or product approvals.
- Analyzing patterns across large FDA datasets using count and download operations.
When not to
- User needs real-time API data without file output intermediaries.
- Query does not involve FDA-regulated products or safety data.
- User has exhausted their daily API limit and cannot obtain an API key.
Install
These commands install from the publisher's repository and need no account.
skills CLI
npx skills add google-deepmind/science-skills --skill openfda-databaseInstalls from the repository's default branch, which may have changed since the commit we checked.
GitHub CLI 2.90 or later
gh skill install google-deepmind/science-skills openfda-database@68832757cbbf941c620b71df5756cf6e5cc287b0Installs the commit we checked (6883275).
Copy by hand
Download the folder at 6883275 and put it in .claude/skills/openfda-database for Claude Code and in .agents/skills/openfda-database for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.
Claude Code plugin
/plugin install chrome-devtools-mcp@claude-plugins-officialThe publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.
Claude Code plugin
/plugin install alloydb-omni@claude-plugins-officialThe publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.
Claude Code plugin
/plugin install bigquery-data-analytics@claude-plugins-officialThe publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.
Copy for your agent
A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.
Prompt
Install the agent skill "openfda-database" by Google. Source, pinned to commit 68832757cbbf941c620b71df5756cf6e5cc287b0: https://github.com/google-deepmind/science-skills/tree/68832757cbbf941c620b71df5756cf6e5cc287b0/skills/openfda_database 1. Download that folder at exactly this commit. Do not use the default branch. 2. Copy every file unchanged, keeping the folder structure, into .claude/skills/openfda-database/ for Claude Code and .agents/skills/openfda-database/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist. 3. Do not edit the files, and do not run any script in the folder unless I ask you to. 4. When you are done, list the files you copied and where you put them. Listing and checks: https://www.agentnative.dev/skills/google/openfda-database
SKILL.md at the pin
---
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]
```
### 1. Search
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](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.
## 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
- **Query syntax and all endpoints**: See
[references/api_endpoints.md](references/api_endpoints.md) for field names,
search syntax, date ranges, and boolean operators.
## 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](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.
From google-deepmind/science-skills at 6883275, shown as plain text under its license: Apache-2.0 (permissive). The license text is in LICENSE.
View SKILL.md on GitHub at 6883275Files
- SKILL.md9.9 KB · f31e483d8713
- references/
- api_endpoints.md6.4 KB · 509d06d9ecf8
- citation.bib2.0 KB · 245e150e0d70
- recipes.md4.5 KB · 3a57df4d8188
- scripts/
- openfda_query.py14 KB · 6643114ac527
5 files, 37 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.
Skill folder on GitHub at 6883275More from Google
skill-creator
This skill guides agents through creating new skills that extend Gemini CLI with specialized knowledge, workflows, and tool integrations.
Contains scripts
Gemini CLI · about 5K tokens · pinned 6 days ago
chrome-devtools-cli
This skill enables agents to automate browser interactions and inspect web pages using Chrome DevTools via command-line interface.
Claude Code, Codex, Cursor +4 · about 2.9K tokens · pinned 6 days ago
cloud-run-basics
Deploys and manages Google Cloud Run services, jobs, and worker pools for running containerized applications or source code.
Claude Code, Codex, Cursor +4 · about 3.9K tokens · pinned 6 days ago
retail-virtual-tryon
Creates virtual try-on agents on Google Cloud using Gemini image models and Veo video generation, supporting static image try-ons and catwalk animations.
Contains scripts
Claude Code, Codex, Cursor +3 · about 3.3K tokens · pinned 6 days ago
site-md
This skill analyzes project briefs and generates a .stitch/SITE.md constitution file that documents the project's identity, visual direction, architecture…
Claude Code, Codex, Cursor +4 · about 730 tokens · pinned 6 days ago
stitch::code-to-design
This skill converts existing frontend code (React, Vue, Angular, etc.) into a Stitch Design by extracting HTML, analyzing design systems, and uploading both…
Claude Code, Codex, Cursor +4 · about 760 tokens · pinned 6 days ago
Related in Data and databases
data-table-manager
This skill manages n8n Data Tables through creation, import, querying, and mutation operations.
by n8nOfficial publisher
Claude Code, Codex, Cursor +3 · about 2.1K tokens · pinned 6 days ago
algolia-automation
This skill automates Algolia search and indexing operations through the Rube MCP interface.
by ComposioOfficial publisher
Claude Code, Codex, Cursor +3 · about 690 tokens · pinned 6 days ago
expo-sqlite
This skill enables SQLite database operations in Expo and React Native apps for structured data storage, offline queues, and persistent caches.
by ExpoOfficial publisher
Claude Code, Codex, Cursor +4 · about 2.6K tokens · pinned 6 days ago
prisma-8
This skill helps agents work with Prisma 8, a contract-first data layer for TypeScript projects.
by PrismaOfficial publisher
Contains scripts
Claude Code, Codex, Cursor +3 · about 3.5K tokens · pinned 6 days ago
analyzing-experiment-session-replays
This skill enables agents to analyze session recordings from experiment variants to identify behavioral differences between control and test groups.
by PostHogOfficial publisher
Claude Code, Codex, Cursor +4 · about 2.3K tokens · pinned 6 days ago
auditing-warehouse-view-health
Audits materialized views in a PostHog data warehouse to identify failed views and flag unused ones that waste compute resources.
by PostHogOfficial publisher
Claude Code, Codex, Cursor +4 · about 1.4K tokens · pinned 6 days ago
Open roles at Google
No open roles at Google on the Agent Native jobs board right now.
Browse the jobs board