Martin Abrahams Team : Web Development

Free Weather API

Martin Abrahams Team : Web Development

For many years Google provided a free weather API which was very popular. Unfortunately they quietly pulled the plug on it in June 2014 leaving a large number of existing websites and apps out in the cold.

It's common for portal style websites to display basic current weather information as a way of portraying a sense of localisation and appear freshly updated.

Last week I stumbled upon a free weather API by pure accident. Remembering the debacle with the Google API I thought I'd investigate it and quick it a try. They offer a premium and free version, the key difference with the free version is that your limited to 4,000 queries a day and the realtime data is only updated in 3 hour intervals as opposed to hourly in the premium API. Also it seems like you can only retrieve data in XML format on the free version. 

In the real world example of a localised website showing major city weather data and the use of data caching I think the free version is adequate.

I signed up for a license key and ran some tests in Fiddler and it seems to meet the requirements perfectly. The simplest  way to get data is to pass in a Latitude and Longitude and the weather API will return a list of the closest weather observations. A simple GET request and I have all the data I need including a URL to a weather icon as well as a unique identifier for the weather code to in case you'd like to  create your own set of icons.