M

Master Fda Database

Boost productivity using this query, openfda, drugs, devices. Includes structured workflows, validation checks, and reusable patterns for scientific.

SkillClipticsscientificv1.0.0MIT
0 views0 copies

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

EndpointData SourceExample Query
/drug/eventFAERS adverse eventsDrug safety signals
/drug/labelStructured drug labelsIndications, warnings
/drug/enforcementDrug recallsRecall classifications
/device/eventDevice adverse eventsDevice complaints
/device/510k510(k) clearancesDevice approvals
/food/eventFood adverse eventsAllergen reports
/food/enforcementFood recallsContamination 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 }
# 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

ParameterDescriptionDefault
api_keyopenFDA API key (optional, higher limits)None
endpointDrug, device, or food eventsdrug/event
limitResults per request (max 1000)100
skipPagination offset0
countField to aggregate byNone

Best Practices

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. Use the count parameter for aggregations. Instead of downloading all events and counting locally, use openFDA's count parameter 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.

Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates