#' @title Financials as Reported
#' @description Financial as Reported by the company - annual, quarterly
#'
#' @param symbol Ticker symbol
#' @param freq Frequency - annual or quarterly
#'
#' @importFrom purrr set_names
#' @importFrom dplyr mutate_at vars
#' @importFrom lubridate ymd_hms
#'
#' @return
#' @export
#'
#' @examples
#' reported_financials('BAC', freq = 'annual')
#' reported_financials('BAC', freq = 'quarterly')
reported_financials <- function(symbol, freq = 'annual', ...){
url <- finnhub_endpoint('reported_financials')
df <- retry_get(url,
query = list(token = finnhub_key(),
symbol = symbol,
freq = freq))
df %>%
.[['data']] %>%
mutate_at(vars(startDate, endDate, filedDate, acceptedDate),
~ lubridate::ymd_hms(.x, tz = finnhub_timezone))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.