#' @title ETF Profile
#' @description Get exchange traded fund profile
#'
#' @param etf ETF ticker - SPY, XLK, IYW
#'
#' @importFrom tibble tibble
#' @importFrom dplyr bind_cols mutate
#' @importFrom lubridate now
#'
#' @return
#' @export
#'
#' @examples
#' etf_profile('SPY')
#' etf_profile('XLK')
#' etf_profile('IYW')
etf_profile <- function(etf, ...){
url <- finnhub_endpoint('etfs_profile')
df <- retry_get(url,
query = list(token = finnhub_key(),
symbol = etf))
df %>%
.[['profile']] %>%
dplyr::bind_cols() %>%
tibble::tibble(etf, .) %>%
mutate(query_date = lubridate::now())
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.