openfda-database

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

Updated Jan 8, 2026
One-click install
npx skills add https://github.com/arslan9024/White-Caves --skill openfda-database-arslan9024
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: openfda-database
Source: https://github.com/arslan9024/White-Caves/tree/main/.agents/skills/openfda_database
Command: npx skills add https://github.com/arslan9024/White-Caves --skill openfda-database-arslan9024

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 different endpoints, which is error-prone when done manually. ## Core Features & Use Cases - Search, Count, and Download: Run structured queries against all 28 openFDA endpoints across drugs, devices, foods, tobacco, cosmetics, animal health, substances, and transparency data, with results saved to JSON files. - Rate Limit Management: The wrapper script enforces polite request pacing and supports an optional FDA_API_KEY to raise the daily limit from 1,000 to 120,000 requests. - Bulk Downloads with Safety Caps: Auto-paginate large result sets with a 25,000-record safety cap to prevent runaway API usage. - Use Case: A pharmacovigilance researcher needs the top adverse reactions reported for metformin. The skill runs a count query on the drug event endpoint using the MedDRA reaction field and returns the top terms as JSON. ## Quick Start Ask the assistant to search openFDA for adverse event reports involving a specific drug, for example: find the top 10 reported reactions for aspirin using the openFDA skill.

Frequently Asked Questions about openfda-database

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

FAQPage Schema
How do I search 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 --output.

How do I count the most common reactions reported for a drug?▼

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

Do I need an API key to use the openFDA API?▼

No key is required, but without one you are limited to 1,000 requests per day per IP. Registering a free FDA_API_KEY raises the limit to 120,000 requests per day, which is recommended for multi-query workflows.

What date format does the openFDA API accept?▼

openFDA requires dates in YYYYMMDD format, with ranges written as [20230101+TO+20231231]. ISO formats like 2023-01-01 will cause an API error.

Is there a limit on how many records I can download from openFDA?▼

The download subcommand paginates automatically, and --all_results fetches everything up to a safety cap of 25,000 records. For larger datasets, narrow the query with date ranges or additional search filters.