Queries the openFDA API for drugs, medical devices, adverse events, recalls, regulatory submissions (510k, PMA), and substance identifiers (UNII). Useful for pharmacovigilance, safety research, and regulatory data analysis.
Access comprehensive FDA regulatory data through openFDA, the FDA's initiative to provide open APIs for public datasets. Query information about drugs, medical devices, foods, animal/veterinary products, and substances using Python with standardized interfaces.
Key capabilities:
This skill should be used when working with:
| Scenario | Use Instead |
|---|---|
| Clinical trial registry records (NCT IDs, recruitment, eligibility) | alterlab-clinicaltrials |
| Curated drug–target / DDI knowledge from DrugBank | alterlab-drugbank |
| Compound bioactivity and mechanism data | alterlab-chembl |
| Pharmacogenomic dosing guidance (CPIC/DPWG) | alterlab-clinpgx |
Hand-off rule. When the request matches a row above, open your answer by naming that skill by its exact id (for example alterlab-clinicaltrials) and saying in one line why it fits better, then stop applying this skill's procedure. Name it even when you also need to ask for missing input. If only part of the request is out of scope, name the skill for that part and do only the in-scope part. A brief general pointer is fine; the named skill does the work.
# Run from the skill's scripts/ dir, or add it to sys.path first.
from fda_query import FDAQuery
# Keyless by default (1,000 requests/day per IP). FDAQuery() also picks up an
# optional FDA_API_KEY from the environment, which raises the cap to 120,000/day.
fda = FDAQuery()
# Query drug adverse events
events = fda.query_drug_events("aspirin", limit=100)
# Get drug labeling
label = fda.query_drug_label("Lipitor", brand=True)
# Search device recalls
recalls = fda.query("device", "enforcement",
search="classification:Class+I",
limit=50)
Every endpoint answers without a key; a free key only raises the daily quota:
Register at: https://open.fda.gov/apis/authentication/
Set as environment variable:
export FDA_API_KEY="your_key_here"
# Run comprehensive examples
python scripts/fda_examples.py
# This demonstrates:
# - Drug safety profiles
# - Device surveillance
# - Food recall monitoring
# - Substance lookup
# - Comparative drug analysis
# - Veterinary drug analysis
Access 6 drug-related endpoints covering the full drug lifecycle from approval to post-market surveillance.
Endpoints:
Common use cases:
# Safety signal detection
fda.count_by_field("drug", "event",
search="patient.drug.medicinalproduct:metformin",
field="patient.reaction.reactionmeddrapt")
# Get prescribing information
label = fda.query_drug_label("Keytruda", brand=True)
# Check for recalls
recalls = fda.query_drug_recalls(drug_name="metformin")
# Monitor shortages (endpoint is drug/shortages; status values:
# "Current", "To Be Discontinued", "Resolved")
shortages = fda.query("drug", "shortages",
search="status:Current")
Reference: See references/drugs.md for detailed documentation
Access 9 device-related endpoints covering medical device safety, approvals, and registrations.
Endpoints:
Common use cases:
# Monitor device safety
events = fda.query_device_events("pacemaker", limit=100)
# Look up device classification
classification = fda.query_device_classification("DQY")
# Find 510(k) clearances
clearances = fda.query_device_510k(applicant="Medtronic")
# Search by UDI
device_info = fda.query("device", "udi",
search="identifiers.id:00884838003019")
Reference: See references/devices.md for detailed documentation
Access 2 food-related endpoints for safety monitoring and recalls.
Endpoints:
food/event)Cosmetic adverse events now have their own endpoint, cosmetic/event.
Common use cases:
# Monitor allergen recalls
recalls = fda.query_food_recalls(reason="undeclared peanut")
# Track dietary supplement events
events = fda.query_food_events(
industry="Dietary Supplements")
# Find contamination recalls
listeria = fda.query_food_recalls(
reason="listeria",
classification="I")
Reference: See references/foods.md for detailed documentation
Access veterinary drug adverse event data with species-specific information.
Endpoint:
Common use cases:
# Species-specific events
dog_events = fda.query_animal_events(
species="Dog",
drug_name="flea collar")
# Breed predisposition analysis
breed_query = fda.query("animalandveterinary", "event",
search="reaction.veddra_term_name:*seizure*+AND+"
"animal.breed.breed_component:*Labrador*")
Reference: See references/animal_veterinary.md for detailed documentation
Access molecular-level substance data with UNII codes, chemical structures, and relationships.
Endpoints:
other/substance) - UNII, CAS, chemical structures, relationshipsother/unii) - UNII code ↔ substance name lookupother/nsde) - Comprehensive NDC SPL Data Elements fileother/historicaldocument) - archival FDA documentsAlso live (verified 2026-09): transparency/crl (published complete response letters)
and tobacco/problem (tobacco product problem reports).
Common use cases:
# UNII to CAS mapping
substance = fda.query_substance_by_unii("R16CO5Y76E")
# Search by name
results = fda.query_substance_by_name("acetaminophen")
# Get chemical structure
structure = fda.query("other", "substance",
search="names.name:ibuprofen+AND+substanceClass:chemical")
Reference: See references/other.md for detailed documentation
Reusable FDAQuery patterns (safety profiles, temporal trends, comparative and
cross-database lookups), the response structure, error handling, pagination, and
best practices live in references/query_patterns.md.
Essentials to keep in mind:
patient.drug.medicinalproduct:aspirin), not
bare wildcards.FDAQuery handles rate limiting (240/min; 1,000/day keyless, 120,000/day with a key)
and caching automatically; a second HTTP 429 in a row returns an error instead of
waiting forever, since a spent keyless daily quota resets only the next day.skip is capped at 25,000 (query_all stops there); page deeper via the
search_after cursor in the Link response header, narrower date-range searches,
or the bulk downloads. meta.last_updated tells you how fresh each endpoint is —
FAERS (drug/event) lags by a quarter.exact=True on count_by_field to count exact phrases (adds .exact).{meta: {results: {total, ...}}, results: [...]} shape;
always check for error and empty results.For detailed information about:
references/api_basics.mdreferences/query_patterns.mdreferences/drugs.mdreferences/devices.mdreferences/foods.mdreferences/animal_veterinary.mdreferences/other.mdscripts/fda_query.pyMain query module with FDAQuery class providing:
scripts/fda_examples.pyComprehensive examples demonstrating:
Run examples:
python scripts/fda_examples.py
Issue: Rate limit exceeded
count= aggregations; if the keyless 1,000/day quota is spent, wait for the reset or set the optional FDA_API_KEYIssue: No results found
Issue: Invalid query syntax
references/api_basics.mdIssue: Missing fields in results
evals/evals.json (opens in a new tab)references/animal_veterinary.md (opens in a new tab)references/api_basics.md (opens in a new tab)references/devices.md (opens in a new tab)references/drugs.md (opens in a new tab)references/foods.md (opens in a new tab)references/other.md (opens in a new tab)references/query_patterns.md (opens in a new tab)scripts/fda_examples.py (opens in a new tab)scripts/fda_query.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
fda, openfda, pharmacovigilance, regulatory-data, drug-safety, medical-devices
Not loaded · from alterlab-writing-tools
Claude Code won't load this skill
It ships in alterlab-writing-tools at skills/, but Claude Code only loads skills/<name>/SKILL.md and folders listed under skills in plugin.json. Installing the plugin doesn't add it.
Generated from the plugin's indexed repository (alterlab-ieu/alterlab-academic-skills) — no native marketplace selected
npx claudepluginhub p/alterlab-ieu-alterlab-writing-tools241 skills in this plugin
/alterlab-abm-mesaBuilds agent-based models of social systems with Mesa 3 — the current AgentSet API (model.agents.shuffle_do('step'), auto-assigned unique_id, mandatory super().__init__(rng=...)), cell spaces (mesa.discrete_space OrthogonalMooreGrid / classic mesa.space grids), the DataCollector, batch_run parameter sweeps, and SolaraViz — for emergence, segregation, diffusion, opinion dynamics, and cooperation models. It uses the Mesa 3.x API (the old mesa.time schedulers like RandomActivation are removed) and treats the model as a generative theory to be validated, not just run. Use when the request mentions an agent-based model, Mesa, simulating interacting agents, or emergent macro behavior from micro rules. For discrete-event (queueing/process) simulation prefer alterlab-simpy; for reinforcement learning prefer alterlab-stable-baselines3. Part of the AlterLab Academic Skills suite./alterlab-academic-careerPrepares academic career documents and professional-development materials for faculty and researchers. Use when drafting academic CVs, research statements, teaching philosophies, diversity statements, faculty-position cover letters, tenure dossiers, promotion narratives, academic portfolios, or mentorship statements, and when planning conference-networking strategy, building academic web presence, setting up ORCID profiles, or understanding impact metrics. Part of the AlterLab Academic Skills suite.2 plugins in one repository ship this exact skill · first indexed Nov 9, 2026
Other plugins' skills for the same job