calzoneman/i3-weather

API stopped working

Closed this issue · 7 comments

(Opening this for tracking purposes)

It seems that the Yahoo weather API being used now always returns a 401 Unauthorized. It's likely they shut it down in favor of something that requires an access key (which is unfortunate).

<yahoo:error xml:lang="en-US" yahoo:uri="http://yahoo.com"><yahoo:description>Please provide valid credentials. OAuth oauth_problem="OST_OAUTH_PARAMETER_ABSENT_ERROR", realm="yahooapis.com"</yahoo:description><yahoo:detail>Please provide valid credentials. OAuth oauth_problem="OST_OAUTH_PARAMETER_ABSENT_ERROR", realm="yahooapis.com"</yahoo:detail></yahoo:error>```

"To increase the security measure and better serving our YDN customers, weather data source will enforce OAuth 1 starting March 15, 2016. Please update your API calls with OAuth 1 enabled (via the OAuth /v1/yql end point if using YQL) using your Yahoo App key and secret."

In English: we want to make it a pain for developers to call this API because we'd rather not implement proper throttling and security rules for anonymous access.

This appears to be the new API, but I can't figure out how to specify the units: https://developer.yahoo.com/weather/

So it turns out that in order to register a Yahoo account to get an API key, you have to provide a real mobile phone number (Google Voice numbers are rejected). I'll likely be dropping the Yahoo API in favor of something less annoying to register for.

It looks like you don't need a key for the public data like weather. i made a quick example:
https://gist.github.com/Xaseron/2c7cc277f17b8a5dfc67
You can set the units with the u parameter its either 'f' or 'c'.

That contradicts their API page which states

To increase the security measure and better serving our YDN customers, weather data source will enforce OAuth 1 starting March 15, 2016. Please update your API calls with OAuth 1 enabled (via the OAuth /v1/yql end point if using YQL) using your Yahoo App key and secret.

It may continue to work for now, and would probably be a reasonable "quick fix", but in the long term it sounds like they're trying to get rid of unauthenticated APIs.

That seems to have unbroken it for now (thanks @Xaseron) so I'm going to close this issue and open a separate one to investigate options for using other APIs.