DEV Community

Eric McWay
Eric McWay

Posted on

Show DEV update: the hardest part of a live water-temperature site isn't the temperature — it's the timestamps

Follow-up to my Show DEV post last week — I run https://watertemperaturelive.com, which republishes NOAA / NDBC / USGS water readings for about 20 U.S. coastal and Great Lakes spots.

The thing I underestimated: the readings are the easy part. NOAA's CO-OPS API gives you a station reading every few minutes with an observation timestamp. The hard parts are everything around that:

  1. Stations go quiet. A pier sensor fouls or a storm knocks it out, and the API just stops returning new values. If you cache the last number without its age, your site happily shows a three-day-old temperature as "current."
  2. Observed vs. analyzed. For spots without a pier station I use NASA/JPL's MUR satellite analysis — a daily ~1km grid. It's an analysis of the surface, not a thermometer in the water, and it can disagree with a pier a few km away by a few degrees. Both are "right"; they're different measurements.
  3. Timezones. Tide predictions share the page with the readings, so a timestamp rendered in UTC next to a tide table in local time confuses everyone.

My current approach: every number renders with its station ID, its observation time in local time, and its age; if a station's newest reading is older than a threshold, the page says so instead of implying it's live, and a missing station is labeled missing rather than silently filled in from the satellite grid.

Concrete example: the La Jolla pier station (NOAA 9410230) read 73.2°F at 9:24 AM PDT today (Oct 26) — well above that station's 2021–2025 October baseline on the site, which tops out at 67.8°F. The timestamp is what makes that claim checkable.

Example page: https://watertemperaturelive.com/us/california/la-jolla/?utm_source=dev-community&utm_medium=community&utm_campaign=water_resources

Disclosure: I'm the owner/builder of the site — posting for feedback, not just traffic. (I used AI assistance to help draft this post.)

Question for others publishing live sensor data: how do you label stale data — a visible age badge, grey it out, hide it entirely? And do you surface "station offline" as an explicit state, or just fall back to the nearest source?

— Eric McWay

Top comments (0)