Download OHLC Data from Tiingo
Downloads historical or realtime equity price data from https://api.tiingo.com/. Registration is required.
getSymbols.tiingo(Symbols, env, api.key, return.class="xts", periodicity="daily", adjust=FALSE, from='2007-01-01', to=Sys.Date(), data.type="json", ...)
Symbols |
a character vector specifying the names of the symbols to be loaded |
env |
where to create objects (environment) |
api.key |
the API key issued by Tiingo when you registered (character) |
return.class |
class of returned object, see Value (character) |
periodicity |
one of |
adjust |
adjust for dividends and splits? (FALSE) |
from |
Retrieve data no earlier than this date. (2007-01-01) |
to |
Retrieve data through this date (Sys.Date()) |
data.type |
either |
... |
additional parameters as per |
Meant to be called internally by getSymbols
only.
This method is not meant to be called directly, instead
a call to getSymbols("x", src="tiingo")
will
in turn call this method. It is documented for the
sole purpose of highlighting the arguments accepted.
You must register with Tiingo in order to download their data.
Register at their web site, https://api.tiingo.com,
and you will receive an API key:
a short string of alphanumeric characters (e.g., "FU4U").
Provide the API key every time you call getSymbols
;
or set it globally using setDefaults(getSymbols.tiingo, api.key="yourKey")
.
Tiingo provides daily, weekly, monthly, and annual data.
Use periodicity
to select one.
This API accessor will return adjusted or unadjusted OHLC as well as split and dividend information.
For daily, weekly, and monthly data, Tiingo says the available data is up to 30 years;
Tiingo provides access to data via two APIs. You can choose the API via
the data.type
argument. data.type="json"
, the default, will
import data using the JSON API. This API includes additional metadata (e.g.
last updated time, timezone, etc) that is not provided via the CSV API.
A call to getSymbols(Symbols, src="tiingo")
will create objects
in the specified environment,
one object for each Symbol
specified.
The object class of the object(s) is determined by return.class
.
Presently this may be "ts"
, "zoo"
, "xts"
, or "timeSeries"
.
Steve Bronder
Tiingo documentation available at https://www.tiingo.com
## Not run: # You'll need the API key given when you registered getSymbols("IBM", src="tiingo", api.key="yourKey") # Repeating your API key every time is tedious. # Fortunately, you can set a global default. setDefaults(getSymbols.tiingo, api.key="yourKey") getSymbols("IBM", src="tiingo") ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.