Lightweight R Interface to the Alpha Vantage API

Alpha Vantage has free historical financial information. All you need to do is get a free API key at <>. Then you can use the R interface to retrieve free equity information. Refer to the Alpha Vantage website for more information.


Travis-CI Build Status codecov CRAN_Status_Badge

Alpha Vantage

Alpha Vantage is a free service that enables users to get real-time and historical financial data. New users will need to visit Alpha Vantage and obtain an API key.

R Interface: Getting Started

The alphavantager package provides a convenient and lightweight interface to the Alpha Vantage API.

To get started, install the package from CRAN or from GitHub:


Load the package.


Set your API key (get one from Alpha Vantage if you don't already have one... it's free).

#> [1] "YOUR_API_KEY"

Getting Financial Data from Alpha Vantage

Now, you're ready to get financial data via av_get(), which accepts the same1 arguments as the API Documentation parameters. The function is setup with two primary arguments, symbol and av_fun, which accepts an equity and one of the API "function" parameters. You can pass additional API parameters via the ....

# Function is streamlined and user adds additional parameters via ... 
#> function (symbol = NULL, av_fun, ...) 

Here are a few examples of retrieving real-time and historical financial data!

Time Series Data

av_get(symbol = "MSFT", av_fun = "TIME_SERIES_INTRADAY", interval = "15min")

Technical Indicators

av_get(symbol = "MSFT", av_fun = "AROON", interval = "monthly", time_period = 60)

Sector Performances

av_get(av_fun = "SECTOR")

Important Notes: av_get()

  1. The av_fun argument replaces the API parameter "function" because function is a reserved name in R. All other arguments match the Alpha Vantage API parameters.

  2. There is no need to specify the apikey parameter as an argument to av_get(). The required method is to set the API key using av_api_key("YOUR_API_KEY").

  3. There is no need to specify the datatype parameter as an argument to av_get(). The function will return a tibble data frame.

  4. Some data sets only return 100 rows by default. Change the parameter outputsize = "full" to get the full dataset.


alphavantager 0.1.0

Intial release of alphavantager, a R interface to the Alpha Vantage API. Learn more at

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.1.2 by Matt Dancho, 2 years ago

Report a bug at

Browse source code at

Authors: Matt Dancho [aut, cre] , Davis Vaughan [aut]

Documentation:   PDF Manual  

GPL (>= 3) license

Imports dplyr, glue, httr, jsonlite, purrr, readr, stringr, tibble, tidyr, timetk

Suggests tidyquant, testthat, knitr

Imported by tidyquant.

See at CRAN