Check the setup
- Python 3.10 or newer
- A notebook environment such as Jupyter or Google Colab
- An internet connection
FDA adverse-event reports for exploring reported drug reactions and building bounded pharmacovigilance research tools.
From source to product signal
The openFDA drug-event API provides searchable FDA Adverse Event Reporting System records and server-side counts. Start with one drug name and a bounded reporting period. These voluntary reports can help surface patterns for investigation, but they cannot establish causality, incidence, or comparative safety.
Install the packages, then run the notebook cell.
python -m pip install pandas requests
import pandas as pd
import requests
response = requests.get(
"https://api.fda.gov/drug/event.json",
params={
"search": 'patient.drug.openfda.generic_name:"IBUPROFEN" AND receivedate:[20250101 TO 20251231]',
"count": "patient.reaction.reactionmeddrapt.exact",
},
timeout=30,
)
response.raise_for_status()
reactions = pd.DataFrame(response.json()["results"])
reactions["retrieved_at_utc"] = pd.Timestamp.now(tz="UTC")
print(reactions.head(20))Test a useful signal
Identify the most frequently reported reaction terms for one drug in a bounded calendar year.
U.S. Food and Drug Administration is a government source. Last verified 2026-08-11. Temporal coverage: 2004-present.