Support Center

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

Error 401 5Day + 3hours API

Rafael Nov 13, 2017 07:24PM UTC

I´m using API 5 day weather forecast ,

string queryString = "http://openweathermap.org/data/2.5/forecast?lat="
+ latitude+ "&lon=" +longitude+ ",&appid=" + key + "&units=metric";

but return error 401 , my Key exist and is valid , what a problem?

i need help.

Up 0 rated Down
Rafael Nov 13, 2017 08:21PM UTC
Now I´m remove "&units=metric", and return cod. 200 , message: 0.0044

Up 0 rated Down
Maxim Gushcho Nov 14, 2017 07:21AM UTC OpenWeatherMap Agent

Hello,

Does API call works in a browser?

Up 0 rated Down
Steve Penrod Nov 15, 2017 04:41AM UTC
Something has changed recently in your API processing. The handling of city names is now spotty.
The below queries worked up until a day or two ago.

# Example that includes the United States in the query and fails
http://api.openweathermap.org/data/2.5/forecast?q=Kansas%20City%2C+Kansas%2C+United+States&lang=en&APPID=XXX

# Removing the country works
http://api.openweathermap.org/data/2.5/forecast?q=Kansas%20City%2C+Kansas&lang=en&APPID=xxx

# But this one works with the country in it
http://api.openweathermap.org/data/2.5/forecast?q=Lawrence%2C+Kansas%2C+United+States&lang=en&APPID=XXX
Up 0 rated Down
Maxim Gushcho Nov 15, 2017 11:13AM UTC OpenWeatherMap Agent

Hello,

Please stick to the format of requests that described in the docs:

http://openweathermap.org/current

http://openweathermap.org/forecast5

Examples:

http://api.openweathermap.org/data/2.5/weather?q=Kansas&units=metric&appid=XXXX

http://api.openweathermap.org/data/2.5/forecast?q=Kansas&units=metric&cnt=6&appid=XXXX

Do not write full name of the country. You can add just a country code:

http://api.openweathermap.org/data/2.5/weather?q=Kansas,US&units=metric&appid=XXXX

We used to have some supporting functionality that was not documented. So, from now please focus on this types of requests.

Thanks for understanding.

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