openfda-database

Query, count, and download FDA regulatory data from all 28 openFDA API endpoints.

1|Updated Aug 31, 2026
One-click install
npx skills add https://github.com/nguyenhungtran18/skill-and-tool-tracker --skill openfda-database-nguyenhungtran18
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: openfda-database
Source: https://github.com/nguyenhungtran18/skill-and-tool-tracker/tree/main/skills/openfda_database
Command: npx skills add https://github.com/nguyenhungtran18/skill-and-tool-tracker --skill openfda-database-nguyenhungtran18

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires polite-http, python-dotenv, and includes scripts (resource) and references (resource) components.

What problem does it solve? Accessing FDA safety and regulatory data requires learning the openFDA query syntax, managing rate limits, and handling pagination across 28 endpoints, which is error-prone when done manually. ## Core Features & Use Cases - Unified Query CLI: Search, count, and download data across all 8 openFDA categories (drug, device, food, tobacco, cosmetic, animal and veterinary, substance, transparency) through one script with automatic rate limiting. - Aggregation and Bulk Download: Count unique field values with top-N summaries and auto-paginate downloads with a 25,000-record safety cap. - Use Case: A researcher investigating metformin adverse events can count the top reported MedDRA reactions, then download all serious event reports for a date range into a JSON file for analysis. ## Quick Start Use the openfda-database skill to find the top 10 adverse reactions reported for aspirin and save the results to a file.

Frequently Asked Questions about openfda-database

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query the openFDA API for drug adverse events?▼

Run the openfda_query.py script with the search subcommand, specifying --category drug --endpoint event and a search query like patient.drug.medicinalproduct:aspirin. Results are written to the JSON file given by the required --output flag.

How to count top adverse reactions for a drug using openFDA?▼

Use the count subcommand with --count_field patient.reaction.reactionmeddrapt.exact and --summary N to get the top N most frequent reaction terms. The .exact suffix ensures whole-phrase counting instead of tokenized partial matches.

Does the openFDA API require an API key?▼

The openFDA API works without a key but limits you to 240 requests per minute and 1,000 requests per day per IP. Registering a free FDA_API_KEY raises the daily limit to 120,000 requests, which is recommended for multi-query workflows.

Why does my openFDA brand name search return no results?▼

Exact searches fail when the database stores variant names like "TYLENOL Extra Strength" instead of "TYLENOL". Retry without the .exact suffix to discover available brand name variants, then re-query with the full exact name.

What are the limits when downloading all openFDA results?▼

The download subcommand with --all_results auto-paginates through all matching records but enforces a safety cap of 25,000 records per download. Use date range filters like receivedate:[20250101+TO+20250131] to reduce volume for common drugs.