Benny-/Yahoo-ticker-symbol-downloader

I couldn't download stocks

Closed this issue · 8 comments

root@bad:~# YahooTickerDownloader.py stocks
Checking if we can resume a old download session
Downloader found on disk, resuming
Downloading stocks


req https://finance.yahoo.com/_finance_doubledown/api/resource/finance.yfinlist.symbol_lookup;p=1;s=a;b=0;m=all;t=S?device=console&returnMeta=true
Retry attempt: 1. Sleep period: 5 seconds.
req https://finance.yahoo.com/_finance_doubledown/api/resource/finance.yfinlist.symbol_lookup;p=1;s=a;b=0;m=all;t=S?device=console&returnMeta=true
Retry attempt: 2. Sleep period: 25 seconds.
req https://finance.yahoo.com/_finance_doubledown/api/resource/finance.yfinlist.symbol_lookup;p=1;s=a;b=0;m=all;t=S?device=console&returnMeta=true
Retry attempt: 3. Sleep period: 125 seconds.

I think that url does not work.
That response is below.
{"output":{"message":"Not Found"},"meta":{}}

Thank you

Yes! You are right. The API probably changed.

I looked a bit around on google finance and could not find a GUI to list symbols using a search string. It could be they (re)moved it. If it is removed this utility can't do it's job and is rendered useless. If anyone known of a api to find a list of stocks please say so.

So basically the unofficial Yahoo API broke, and I'm not yet sure if there is a replacement.

This is great! Do you know where this api is used, @jharker ? If it supports pagination this will be a suitable replacement.

Hi, @Benny- Yup, the API is used by the "Symbol Lookup" tool on this page:

https://finance.yahoo.com/lookup/

But unfortunately, from what I can tell it doesn't support pagination. Still, it seems like it should be possible to use this to pull symbols in groups of ten or less using a few modifications to the search algorithm you're already using. I'll see if I have time to give it a shot in the next week or so.

Hi, @Benny- I created a pull request that implements the new Yahoo API. You may want to modify this to be more seamlessly integrated into the old code -- I didn't want to rip too much out of the existing code so I created some parallel functionality instead.

I've tested this over the past few days and it works pretty well. I wish there was a way to make it more efficient in terms of the number of API calls, but with the API results set apparently limited to 10 and not paginated, I can't figure out a way to do it more efficiently than this.

https://github.com/Benny-/Yahoo-ticker-symbol-downloader/pull/44

I ran it and I'm am quite impressed with the results so far. It got 84464 unique results so far.

Exporting still works and considering the other API did not work anymore I've published this right now as 3.0.0. This new version gives a lot of random 404 error from Yahoo, this is logged as #45.