R/company_profile.R

Defines functions company_profile

Documented in company_profile

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

#' @return
#' @export
#' 
#' @examples
#' company_profile('BAC')
company_profile <- function(symbol, ...){
  
  url <- finnhub_endpoint('company_profile')
  
  retry_get(url, 
            query = list(token = finnhub_key(),
                         symbol = symbol)) %>% 
    dplyr::bind_rows() %>%
    purrr::set_names(c('address', 'city', 'country', 'currency',
                       'cusip', 'company_description', 'employees',
                       'stock_exchange', 'fh_industry', 'g_group',
                       'g_industry', 'g_sector', 'g_sub_industry',
                       'ipo', 'isin', 'logo', 'market_cap', 'naics',
                       'naics_industry', 'naics_sector',
                       'naics_sub_sector', 'company_name', 'phone_number',
                       'sedol', 'shares_outstanding', 'state', 'symbol',
                       'web_url'))
}
#
threadingdata/finnhubr documentation built on Aug. 10, 2020, 12:48 a.m.