openfda-database
Skill0 starsChanged 25 days agoApache-2.0View on GitHub
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.
- Reads credentials
3 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- 1stANUNNAKI/majlisedited, first seen Nov 8, 2026
- google-deepmind/science-skillsword for word, first seen Jul 1, 2026
- uppifyagency/boilerplate-saas-2026edited, first seen Jun 2, 2026
Other versions3 projects use a version of this.
Word for word · 1
- google-deepmind/science-skills★ 3.4k100% same
Edited · 2
- 1stANUNNAKI/majlis★ 286% same
- uppifyagency/boilerplate-saas-2026★ 187% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository40 other files it gives its agents.
- vector-geneSkill
- alphafold-database-fetch-and-analyzeSkill
- alphagenome-atlas-website-linksSkill
- alphagenome-single-variant-analysisSkill
- alphagenome-variant-impact-scoreSkill
- chembl-databaseSkill
- clinical-trials-databaseSkill
- clinvar-databaseSkill
- credentialsSkill
- dbsnp-databaseSkill
- embl-ebi-olsSkill
- encode-ccres-databaseSkill
- ensembl-databaseSkill
- foldseek-structural-searchSkill
- gnomad-databaseSkill
- gtex-databaseSkill
- human-protein-atlas-databaseSkill
- interpro-databaseSkill
- jaspar-databaseSkill
- literature-search-arxivSkill
- literature-search-biorxivSkill
- literature-search-europepmcSkill
- literature-search-openalexSkill
- ncbi-sequence-fetchSkill
- opentargets-databaseSkill
- pdb-databaseSkill
- predictingthepastSkill
- protein-sequence-msaSkill
- protein-sequence-similarity-searchSkill
- pubchem-databaseSkill
- pubmed-databaseSkill
- pymolSkill
- quickgo-databaseSkill
- reactome-databaseSkill
- string-databaseSkill
- ucsc-conservation-and-tfbsSkill
- unibind-databaseSkill
- uniprot-databaseSkill
- uvSkill
- workflow-skill-creatorSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 6 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
uv: Read the uv skill and follow its Setup instructions to ensure uv is installed and on PATH. - Very specific: line 17
User Notification: If .licenses/openfda_database_LICENSE.txt does not already exist in the workspace root directory then (1) prominently …
- Very specific: line 22
.envfile: Make sure the .env file exists in your home directory. - Distinctive: line 23
Create one if it does not exist.
- Distinctive: line 33
Use the Wrapper: ALWAYS execute the provided helper scripts to query the database rather than accessing the database directly.
- Very specific: line 51
Always Use
--output: All subcommands require --output <file> to write results to a file. - Distinctive: line 53
Use jq or code to read the output file.
- Distinctive: line 55
Notification: If this skill is used, ensure this is mentioned in the output.
- Distinctive: line 68
Search any of the 28 endpoints and save JSON results to a file.
- Very specific: line 142
When searching for specific product names, drug names, or categorical terms, always use the .exact suffix on the field to get exact-match …
- Very specific: line 240
Search for records using search with --output.
- Very specific: line 241
Use count with --summary 10 --output to summarize field distributions.
- Very specific: line 242
Use download (with --all_results for exhaustive pulls) to fetch larger datasets.
- Distinctive: line 244
Read and analyze the output file using standard tools.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
openFDA Search and Query
Prerequisites
uv: Read theuvskill and follow its Setup instructions to ensureuvis installed and on PATH.- 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.
.envfile: Make sure the.envfile exists in your home directory. Create one if it does not exist.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 thecredentialsskill 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
credentialsskill to help the user addFDA_API_KEYto their.envfile 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:
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.
uv run scripts/openfda_query.py search \
--category drug --endpoint event \
--search "patient.drug.medicinalproduct:aspirin" \
--limit 5 --output /tmp/fda_results.jsonStdout prints a compact summary:
{"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 readsFDA_API_KEYenv var).
2. Count
Count unique values of a field within matching results.
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.jsonStdout prints a summary with the top 5 terms. Full data is in the output file.
Additional options:
--count_field: Field to count (append.exactfor 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.
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.jsonAdditional 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.
# 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.jsonNote: Many brand names in the FDA database include variant suffixes (e.g., "TYLENOL Extra Strength" rather than just "TYLENOL"). If an
.exactsearch returns 0 results, try without.exactto 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
Always Quote Hyphenated NDCs: In openFDA search syntax, an unquoted hyphen (
-) acts as the boolean NOT operator (e.g.,51285-092searches for51285 AND NOT 092). Always enclose hyphenated NDC strings in escaped double quotes:uv run scripts/openfda_query.py search --category drug --endpoint ndc \ --search 'product_ndc:"51285-092"' \ --limit 5 --output /tmp/ndc.json- Discontinued Drugs Fallback (
drug/label): Thedrug/ndcendpoint only contains currently active/marketed products. If a valid NDC returns 0 results indrug/ndc, query thedrug/labelendpoint with exact phrase quotes (--search '"51285-092"'). Note that for discontinued drugs, theopenfdametadata block may be empty ({}), so read brand name, active ingredients, and labeler from the label text fields (package_label_principal_display_panel,description, orspl_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.
# 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, shortagesdevice: 510k, classification, enforcement, event, pma, recall, registrationlisting, udi, covid19serologyfood: enforcement, eventtobacco: problem, researchpreventionads, researchdigitalads, researchsmokefreeother: historicaldocument, nsde, substance, uniianimalandveterinary: eventcosmetic: eventtransparency: crl
Reference
- Query syntax and all endpoints: See 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 for the full recipes.
Workflow
- Search for records using
searchwith--output. Read the output file. - Use
countwith--summary 10 --outputto summarize field distributions. - Use
download(with--all_resultsfor exhaustive pulls) to fetch larger datasets. - Read and analyze the output file using standard tools.
- 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.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

