Learn R Programming

alphavantager (version 0.1.2)

av_get: Get financial data from the Alpha Vantage API

Description

Get financial data from the Alpha Vantage API

Usage

av_get(symbol, av_fun, ...)

Arguments

symbol

A character string of an appropriate stock or fund. See parameter "symbol" in Alpha Vantage API documentation.

av_fun

A character string matching an appropriate Alpha Vantage "function". See parameter "function" in Alpha Vantage API documentation.

...

Additional parameters passed to the Alpha Vantage API. For a list of parameters, visit the Alpha Vantage API documentation.

Value

Returns a tibble of financial data

Details

Get more than one symbol. The Alpha Vantage API is setup to return one symbol per API call. Use the tidyquant::tq_get() API to get multiple symbols.

See Also

av_api_key()

Examples

Run this code
# NOT RUN {
# SETUP API KEY
av_api_key("YOUR_API_KEY")

# ---- 1.0 STOCK TIME SERIES ----

# 1.1 TIME SERIES INTRADAY
av_get("MSFT", av_fun = "TIME_SERIES_INTRADAY", interval = "5min")

# 1.2 TIME SERIES DAILY ADJUSTED
av_get("MSFT", av_fun = "TIME_SERIES_DAILY_ADJUSTED")

# 1.3 QUOTE ENDPOINTS
av_get("MSFT", av_fun = "GLOBAL_QUOTE")

# ---- 2.0 FOREX ----

# 2.1 CURRENCY EXCHANGE RATES
data <- av_get("EUR/USD", av_fun = "CURRENCY_EXCHANGE_RATE")

# 2.2 FX INTRADAY
av_get("EUR/USD", av_fun = "FX_INTRADAY", interval = "5min")

# 2.3. FX DAILY
av_get("EUR/USD", av_fun = "FX_DAILY")

# ---- 3.0 TECHNICAL INDICATORS ----

# 3.1 SMA
av_get("MSFT", av_fun = "SMA", interval = "weekly", time_period = 10, series_type = "open")

# ---- 4.0 SECTOR PERFORMANCE ----

# 4.1 Sector Performance
av_get(av_fun = "SECTOR")
# }
# NOT RUN {


# }

Run the code above in your browser using DataLab