Check the setup
- Python 3.10 or newer
- A notebook environment such as Jupyter or Google Colab
- An internet connection
Official coastal water levels, tide predictions, currents, and station metadata for building harbor, shoreline, and marine-planning tools.
From source to product signal
NOAA CO-OPS publishes observed and predicted water levels for supported coastal stations. Start with one station and one UTC day, using the same units and tidal datum for both series. Station coverage, time zone, units, datum, and the distinction between an observation and a prediction must remain explicit.
Install the packages, then run the notebook cell.
python -m pip install pandas requests
import pandas as pd
import requests
base_url = "https://api.tidesandcurrents.noaa.gov/api/prod/datagetter"
common = {
"date": "today",
"station": "9414290",
"datum": "MLLW",
"time_zone": "gmt",
"units": "metric",
"application": "TrilemmaDataGuide",
"format": "json",
}
observed_response = requests.get(base_url, params={**common, "product": "water_level"}, timeout=30)
predicted_response = requests.get(base_url, params={**common, "product": "predictions"}, timeout=30)
observed_response.raise_for_status()
predicted_response.raise_for_status()
observed = pd.DataFrame(observed_response.json()["data"]).rename(columns={"t": "time", "v": "observed_m"})
predicted = pd.DataFrame(predicted_response.json()["predictions"]).rename(columns={"t": "time", "v": "predicted_m"})
comparison = observed.merge(predicted, on="time", how="inner")
comparison[["observed_m", "predicted_m"]] = comparison[["observed_m", "predicted_m"]].apply(pd.to_numeric)
comparison["difference_m"] = comparison["observed_m"] - comparison["predicted_m"]
comparison["retrieved_at_utc"] = pd.Timestamp.now(tz="UTC")
print(comparison[["time", "observed_m", "predicted_m", "difference_m", "q"]].head())Test a useful signal
Find when observed water level differs most from the tide prediction at one station during one day.
NOAA Center for Operational Oceanographic Products and Services is a government source. Last verified 2026-08-11. Temporal coverage: station-dependent historical, current, and predicted conditions.