| getAssets | R Documentation |
A wrapper to Alpha Vantage's API. This function can download either stocks or crypto-currencies. Adjusted close prices are returned when pulling multiple stocks in a single xts object with columns for each stock. Otherwise, for a single asset the entire OHLCV object is returned.
getAssets(
symbols,
period = "daily",
interval = NULL,
market = "USD",
crypto = FALSE,
adjusted = TRUE,
datatype = "json",
key = "premium"
)
symbols |
vector of stock ticker or coin symbols to download |
period |
period: "intraday", "daily", "weekly", "monthly" |
interval |
NULL for anything but intraday otherwise "1min", "5min", "15min", "30min", "60min" |
market |
only needed for crypto: use "USD", "CNY", "EUR", etc |
crypto |
boolean for downloading crypto |
adjusted |
boolean for adjusted prices |
datatype |
"json" or "csv" |
key |
"premium" or "free"; the type of API key obtained from AV |
This is a wrapper to non-exported functions that separately pull either stock or coin data.
xts object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.