Support Center

Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Receive 'metric' instead of 'celsius' as temperature unit

Gabor Nemeth Aug 08, 2017 08:07AM UTC

I made the following request:
http://api.openweathermap.org/data/2.5/weather?APPID={your API key}&lat=51.51&lon=-0.13&units=metric&mode=xml

The result contains:
<temperature value="14.29" min="13" max="16" unit="metric"/>
According to the docs, it should be 'celsius', right?

Best regards,
Gabor Nemeth

Up 0 rated Down
Maxim Gushcho Aug 08, 2017 10:12AM UTC OpenWeatherMap Agent

Hello Gabor,

Yes, correct.
The data is in celsius.

Up 0 rated Down
Gabor Nemeth Aug 08, 2017 10:39AM UTC
Then it's a bug in the API, right? The XML response should have unit="celsius", not unit="metric".

Note: When I change units=imperial in the above request, the unit in the response is 'fahrenheit', which is correct.
Up 0 rated Down
Maxim Gushcho Aug 08, 2017 11:27AM UTC OpenWeatherMap Agent

Please check the docs:
http://openweathermap.org/current

Up 0 rated Down
Gabor Nemeth Aug 08, 2017 02:29PM UTC
I have already checked it. Don't get what I'm missing.

It says under the XML section:
...
temperature.unit Unit of measurements. Possilbe valure is Celsius, Kelvin, Fahrenheit.
...

As I interpret this, the actual value must not be 'metric', but 'celsius'.
Up 0 rated Down
Maxim Gushcho Aug 09, 2017 11:24AM UTC OpenWeatherMap Agent

Hello,

Metric is just interpretation of Celsius.

Up 0 rated Down
Gabor Nemeth Sep 08, 2017 08:05PM UTC
I insist that something is not right with this temperature.

The following request returns 'kelvin' in the result.
http://api.openweathermap.org/data/2.5/find?APPID={your API key}e&q=London&units=metric&mode=xml

The folowing forecast request returns 'celsius' - this is correct.
http://api.openweathermap.org/data/2.5/forecast?APPID={your API key}&id=2643743&units=metric&mode=xml

The request in the original question returns 'metric'
http://api.openweathermap.org/data/2.5/weather?APPID={your API key}&lat=51.51&lon=-0.13&units=metric&mode=xml

So three different results - 'kelvin' is not right for sure - although according to API docs, I should get 'celsius' in all three responses.

Regards,
Gabor
Up 0 rated Down
Maxim Gushcho Sep 12, 2017 02:57PM UTC OpenWeatherMap Agent

Hello Gabor,

We are aware about this issue with the “find?” approach that is days Kelvins.

We will consider to unify the respsonse format for all methods (find/forecast/weather).

Thanks a lot.

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)
9eda11838f597e7a95b6a1c991dcae0a@openweathermap.desk-mail.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete