Using the Weather.gov API

I live and ride bikes in Lawrence, Kansas. I used to be active in the Lawrence Mountain Bike Club, and I helped with their web site. One of the things that we needed to communicate to mountain bikers in the area was how much rain we’d gotten recently, so that we can help folks judge whether the trails might be too muddy ride.

In the early 2010s, the web site “Weather Underground” offered an API to query their broad database of weather data, including historical weather data. It was exactly what I needed, and gave me the impetus to build a custom WordPress widget for the web site’s sidebar.

The whole thing came to a crashing halt after Weather Underground, which had been purchased by the Weather Company (weather.com) in 2012, then got acquired by IBM in 2016. In December 2018, the free API service was entirely discontinued, even for a user like me who was only querying their service for a single weather station, once per hour. If you wanted any weather data at all through their API, you had to talk to a sales rep and pay a fee.

They were going to charge me money, to give me access to National Weather Service data. Public data that, no doubt, Weather Company (and IBM) were accessing and monetizing for free. This was so frustrating, because that data is is public (and paid for with public taxes) and is available for the public interest.

Well, I can play that game.

It took me a while to find, but I finally found the API (https://www.weather.gov/documentation/services-web-api), and the source data for the weather station I needed (the Lawrence Municipal Airport: https://api.weather.gov/stations/KLWC/observations).

So now, once again, I’ve got my little weather widget. Woo-hoo. Next step, hopefully soon, I’ve gotta put together a how-to, in case anyone else wants to know how I am using the Weather.gov API.