Saturday, May 20, 2017

Yahoo is dead, long live Yahoo!

On 18 May 2017 the ichart data api of yahoo finance went down, without any notice. And it does not seem like it is coming back. This has left many (including me) with broken code and without a descent free end-of-day data source. Something needs to be done. Now.

Apparently Yahoo! does not want us to download free data automatically, but it is still possible to download it by hand, clicking the 'download' button on the ticker webpage. Automatic downloading is made more difficult by using a cookie-crub pair, but luckily still possible.

I'm now working on updating the tradingWithPython.yahooFinance library and as a part of that work I've created a proto script that shows how to get the data. Because so many are now  scrambling to get their code working, I'm sharing this as soon as possible.

The notebook can be found on Github, enjoy!

Update: yahooFinance.py has been fixed!


Note: the data provided seems to be adjusted for splits, but not for dividends.

3 comments:

  1. ATM You can scrape "http://finance.yahoo.com/quote/spy?ltr=1" for up to the minute data. For previous days: "https://finance.yahoo.com/quote/SPY/history?p=SPY"
    and use Quantdl for longer term

    ReplyDelete
  2. Hi, I found that sometimes the crumb token may contain the encoding of forward slash \u002F.

    Add the below line will fix the problem:
    crumb = crumb.replace(u'\\u002F', '/')

    ReplyDelete
  3. Connecting to Interactive Brokers TWS is enough for many :)

    ReplyDelete