Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yahoo Finance API changes (2017)

Tags:

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/ 
like image 266
homebase Avatar asked May 18 '17 20:05

homebase


People also ask

What happened to Yahoo Finance API?

Strangely, after the launch of a new feature in Yahoo's API it was decided that discontinuation would occur. Yes, that means there is no more reliable way to gain access to stock information freely, and users have to purchase this data on yearly/monthly subscriptions.

Is Yahoo Finance API deprecated?

Yahoo Finance API is Discontinued. Here is your Top 10 Yahoo Finance API Alternatives. Yahoo's finance API was a good choice. But unfortunately it is discontinued.

Does Yahoo Finance still have an API?

The Yahoo Finance API is a RESTful API that provides access to financial data. This data includes stock quotes, historical prices, and company information. The API is free to use and does not require an API key. The Yahoo Finance API is available in both JSON and XML format.

How far back does Yahoo Finance go?

If the data requested is beyond the range of historical prices available through Yahoo Finance, all available data within the range is displayed. Historical prices usually don't go back earlier than 1970.


2 Answers

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.

like image 89
c0redumb Avatar answered Oct 21 '22 20:10

c0redumb


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.

like image 24
Yannis Avatar answered Oct 21 '22 20:10

Yannis