I'm getting the weather for a city using openweathermap.org.
The jsonp call is working and everything is fine but the resulting object contains the temperature in an unknown unit:
{ //... "main": { "temp": 290.38, // What unit of measurement is this? "pressure": 1005, "humidity": 72, "temp_min": 289.25, "temp_max": 291.85 }, //... }
Here is a demo that console.log
's the full object.
I don't think the resulting temperature is in fahrenheit because converting 290.38
fahrenheit to celsius is 143.544
.
Does anyone know what temperature unit openweathermap is returning?
Converting kelvin to celsius is easy: Just subtract 273.15. Looking at the API documentation, if you add &units=metric to your request, you'll get back celsius.
Explanation of the parameters: http://openweathermap.org/weather-data#current. dt : Data receiving time (in unix, UTC format). dt is the time of data receiving in unixtime GMT (greenwich mean time).
We analysed the behaviour of metrics for the OpenWeather NMP model during two months. The figure shows that MAE is about 0.5 degrees, RMSE is less than 2 degrees, reliability is between 90% and 100%, and inaccuracy is about 1% (less is better).
The API key is all you need to call any of our weather APIs. Once you sign up using your email, the API key (APPID) will be sent to you in a confirmation email. Your API keys can always be found on your account page, where you can also generate additional API keys if needed.
It looks like kelvin. Converting kelvin to celsius is easy: Just subtract 273.15.
Looking at the API documentation, 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With