Is YQL / datatables.org down as of May 17-18, 2017?
Asked Answered
P

4

6

During the past 1-2 days, the http query that I used to download historical stock prices from Yahoo Finance has not been working. The link I have been using is the first one below but I have also tried out the other three (since I saw other people using them):

http://real-chart.finance.yahoo.com/table.csv?s=TRQ&d=6&e=3&f=2016&g=d&a=5&b=25&c=2016&ignore=.csv
https://real-chart.finance.yahoo.com/table.csv?s=TRQ&d=6&e=3&f=2016&g=d&a=5&b=25&c=2016&ignore=.csv
http://ichart.finance.yahoo.com/table.csv?s=TRQ&d=6&e=3&f=2016&g=d&a=5&b=25&c=2016&ignore=.csv
https://ichart.finance.yahoo.com/table.csv?s=TRQ&d=6&e=3&f=2016&g=d&a=5&b=25&c=2016&ignore=.csv

One interesting thing that I noticed is that the link that the Yahoo website itself provides (to download the data manually) changed. The link used to be the first in the list above (after all, that's where I got it from) but now it is as follows:

https://query1.finance.yahoo.com/v7/finance/download/TRQ?period1=1466805600&period2=1467496800&interval=1d&events=history&crumb=DuX0UxVwtN0

Note that all these links should in theory retrieve the same data: stock prices for TRQ (just an example, I have tried e.g. AAPL as well) from 2016/06/25 to 2016/07/03.

This new links works in the browser or within my program, but it is hardly scalable since it requires a session cookie; if you just leave out the last query parameter, you get an error saying you are not authorized. This question asks about how to create said session cookie in an automated way; however, I want to ask about avoiding this problem entirely by trying to directly access the YQL database.

I tried using the following link to directly use the YQL API (converting the spaces to %20 etc., that's not the problem):

https://query.yahooapis.com/v1/public/yql?q=
  select * from yahoo.finance.historicaldata where symbol = "TRQ" 
  and startDate = "2016-06-25" 
  and endDate = "2016-07-03"
 &format=json
 &diagnostics=true
 &env=store://datatables.org/alltableswithkeys
 &callback=

This link returns a "connection refused" error. As this question suggests, this might be because the datatables.org site is down (the question in the link refers to a downtime incident about a year ago). Does anybody have more information on this?

Thanks.

Phagocytosis answered 18/5, 2017 at 14:24 Comment(1)
A warning that even if you get a scalable way to using the new link with a session cookie, the Adjusted Price data is incorrect, in that it does not account for dividends. Check out SPY. The adjusted price is always equal to the close, whereas after a dividend, the adjusted closes prior to the dividend should be adjusted down.Crank
F
8

Yahoo has officially confirmed that the Yahoo Finance API has been discontinued in the following thread in the Yahoo Help Community (see posts by username Nixon):

https://forums.yahoo.net/t5/Yahoo-Finance-help/Is-Yahoo-Finance-API-broken/m-p/250503#U250503

We are all asking ourselves "now what?"

Please share your findings with the community.

Fideliafidelio answered 18/5, 2017 at 14:43 Comment(1)
See this thread: Alternatives to the Yahoo Finance API?Phagocytosis
S
1

It appears to be down. Quandl is probably the closest free replacement, but it doesn't have all of the same data. In particular, I'm trying to retrieve data on various ETFs, such as VXUS and VTI, which aren't working.

Saunderson answered 19/5, 2017 at 3:23 Comment(0)
R
1

One of the great features of the now-discontinued Yahoo data was the "adjusted price" that essentially provided the total return of an instrument. Since that is also no longer offered, you might as well use the Google finance API which still can be automated. This is a snippet of what I use (excel VBA) to open and save a file with the data. The end date I used here is 2019 or whatever you want- it will download to the last available date without generating an error:

startdate = #3/15/2015#
StartingMonth = Format(startdate, "Mmm")
StartingDay = Format(startdate, "d")
StartingYear = Format(startdate, "yyyy")
startdate = StartingMonth & "+" & StartingDay & "%2C+" & StartingYear    
Symbol = "AAPL" 
ThisAddress = "http://www.google.com/finance/historical?q=" & _
            Symbol & "&startdate=" & startdate & "&enddate=Nov+1%2C+2019&output=csv"
Workbooks(ThisBook).FollowHyperlink Address:=ThisAddress
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=Symbol, FileFormat:=xlCSV
Racy answered 20/5, 2017 at 12:12 Comment(0)
H
1

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.

I have put together some quick Python3 code to download the same CSV as before (with adjusted price) through this new API. Please check out the GitHub project yahoo_quote_download.

Hast answered 21/5, 2017 at 3:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.