av_get: Get financial data from the Alpha Vantage API

Description Usage Arguments Details Value See Also Examples

View source: R/av_get.R

Description

Get financial data from the Alpha Vantage API

Usage

1
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.

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.

Value

Returns a tibble of financial data

See Also

av_api_key()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
## 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")

## End(Not run)

alphavantager documentation built on March 26, 2020, 7:49 p.m.