Yahoo Finance API changes (2017)
Asked Answered
S

3

26

Requesting data from Yahoo Finance seems to have changed or is now blocked. The request below for commodity data no longer works as of May 2017. Does anyone know if there is a new way to make this request?

http://chartapi.finance.yahoo.com/instrument/1.0/GCQ17.CMX/chartdata;type=quote;range=10d/csv/
Sanderlin answered 18/5, 2017 at 20:53 Comment(3)
The unsupported Yahoo finance API is shut down, see forums.yahoo.net/t5/Yahoo-Finance-help/…Sporades
Here is the answer for any one how wants it. On June 8, 2017 Yahoo will be sold to Verizon. So Yahoo is now removing services which can not generate ad revenue. Access to the Yahoo Finance API by third party software has been eliminated.Sanderlin
Alpha Vantage is a new free stock data API. I'm using it and it has worked really well. I've just written a blog post about it: the-data-wrangler.com/…Selfabnegation
B
25

First, the old Yahoo finance iChart download is gone for good. In one of the forum posts, a Yahoo employee has confirmed that the free EOD data has been terminated, and will not be reintroduced. Check out this thread and look for reply from Nixon. Yahoo is recently acquired by Verizon, and it must be the new direction.

However, if you check the Yahoo financial page, the CSV download link works, though differently now. It is through a new API that uses an authentication token "crumb" that is linked to a cookie when you access the page.

So there is a work-around to get the same CSV download as before through this new API. I have put together some quick Python3 code. Please check out GitHub for source code yahoo_quote_download.

Belittle answered 21/5, 2017 at 3:47 Comment(3)
Is there a way to get the data returned in JSON?Sanderlin
I don't know a way to do that. The old API did not return JSON either. There is another way that used to work through YQL which did return JSON if you ask for it, but the historicaldata table has been dropped by YQL server at about the same time that the old API stopped working (so it does not work now). Since you have the CSV, it is not hard to write a Python code to convert that to JSON.Belittle
homebase, see #47065276Lobe
S
5

As Ashley Davis mentioned in the comments section of the question above, the new way to go is through Alpha Vantage, at least when one is looking for free historical data. Their web service is very well documented and straight forward.

For those of you who are looking to import the data into Excel, I have written an api that I make available for free. Here is the Excel spreadsheet

Addendum as of Aug 2018: Current version of Deriscope supports retrieval of both historical data and live feeds from YF.

Sunset answered 28/10, 2017 at 3:47 Comment(0)
V
1

For Australian investors, here is an alternative to yahoo finance api:

www.biglion.com.au

Vanderhoek answered 27/10, 2018 at 8:24 Comment(5)
This is helpful, does it have restriction about how many requests a user can send per day?Sherlene
This service is banned by asx.Vanderhoek
Sad to hear. Do you know any other API about ASX? Thanks EDIT: found this one: alphavantage.co/support/#api-keySherlene
That one may not survive too long, I bet. In the long run, you can set up a data server for yourself in aws, datatellstory.blogspot.com/2018/11/…Vanderhoek
Cheers, luckily I am not building some sort of software to make money, I just want to build some simple web apps to build up JavaScript skills. Anyway, thanks for the tip! Much appreciated.Sherlene

© 2022 - 2024 — McMap. All rights reserved.