Check the setup
- Python 3.10 or newer
- A notebook environment such as Jupyter or Google Colab
- An internet connection
Structured FDA drug-label (SPL) documents for building label lookup, section-search, and medication-reference tools.
From source to product signal
DailyMed REST returns Structured Product Labeling metadata and sections. Start with one drug name search and a single SET ID. Labels are regulatory documents, not a complete picture of off-label use, and they can lag manufacturer updates.
Install the packages, then run the notebook cell.
python -m pip install pandas requests
import pandas as pd
import requests
response = requests.get(
"https://dailymed.nlm.nih.gov/dailymed/services/v2/spls.json",
params={"drug_name": "ibuprofen", "pagesize": 20, "page": 1},
timeout=30,
)
response.raise_for_status()
labels = pd.DataFrame(response.json()["data"])
labels["retrieved_at_utc"] = pd.Timestamp.now(tz="UTC")
print(labels.head())Test a useful signal
Test whether DailyMed search can power a bounded label-lookup inbox.
U.S. National Library of Medicine is a government source. Last verified 2026-08-18. Temporal coverage: currently published SPL labels with historical versions.