Check the setup
- Python 3.10 or newer
- A notebook environment such as Jupyter or Google Colab
- An internet connection
Consumer product recall records for building bounded product-safety lookups and owner-notification tools.
From source to product signal
CPSC's Recall Retrieval service returns consumer product recalls as JSON. Start with a short date window; an unfiltered request can return the entire catalog. A recall record is not a current inventory check, and date parameters must be spelled exactly.
Install the packages, then run the notebook cell.
python -m pip install pandas requests
import pandas as pd
import requests
response = requests.get(
"https://www.saferproducts.gov/RestWebServices/Recall",
params={
"format": "json",
"RecallDateStart": "2025-01-01",
"RecallDateEnd": "2025-03-31",
},
timeout=30,
)
response.raise_for_status()
recalls = pd.DataFrame(response.json())
recalls["retrieved_at_utc"] = pd.Timestamp.now(tz="UTC")
print(recalls[["RecallNumber", "Title", "RecallDate"]].head(20))Test a useful signal
Identify which product titles appear most often in a bounded CPSC recall window.
U.S. Consumer Product Safety Commission is a government source. Last verified 2026-08-17. Temporal coverage: 1973-present.