R/company_profile2.R

Defines functions company_profile2

Documented in company_profile2

#' @title Additional information for a company
#' @description Get additional company profile information
#' 
#' @param symbol Ticker symbol for a stock
#' 
#' @importFrom dplyr bind_rows
#' @importFrom purrr set_names

#' @return
#' @export
#' 
#' @examples
#' company_profile2('BAC')
company_profile2 <- function(symbol, ...){
  
  url <- finnhub_endpoint('company_profile2')
  
  retry_get(url, 
            query = list(token = finnhub_key(),
                         symbol = symbol)) %>% 
    dplyr::bind_rows() %>%
    purrr::set_names(c('country', 'currency', 'stock_exchange', 'fh_industry',
                       'ipo', 'logo', 'market_cap', 'company_name', 'phone_number',
                       'shares_outstanding', 'symbol', 'web_url'))
}
threadingdata/finnhubr documentation built on Aug. 10, 2020, 12:48 a.m.