

I believe I encountered some rate limiting when I attempted to do this, but it works nonetheless. "&enddate=", paste(em, ed, ey, sep = "+"),ĭownloading All S&P 500 Stocks with Google Google <- function(sym, current = TRUE, sy = 2005, sm = 1, sd = 1, ey, em, ed)Įy <- as.numeric(substr(system_time, start = 1, stop = 4))Įm <- as.numeric(substr(system_time, start = 6, stop = 7))Įd <- as.numeric(substr(system_time, start = 9, stop = 10))

If(!'data.table' %in% installed.packages()) install.packages('data.table') It is actually shorter and more easily read. Below is our old Yahoo! Finance function re-written to support the Google Finance API. Update #6: Google Finance API is Hidden but LiveĪfter more research, I discovered that R’s quantmod package is using a hidden version of the Google Finance API that works just fine. Volumeīecause everything I write about breaks, the Google Finance API is now only delivering the most recent year’s data, regardless of what parameters are passed to it. So, I urge readers to stop depending on the fickle free services from tech giants, and sign up for an account and API key with Quandl.Ĭredit to GitHub user johnatasjmo for this solution: I spoke to the Quandl team about using it for frequent downloads and educational purposes, and they were fully supportive. Their daily stock API is sort of a “free trial” for their premium subscription products. In better news, Quandl has created an excellent API for downloading daily stock data. Writing out the code required make a single download the new Yahoo API is more of a lesson in networking and cookie management than trading, so I will refrain from publishing it for the moment. The URL endpoint of the Yahoo API, and the steps required to make a single download, have lengthened considerably.

The plot thickens once again! According to QuandMod’s getSymbols() function, the Yahoo! Finance API is currently the best free API that does not require registration. That 3rd party is no longer providing the data, forcing us to search for other options. According to the CIO of Quandl, it was being provided for free by a 3rd party. According to an email I got from Quandl (and a few commenters corroborating), the Quandl EOD data API is no longer supported and is not providing data past March 27th.
