New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The API worhs for weather_at_place() but not for forecast_at_place() #316
Comments
@EightFawn still not working? I've tried your exact code and it works on my side - I have a free API key Please let me know! |
Hi, I seem to be facing a similar issues, I'm trying to run the following code:
I keep hitting the same error:
I am using a valid key, so I'm not too sure whats going on. Any insight would be great! |
Could you pls paste here the output of a print of your print(owm) thanks |
It gives me the same error, the output of the print of owm is:
|
IoI looks like there is no reason why it shouldn't work! Short of ideas.. |
I create a new API key but I have to wait that openweathermap verify the key |
It gives the same error... |
I tried to remove the part of the weather and leave only forecast but it still not working |
@EightFawn I've tested your exact code again on my side and it works like a charm Now, I think here the issue is not with PyOWM but with the API key itself So here my conjecture is: as my free API key was issued years ago and it seems that it calls OWM API endpoints that are now unaccessible to newer API keys. I've checked out on the OWM API website: it seems that as of today, only calls to the "OneCall" endpoint are enabled for free API key - this might explain why calls work on my side (because I have a kind of "legacy" API key) and don't work on yours. This behaviour was completely unexpeted to me :-S Luckily, you'll hopefylly be able to retrieve both observed and daily forecasted data using the |
Ok I try thanks |
It gives me an error when I try to find the geographic coordinates by the name, I used the same instructions of the wiki , the error is:
|
I have to open another issue for this? |
No, I'll check this out |
@EightFawn try the following to see if you get valid lat and lon values. city = list_of_locations[0]
print(city.lat, city.lon) @csparpa It appears that the example in the docs has an extra [0]: from pyowm.owm import OWM
owm = OWM('your-api-key')
reg = owm.city_id_registry()
list_of_locations = reg.locations_for('moscow', country='RU')
moscow = list_of_locations[0][0]
lat = moscow.lat # 55.75222
lon = moscow.lon # 37.615555 As in moscow = list_of_locations[0][0] should be moscow = list_of_locations[0]. Either that or the code is returning something that isn't expected from the Locations class. |
Yes, now it works, thanks |
Ok, I'll patch the docs then |
Works like a charm.. Was stumped for a while. thanks |
Does it return temperature for the next day? |
@Polly333 yep |
If you need to access forecaster's Weirdly enough, this won't work even with a new API key:
but this does work: Not sure if this is a problem in pyowm or on the openweathermaps side, but this workaround helped me (pyowm==3.2.0). |
@ividal opening up a new issue to investigate what you report |
The API works with:
But if I use:
daily_forecast = mgr.forecast_at_place('Roma', 'daily').forecast
It give me this error:
With only the weather_at_place() code it works but if I add at the same program the forecast_at_place() it gives me this error.
The text was updated successfully, but these errors were encountered: