sfa_get_statement: Get basic company information

View source: R/sfa_get_statement.R

sfa_get_statementR Documentation

Get basic company information

Description

Fundamentals and derived figures can be retrieved here.

Usage

sfa_get_statement(
  ticker = NULL,
  simfin_id = NULL,
  statement,
  period = "fy",
  fyear = NULL,
  start = NULL,
  end = NULL,
  ttm = FALSE,
  shares = FALSE,
  api_key = getOption("sfa_api_key"),
  cache_dir = getOption("sfa_cache_dir"),
  sfplus = getOption("sfa_sfplus", default = FALSE)
)

Arguments

ticker

integer Ticker of the companies of interest.

simfin_id

integer 'SimFin' IDs of the companies of interest. Any simfin_id will be internally translated to the respective ticker. This reduces the number of queries in case you query the same company via ticker and simfin_id.

statement

character Statement to be retrieved. One of

  • "pl": Profit & Loss statement

  • "bs": Balance Sheet

  • "cf": Cash Flow statement

  • "derived": Derived figures & fundamental ratios

  • "all": Retrieves all 3 statements + ratios. Please note that this option is reserved for SimFin+ users.

period

character Filter for periods. As a non-SimFin+ user, you have to provide exactly one period. As SimFin+ user, this filter can be omitted to retrieve all statements available for the company.

  • "q1": First fiscal quarter.

  • "q2": Second fiscal quarter.

  • "q3": Third fiscal quarter.

  • "q4": Fourth fiscal quarter.

  • "fy": Full fiscal year.

  • "h1": First 6 months of fiscal year.

  • "h2": Last 6 months of fiscal year.

  • "9m": First nine months of fiscal year.

  • "6m": Any fiscal 6 month period (first + second half years; reserved for SimFin+ users).

  • "quarters": All quarters (q1 + q2 + q3 + q4; reserved for SimFin+ users).

fyear

integer Filter for fiscal year. As a non-SimFin+ user, you have to provide exactly one fiscal year. As SimFin+ user, this filter can be omitted to retrieve all data available for the company.

start

Date Filter for the report dates (reserved for SimFin+ users). With this filter you can filter the statements by the date on which the reported period ended ('Report Date'). By specifying a value here, only statements will be retrieved with report dates ending AFTER the specified date.

end

Date Filter for the report dates (reserved for SimFin+ users). With this filter you can filter the statements by the date on which the reported period ended ('Report Date'). By specifying a value here, only statements will be retrieved with report dates ending BEFORE the specified date.

ttm

logical If TRUE, you can return the trailing twelve months statements for all periods, meaning at every available point in time the sum of the last 4 available quarterly figures.

shares

logical If TRUE, you can display the weighted average basic & diluted shares outstanding for each period along with the fundamentals. Reserved for SimFin+ users (as non-SimFin+ user, you can still use the shares outstanding endpoints).

api_key

character Your 'SimFin' API key. It's recommended to set the API key globally using sfa_set_api_key.

cache_dir

character Your cache directory. It's recommended to set the cache directory globally using sfa_set_cache_dir.

sfplus

logical SetTRUE if you have a SimFin+ account. It's recommended to set sfplus globally using sfa_set_sfplus.

Value

data.table containing the statement(s) data.

Parallel processing

This function supports parallel processing via future.apply. If your machine has several cores (most have), you can make the API calls in parallel. To do so, define a future::plan() before calling the function.


simfinapi documentation built on April 14, 2023, 12:27 a.m.