Can we get financials based on CIK number?
Opened this issue · 2 comments
Is is possible to obtain financial information by CIK number? The following code is able to download the company information and annual reports but neither contrain the ticker symbol to download the financial reports
x <- "66740" # a single CIK number
library(finreportr)
library(dplyr)
AnnReps <- AnnualReports(x, foreign = FALSE)
CompInf <- CompanyInfo(x)
The following returns an error:
BS <- GetBalanceSheet(CompInf$CIK, 2016)
GetBalanceSheet(AnnReps$accession.no[3], 2017)
I see in the functions that you deal a lot with the CIK numbers, how do you link the CIK with the ticker symbol?
any updates, would love to have this library be more flexible with cik number vs symbol.
seen from http://rankandfiled.com/#/data/tickers vs https://www.sec.gov/Archives/edgar/cik-lookup-data.txt many cik's don't have symbols...
I've been browsing finreportr
source code. It is actually possible to use these functions with the CIK.
Try, for instance, AnnualReports("0001652044")
.
The reason you were unable to successfully query is because you need to pass in the CIK as a 10 character string. If you pass in the numeric CIK it will fail.
Helper code to obtain the right format:
stringr::str_pad(as.character(1234), 10, "left", "0")