#' Get Historical Stock Prices from IEXTrader
#'
#' @param type (string) endpoint you want to return
#' @export
iextrader_endpoints <- function(type) {
# iextrader website
url <- "https://api.iextrading.com/1.0/"
# endpoints
endpoints <- list(
historical = "stock/'stock'/chart/5y/",
financials = "stock/'stock'/financials/",
stats = "stock/'stock'/stats/",
symbols = "ref-data/symbols/",
company = "stock/'stock'/company",
delayed_quote = "stock/'stock'/delayed-quote"
)
# identify the list index of the endpoint
x <- which(names(endpoints) == type)
# combine into the url
url <- paste(url, endpoints[x], sep = "")
return(url)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.