How do I calculate the temperature in celsius returned in openweathermap.org JSON?

It looks like kelvin. Converting kelvin to celsius is easy: Just subtract 273.15.

And the briefest glance at the API documentation tells us that if you add &units=metric to your request, you'll get back celsius.


That appears to be kelvin, but you can specify the format you want returned for the temp, e.g.:

http://api.openweathermap.org/data/2.5/weather?q=London&mode=json&units=metric

or

http://api.openweathermap.org/data/2.5/weather?q=London&mode=json&units=imperial


Kelvin to Fahrenheit is:

(( kelvinValue - 273.15) * 9/5) + 32

I've noticed not all of the OpenWeatherApp calls read the units parameter if its passed in. (An example of this error: http://api.openweathermap.org/data/2.5/group?units=Imperial&id=5375480,4737316,4164138,5099133,4666102,5391811,5809844,5016108,4400860,4957280&appid=XXXXXX) Kelvin is still returned.