CICCIOSGAMINO / openweather-apis

Simple APIs for OpenWeatherMap.org basic services
GNU General Public License v3.0
44 stars 27 forks source link

5-Day forecast (free-tier) returning 401 Error (Invalid API Key...) #37

Closed stall84 closed 3 years ago

stall84 commented 4 years ago

Hi! I love the module you've made. However I am having a problem when trying to retrieve a 5 day forecast. My API key (I'm using the free-tier) is working and fine because I can use the getAllWeather method with no problem at all. In the documentation you only specify getting a 3-day forecast (which also is not working for me, returning 401). So what I did was just change the 3 parameter to 5 to get the 5 day forecast (which is allowed under the free tier). So I basically made the method: weather.getWeatherForecastForDays(5, function(err, weatherObj) { console.log(weatherObj) } It's returning error 401 'Invalid API key. Please see http://openweathermap.org/faq#error401 for more info.' . Like I said all of the other methods are working fine, so I know my API key is not the problem. The 3 day forecast (the example you have in the documentation) is also erroring.
So basically would like to know if you have a method for returning the free-tier's 5-day forecast ? In screenshots I've included one instance shows getAllWeather working fine, 2nd screenshot shows error when trying getWeatherForecastForDays 3day

Screen Shot 2020-07-19 at 9 57 11 AM Screen Shot 2020-07-19 at 9 58 31 AM
asm6788 commented 4 years ago

Use weather.getWeatherForecast Not Days

stall84 commented 4 years ago

Will give it a try . Thank you!

CICCIOSGAMINO commented 3 years ago

I'll fix the bug in the v5 ! Thanks

CICCIOSGAMINO commented 3 years ago

I have the same error every time i try to get the forecast,,,, i think we cannot have forecasts with the free Api Key !! In version v5.0.0 you have the getForecast4Days (cnt) function but it does't work too .... Pro account is needed !!