Goodbye Google, Hello Tiingo!

April 13, 2018
By

(This article was first published on FOSS Trading, and kindly contributed to R-bloggers)

First, the bad news:

Google Finance no longer provides data for historical prices or financial statements, so we say goodbye to getSymbols.google() and getFinancials.google(). (#221)  They are now defunct as of quantmod 0.4-13.

Now, the good news:

Thanks to Steve Bronder, getSymbols() can now import data from Tiingo! (#220)  This feature is part of quantmod 0.4-13, which is now on CRAN.  Windows and Mac binaries should be built in a day or two.

Tiingo is a web service that provides tools and data for financial analysis.  They provide daily price history for US stocks and ADRs, Chinese stocks, Mutual Funds, and ETFs.  There is up to 30+ years of history, including raw prices and split/dividend adjusted prices.

All this data is accessible for free, with reasonable symbol and bandwidth limits.  All you need to get started is a one-time registration for an API token.  You should see your API token just above the beginning of the metadata section, after logging in, of course.  Tiingo has a well-documented daily price data API that returns either JSON or CSV.

To get started, install the latest quantmod from CRAN.  Then you call:

  getSymbols(“MSFT”, src = “tiingo”, api.key = “[your key]”) 

Where you replace “[your key]” with the API key you receive after registration.  You can use setDefaults() to set your API key one time, and use it for all getSymbols.tiingo() calls.

  setDefaults(“getSymbols.tiingo”, api.key = “[your key]”)

Other notable changes:

  • There is now a getQuote.alphavantage() that allows you to pull real-time quotes from Alpha Vantage.  Thanks to Ethan Smith! (#213, #223)
  • Speaking of Alpha Vantage, getSymbols.av() can now pull weekly and monthly adjusted prices. (#212)
  • The URL in getSymbols.oanda() and getFX() has been updated, so they work again. (#225)
  • getQuote.yahoo() no longer errors when a field has no data for all requested tickers. (#208)
  • saveChart() actually saves charts now (#154). Brilliant!

To leave a comment for the author, please follow the link and comment on their blog: FOSS Trading.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)