getAssets: Download asset data from Alpha-Vantage

View source: R/getAssets.R

getAssetsR Documentation

Download asset data from Alpha-Vantage

Description

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.

Usage

getAssets(
  symbols,
  period = "daily",
  interval = NULL,
  market = "USD",
  crypto = FALSE,
  adjusted = TRUE,
  datatype = "json",
  key = "premium"
)

Arguments

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

Details

This is a wrapper to non-exported functions that separately pull either stock or coin data.

Value

xts object


shill1729/ravapi documentation built on June 1, 2025, 6:05 p.m.