Master Fda Database
Boost productivity using this query, openfda, drugs, devices. Includes structured workflows, validation checks, and reusable patterns for scientific.
Master FDA Database
A scientific computing skill for accessing FDA regulatory data through openFDA — the FDA's public API providing access to adverse event reports, drug labels, recalls, and regulatory submissions. Master FDA Database helps you search drug safety data, analyze adverse event patterns, and retrieve regulatory information programmatically.
When to Use This Skill
Choose Master FDA Database when:
- Searching FDA Adverse Event Reporting System (FAERS) data
- Retrieving drug labeling information (SPL/DailyMed data)
- Looking up device recalls, enforcement actions, or 510(k) clearances
- Analyzing drug safety signals from post-market surveillance
Consider alternatives when:
- You need clinical trial data (use ClinicalTrials.gov)
- You need drug mechanism/target data (use DrugBank)
- You need European regulatory data (use EMA's database)
- You need real-world evidence beyond adverse events (use claims databases)
Quick Start
claude "Search for adverse events reported with metformin in the last year"
import requests from datetime import datetime, timedelta # openFDA API — Drug Adverse Events base_url = "https://api.fda.gov/drug/event.json" end_date = datetime.now().strftime("%Y%m%d") start_date = (datetime.now() - timedelta(days=365)).strftime("%Y%m%d") params = { "search": f'patient.drug.medicinalproduct:"metformin" AND ' f'receivedate:[{start_date} TO {end_date}]', "count": "patient.reaction.reactionmeddrapt.exact", "limit": 10 } response = requests.get(base_url, params=params) data = response.json() print("Top adverse reactions reported with metformin:") for result in data["results"]: print(f" {result['term']}: {result['count']} reports")
Core Concepts
openFDA Endpoints
| Endpoint | Data Source | Example Query |
|---|---|---|
/drug/event | FAERS adverse events | Drug safety signals |
/drug/label | Structured drug labels | Indications, warnings |
/drug/enforcement | Drug recalls | Recall classifications |
/device/event | Device adverse events | Device complaints |
/device/510k | 510(k) clearances | Device approvals |
/food/event | Food adverse events | Allergen reports |
/food/enforcement | Food recalls | Contamination recalls |
Query Syntax
# openFDA search syntax # Exact match search = 'patient.drug.medicinalproduct.exact:"ASPIRIN"' # Range query (dates) search = 'receivedate:[20230101 TO 20231231]' # Boolean combinations search = ('patient.drug.medicinalproduct:"metformin" AND ' 'patient.reaction.reactionmeddrapt:"lactic acidosis"') # Count aggregation params = { "search": 'patient.drug.medicinalproduct:"ibuprofen"', "count": "patient.reaction.reactionmeddrapt.exact", "limit": 20 } # Signal detection — disproportionality params = { "search": 'patient.drug.medicinalproduct:"drug_name"', "count": "serious", "limit": 2 }
Drug Label Search
# Search drug labeling label_url = "https://api.fda.gov/drug/label.json" response = requests.get(label_url, params={ "search": 'openfda.brand_name:"lipitor"', "limit": 1 }) label = response.json()["results"][0] print(f"Drug: {label['openfda']['brand_name'][0]}") print(f"Generic: {label['openfda']['generic_name'][0]}") print(f"Indications: {label.get('indications_and_usage', ['N/A'])[0][:200]}...") print(f"Warnings: {label.get('warnings', ['N/A'])[0][:200]}...")
Configuration
| Parameter | Description | Default |
|---|---|---|
api_key | openFDA API key (optional, higher limits) | None |
endpoint | Drug, device, or food events | drug/event |
limit | Results per request (max 1000) | 100 |
skip | Pagination offset | 0 |
count | Field to aggregate by | None |
Best Practices
-
Use API keys for higher rate limits. Without a key, openFDA limits to 40 requests per minute. Register for a free API key at open.fda.gov to increase the limit to 240 requests per minute.
-
Use MedDRA preferred terms for reactions. Adverse reactions in FAERS use MedDRA terminology. Search using the exact MedDRA preferred term (e.g., "Hepatotoxicity" not "liver damage") for accurate results.
-
Account for reporting bias in adverse events. FAERS data reflects reported events, not actual incidence. Highly publicized drugs receive more reports. Use disproportionality analysis (PRR, ROR) rather than raw counts for signal detection.
-
Combine adverse event data with denominator information. Raw FAERS counts don't indicate rates. To estimate adverse event rates, combine with prescription data (from IQVIA or similar sources) to calculate events per exposure.
-
Use the
countparameter for aggregations. Instead of downloading all events and counting locally, use openFDA'scountparameter to aggregate on the server side. This is faster and stays within API limits.
Common Issues
Search returns no results for a known drug. Drug names in FAERS are reported as free text and may use brand names, generic names, or misspellings. Try multiple name variants: brand name, generic name, and common abbreviations. Use .exact for precise matching.
API returns 429 rate limit errors. Add delays between requests (1 second without API key, 0.25 seconds with key). For bulk analysis, download the quarterly FAERS data files from the FDA website rather than using the API.
Adverse event counts seem unreasonably high or low. FAERS includes duplicate reports, follow-up reports, and reports where the drug may not be causal. Deduplicate by case ID and apply causality assessment criteria before interpreting counts as safety signals.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Full-Stack Code Reviewer
Comprehensive code review skill that checks for security vulnerabilities, performance issues, accessibility, and best practices across frontend and backend code.
Test Suite Generator
Generates comprehensive test suites with unit tests, integration tests, and edge cases. Supports Jest, Vitest, Pytest, and Go testing.
Pro Architecture Workspace
Battle-tested skill for architectural, decision, making, framework. Includes structured workflows, validation checks, and reusable patterns for development.