Check the setup
- Python 3.10 or newer
- A notebook environment such as Jupyter or Google Colab
- An internet connection
FDA food-recall enforcement reports for building bounded product-safety monitors and recall-research tools.
From source to product signal
The openFDA food-enforcement API returns classified FDA Recall Enterprise System reports for food products. Start with one hazard class and a bounded report-date window. Do not use this feed as a public-alert system, and do not treat recall status as current after classification.
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/food/enforcement.json",
params={
"search": 'classification:"Class I" AND report_date:[20250101 TO 20251231]',
"limit": 20,
},
timeout=30,
)
response.raise_for_status()
recalls = pd.DataFrame(response.json()["results"])
recalls["retrieved_at_utc"] = pd.Timestamp.now(tz="UTC")
print(recalls[["recalling_firm", "product_description", "reason_for_recall", "report_date"]].head(20))Test a useful signal
Identify which firms and reasons appear most often in Class I food-enforcement reports for a bounded calendar year.
U.S. Food and Drug Administration is a government source. Last verified 2026-08-14. Temporal coverage: 2004-present.