Check the setup
- Python 3.10 or newer
- A notebook environment such as Jupyter or Google Colab
- An internet connection
Current and historical U.S. streamflow, groundwater, water-quality, and site measurements for building gauge monitors and local water-analysis tools.
From source to product signal
The USGS Water Data APIs provide observations and metadata from monitoring locations across the United States. Start with recent discharge at one gauge and compare the latest value with that same bounded sample. Measurements may be provisional; coverage, qualifiers, units, and vertical datum vary by station, and the result is not an official flood warning.
Install the packages, then run the notebook cell.
python -m pip install pandas requests
from datetime import datetime, timedelta, timezone
import pandas as pd
import requests
end = datetime.now(timezone.utc)
start = end - timedelta(days=7)
response = requests.get(
"https://api.waterdata.usgs.gov/ogcapi/v0/collections/continuous/items",
params={
"f": "json",
"limit": 1000,
"datetime": f"{start.isoformat()}/{end.isoformat()}",
"monitoring_location_id": "USGS-01646500",
"parameter_code": "00060",
},
timeout=30,
)
response.raise_for_status()
streamflow = pd.json_normalize(response.json()["features"])
streamflow["value"] = pd.to_numeric(streamflow["properties.value"], errors="coerce")
streamflow["retrieved_at_utc"] = pd.Timestamp.now(tz="UTC")
print(streamflow[["properties.time", "value", "properties.unit_of_measure", "properties.approval_status", "properties.qualifier"]].tail())Test a useful signal
Determine where the latest discharge measurement at one gauge falls within the returned seven-day sample.
U.S. Geological Survey is a government source. Last verified 2026-08-11. Temporal coverage: historical records and near-real-time measurements.