Check the Setup
- Python 3.10 or newer
- A notebook environment such as Jupyter or Google Colab
- An internet connection
Weekly U.S. wastewater viral detections for influenza A and other pathogens for building community-level respiratory-illness monitoring tools.
Report a ProblemFrom Source to Product Signal
NWSS publishes site-level wastewater viral detections on data.cdc.gov. Start with a few recent influenza A rows. Coverage is incomplete — not every utility reports — and detections are not clinical incidence.
Install the packages, then run the notebook cell.
python -m pip install pandas requests
import pandas as pd
import requests
response = requests.get(
"https://data.cdc.gov/resource/ymmh-divb.json",
params={"$limit": 20, "$order": "sample_collect_date DESC"},
timeout=30,
)
response.raise_for_status()
wastewater = pd.DataFrame(response.json())
wastewater["retrieved_at_utc"] = pd.Timestamp.now(tz="UTC")
print(
wastewater[
[
"site",
"state_territory",
"counties_served",
"sample_collect_date",
"pcr_target",
"pcr_target_detect",
]
].head(20)
)Test a Useful Signal
Test whether recent site-level influenza A detections can power a bounded community alert.
Centers for Disease Control and Prevention is a government source. Last verified 2026-08-20. Temporal coverage: site-level wastewater samples from 2022-present.