csparpa / pyowm

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

PyOwm always returns API Key Is Invalid for 'startup' subscription #332

Closed nishant842 closed 3 years ago

nishant842 commented 4 years ago

When I initialize the library with the following, it fails

config_dict = get_default_config_for_subscription_type('startup') owm = OWM('your-paid-api-key', config_dict)

If I change the subdomain from pro to api with the following, it works:

config_dict["subscription_type"].subdomain = "api"

csparpa commented 4 years ago

@nishant842 thanks for reporting

Can you tell what method you called on the owm object and returned the error ?

csparpa commented 4 years ago

It looks like the folks at OWM changed how the paid subscription API calls work: they once used to have different subdomains for different pricing tiers, now they all use the same subdomain (api.) and discriminate calls based on the API key. Which is - IMO - better :-)

Will fix it!