Once I had determined I was going to use London Air API and OpenWeatherMap’s API it made it easy to design my own API.
I find that documenting this process is essential as otherwise I would forget the decisions I’d made during planning and investigation when it came time to actually write the code.
Should I Cycle API
|25 August 2014||0.1||Matt Frear||Initial version|
|location||string||1||The location for weather results.
We will call OpenWeatherMap’s forecast service with this info http://api.openweathermap.org/data/2.5/forecast?
|airquality||string||0..n||A site code to check for pollution.
This parameter can be passed as a comma-separated list to check multiple sites, e.g.
A list of available locations is at:
We will call:
The response format will be JSON.
|city||string||The name of the City|
|temp||int||Temperature in degrees Celcius|
|symbol||int||OpenWeatherMap’s symbol for the current condition|
|windDegree||int||The wind direction in degrees from 0 to 359|
|windDirection||string||The 3 digit code for the wind direction, e.g. ENE|
|windSpeed||int||The wind speed in m/s|
|windStrength||string||A text description for the wind speed, e.g. “Moderate breeze”|
|pollution||||An array of pollution readings for each sensor requested|
A pollution reading looks like
|name||string||The Sitecode requested, e.g. WA7|
|speciesCode||string||The type of reading, e.g. NO2|
|airQualityIndex||int||The level of pollution, where 1 = low and 10 = high|
The API document is hosted in Google Docs over here: Should I Cycle API.