Goodbye Google, Hello Tiingo!
[This article was first published on FOSS Trading, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
First, the bad news:Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
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 about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.