The Golden West Weather API is a simple wrapper around Environment Canada's raw meteorological data feeds. There are three main components that make up the entire weather experience provided on Golden West portals:
ec-grabber. It is written in C and runs every 15 minutes by cron job. It walks through Environment Canada's servers saving XML files as it goes. For more information see the source code.
ec-grabber. It is written in Ruby using the Sinatra framework. Each request returns weather data in
JSONformat if successful. The response is created by converting the raw XML into Badgerfish style
JSON. For better performance, the converted
JSONis stored in a Memcached instance. For more information see the overview.
There are only four requests that can be made, all of them
HTTP/1.1 GET requests and return
JSON data if successful. Every call to the Golden West Weather API must have an
api_key appended to the end of the request. In the future, the
api_key will need to be provided by way of an HTTP request header.
All calls return
HTTP/1.1 400 if
station_code is invalid and
HTTP/1.1 401 if an incorrect
api_key was provided.
station_code received is currently experiencing weather warnings, they will be included in all responses.
api_key was not intended to be an authentication mechanism and it should not be thought of as entirely secure. It's intent is to simply eliminiate as many unauthorized API calls as possible without having to implement a robust authentication mechanism. To obtain an API key, contact Stefan Sobering or Dave Lehman.
HTTP/1.1 GET /api/weather/:station_code?api_key=YOUR_API_KEY
Returns all weather data for the given
HTTP/1.1 GET /api/weather/:station_code/current_conditions&api_key=YOUR_API_KEY
Returns the current conditions for the given
HTTP/1.1 GET /api/weather/:station_code/forecast&api_key=YOUR_API_KEY
Returns the forecast for the given
HTTP/1.1 GET /api/weather/:station_code/warnings&api_key=YOUR_API_KEY
Returns the current weather warnings (if any exist) for the given
Each Environment Canada weather station has a corresponding
station_code. Below is a legend of all weather stations that Golden West utilizes along with their
station_codes. You can sort the table columns by clicking on the column you wish to sort by.
Last updated on June 27, 2013 at 4:00pm by [email protected].