csparpa / pyowm

A Python wrapper around the OpenWeatherMap web API
https://pyowm.readthedocs.io
MIT License
791 stars 175 forks source link

API working for weather_at_place() but not owm.daily_forecast() or other calls #266

Closed CentralHarlemAnonymous closed 6 years ago

CentralHarlemAnonymous commented 6 years ago

I have a couple of OpenWeatherMap free API keys. They work fine for

owm = pyowm.OWM(MyFreeKey)
observation = owm.weather_at_place('Dobbs Ferry, US')
w = observation.get_weather()

but if I try

forecast = owm.daily_forecast('Dobbs Ferry, US')

I get the error

raise api_response_error.UnauthorizedError('Invalid API Key provided')
pyowm.exceptions.api_response_error.UnauthorizedError: Your API subscription level does not allow to perform this operation

Free API should give access to basic forecasts; what am I doing wrong?

csparpa commented 6 years ago

Hi

It looks like daily forecasts are not free of charge any more:

https://openweathermap.org/price

while3h forecasts still are :-/

CentralHarlemAnonymous commented 6 years ago

5day / 3 hour forecast looks free to me. Was I using the wrong command for this API call? If so, what should I have done?

Thanks.

Von meinem iPhone gesendet.

On Aug 6, 2018, at 8:54 AM, Claudio Sparpaglione notifications@github.com wrote:

Hi

It looks like daily forecasts are not free of charge any more:

https://openweathermap.org/price

while3h forecasts still are :-/

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

csparpa commented 6 years ago

If you're ok with 3 hours granularity forecasts (on a 5 days streak), then go with:

https://github.com/csparpa/pyowm/blob/197540db41cf90ce84d2e233f770b290de6d99ca/pyowm/webapi25/owm25.py#L473

What you did is call the daily_forecast() method which fetches 1 day granularity forecasts on a 16 days streak, but is on the paid tier as we said

Makes sense? Let me know!

CentralHarlemAnonymous commented 6 years ago

Makes sense. I’ll try it when I get home tonight.

Thank you,

MS

On Aug 6, 2018, at 9:04 AM, Claudio Sparpaglione notifications@github.com wrote:

If you're ok with 3 hours granularity forecasts (on a 5 days streak), then go with:

https://github.com/csparpa/pyowm/blob/197540db41cf90ce84d2e233f770b290de6d99ca/pyowm/webapi25/owm25.py#L473 https://github.com/csparpa/pyowm/blob/197540db41cf90ce84d2e233f770b290de6d99ca/pyowm/webapi25/owm25.py#L473 What you did is call the daily_forecast() method which fetches 1 day granularity forecasts on a 16 days streak, but is on the paid tier as we said

Makes sense? Let me know!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/csparpa/pyowm/issues/266#issuecomment-410700797, or mute the thread https://github.com/notifications/unsubscribe-auth/AOQwrAiEFT8scywoa-52h56JVQpa4JhFks5uOD7VgaJpZM4Vvehp.

csparpa commented 6 years ago

@MichaelSternNYC is it then fine to close this issue? Thanks

CentralHarlemAnonymous commented 6 years ago

Worked like magic. Thanks for checking.

On Aug 12, 2018, at 3:22 PM, Claudio Sparpaglione notifications@github.com wrote:

@MichaelSternNYC https://github.com/MichaelSternNYC is it then fine to close this issue? Thanks

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/csparpa/pyowm/issues/266#issuecomment-412365664, or mute the thread https://github.com/notifications/unsubscribe-auth/AOQwrGZihRlNuPOIjXI_S00VQhZsDoXPks5uQIB0gaJpZM4Vvehp.