Support Center

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

401 on API call (free 5 day forecast)

Daria Apr 03, 2018 04:10PM MSK

I am getting the 401 error whenever I try to fetch data from this endpoint: https://api.openweathermap.org/data/2.5/forecast?q=${city},${country}&${ API_KEY }&units=metric

This, however, works perfectly when I try to navigate to this (obviously feeding the data for a city, country and API key. If I change the "forecast" to "weather" it also works. I took this endpoint from https://openweathermap.org/forecast5
The API key was generated few days ago and is working fine on the "weather" endpoint".

How can I fetch this data from your server?

Up 1 rated Down
Maxim Gushcho Apr 03, 2018 06:37PM MSK OpenWeatherMap Agent

Hello,

Thanks for the request.

If you make API call correctly:

https://api.openweathermap.org/data/2.5/forecast?q={city}&{country code}&{ API_KEY }&units=metric

Please notice that the country code should be placed istead of full country name!

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