Giter VIP home page Giter VIP logo

finreportr's Introduction

Travis-CI Build Status CRAN_Status_Badge DOI status

finreportr - Financial Data from U.S. Securities and Exchange Commission

Introduction

A financial analyst's time is valuable – it shouldn't be wasted performing manual data entry. finreportr is a web scraper written in R that allows analysts to query data from the U.S. Securities and Exchange Commission directly from the R console. It aims to eliminate time wasters from a financial analyst's workflow, such as navigating the SEC EDGAR database, flipping through financial reports, and parsing XBRL-encoded data.

finreportr allows you to fetch data from the SEC and load it into your workspace using the following commands:

  • CompanyInfo(): returns basic information about a company
  • AnnualReports(): returns a listing of annual reports filed by a company
  • GetIncome(): returns the income statement for a given company
  • GetBalanceSheet(): returns the balance sheet for a given company
  • GetCashFlow(): returns the cash flow statement for a given company

To install CRAN release version of finreportr:

install.packages("finreportr")

To install bleeding-edge version from GitHub:

devtools::install_github("sewardlee337/finreportr")

CompanyInfo()

CompanyInfo() returns the following information about a given company based on its stock ticker symbol:

Arguments:

CompanyInfo(symbol)

where

  • symbol is a character string that represents the relevant stock ticker symbol.

Examples:

> CompanyInfo("GOOG")

      company        CIK  SIC state state.inc FY.end            street.address             city.state
1 GOOGLE INC. 0001288776 7370    CA        DE   1231 1600 AMPHITHEATRE PARKWAY MOUNTAIN VIEW CA 94043


> CompanyInfo("FB")

       company        CIK  SIC state state.inc FY.end   street.address          city.state
1 Facebook Inc 0001326801 7370    CA        DE   1231 1601 WILLOW ROAD MENLO PARK CA 94025

AnnualReports()

AnnualReports() returns a dataframe that summarizes a given company's annual reports based on its stock ticker symbol. Information returned include:

  • Filing Name
  • Filing Date
  • Accession Number

AnnualReports() will return data relating to a company's Form 10-Ks if the company is domestic, and Form 20-Fs if the company is foreign.

Arguments:

AnnualReports(symbol, foreign = FALSE)

where

  • symbol is a character string that represents the relevant stock ticker symbol.
  • foreign is a logical indicating whether the company in question is domestic or foreign. foreign is set to FALSE by default.

Examples:

> AnnualReports("GOOG")

   filing.name filing.date         accession.no
1         10-K  2015-02-09 0001288776-15-000008
2         10-K  2014-02-12 0001288776-14-000020
3         10-K  2013-01-29 0001193125-13-028362
4       10-K/A  2012-04-23 0001193125-12-174477
5         10-K  2012-01-26 0001193125-12-025336
6         10-K  2011-02-11 0001193125-11-032930
7         10-K  2010-02-12 0001193125-10-030774
8         10-K  2009-02-13 0001193125-09-029448
9         10-K  2008-02-15 0001193125-08-032690
10        10-K  2007-03-01 0001193125-07-044494
11        10-K  2006-03-16 0001193125-06-056598
12        10-K  2005-03-30 0001193125-05-065298


> AnnualReports("HTHIY", foreign = TRUE)

   filing.name filing.date         accession.no
1       20-F/A  2011-07-21 0001193125-11-192990
2         20-F  2011-06-24 0001193125-11-172867
3       20-F/A  2010-07-29 0001193125-10-169851
4         20-F  2010-06-29 0001193125-10-149406
5         20-F  2009-07-27 0001193125-09-155317
6         20-F  2008-06-20 0001193125-08-137042
7       20-F/A  2008-04-28 0001193125-08-091853
8       20-F/A  2007-11-30 0001193125-07-256746
9         20-F  2007-06-26 0001193125-07-142357
10        20-F  2006-08-07 0001193125-06-163031
11        20-F  2005-08-26 0001193125-05-174960
12        20-F  2004-08-20 0001193125-04-144223
13        20-F  2003-09-30 0001193125-03-056135
14        20-F  2002-09-26 0001145549-02-000252

GetIncome()

GetIncome() returns a company's income statement from the annual report of a given filing year as a dataframe. This functionality is only available for queries of income statements that belong to domestic companies. Note that all data returned by this function comes from the company's 10-K, not 10-K/A.

Arguments:

GetIncome(symbol, year)

where

  • symbol is a character string that represents the relevant stock ticker symbol.
  • year is the year during which the annual report was filed. (Note: This is not necessarily identical to the fiscal year for which the annual report was filed)

Example:

###   Fetch first 20 lines of Google's income statement in the Form 10-K published in 2016.

> head(GetIncome("GOOG", 2016), 20)

                               Metric Units      Amount  startDate    endDate
1                            Revenues   usd 55519000000 2013-01-01 2013-12-31
2                            Revenues   usd 66001000000 2014-01-01 2014-12-31
3                            Revenues   usd 74989000000 2015-01-01 2015-12-31
4                     Cost of Revenue   usd 21993000000 2013-01-01 2013-12-31
5                     Cost of Revenue   usd 25691000000 2014-01-01 2014-12-31
6                     Cost of Revenue   usd 28164000000 2015-01-01 2015-12-31
7    Research and Development Expense   usd  7137000000 2013-01-01 2013-12-31
8    Research and Development Expense   usd  9832000000 2014-01-01 2014-12-31
9    Research and Development Expense   usd 12282000000 2015-01-01 2015-12-31
10      Selling and Marketing Expense   usd  6554000000 2013-01-01 2013-12-31
11      Selling and Marketing Expense   usd  8131000000 2014-01-01 2014-12-31
12      Selling and Marketing Expense   usd  9047000000 2015-01-01 2015-12-31
13 General and Administrative Expense   usd  4432000000 2013-01-01 2013-12-31
14 General and Administrative Expense   usd  5851000000 2014-01-01 2014-12-31
15 General and Administrative Expense   usd  6136000000 2015-01-01 2015-12-31
16                 Costs and Expenses   usd 40116000000 2013-01-01 2013-12-31
17                 Costs and Expenses   usd 49505000000 2014-01-01 2014-12-31
18                 Costs and Expenses   usd 55629000000 2015-01-01 2015-12-31
19            Operating Income (Loss)   usd 15403000000 2013-01-01 2013-12-31
20            Operating Income (Loss)   usd 16496000000 2014-01-01 2014-12-31

GetBalanceSheet()

GetBalanceSheet() returns a company's balance sheet from the annual report of a given filing year as a dataframe. This functionality is only available for queries of balance sheets that belong to domestic companies. Note that all data returned by this function comes from the company's 10-K, not 10-K/A.

Arguments:

GetBalanceSheet(symbol, year)

where

  • symbol is a character string that represents the relevant stock ticker symbol.
  • year is the year during which the annual report was filed. (Note: This is not necessarily identical to the fiscal year for which the annual report was filed)

Example:

###   Fetch first 20 lines of Google's balance sheet in the Form 10-K published in 2016.

> head(GetBalanceSheet("GOOG", 2016), 20)

                                                       Metric Units      Amount startDate    endDate
1                Cash and Cash Equivalents, at Carrying Value   usd 14778000000      <NA> 2012-12-31
2                Cash and Cash Equivalents, at Carrying Value   usd 18898000000      <NA> 2013-12-31
3                Cash and Cash Equivalents, at Carrying Value   usd 18347000000      <NA> 2014-12-31
4                Cash and Cash Equivalents, at Carrying Value   usd 16549000000      <NA> 2015-12-31
5                      Available-for-sale Securities, Current   usd 46048000000      <NA> 2014-12-31
6                      Available-for-sale Securities, Current   usd 56517000000      <NA> 2015-12-31
7          Cash, Cash Equivalents, and Short-term Investments   usd 64395000000      <NA> 2014-12-31
8          Cash, Cash Equivalents, and Short-term Investments   usd 73066000000      <NA> 2015-12-31
9                           Accounts Receivable, Net, Current   usd  9383000000      <NA> 2014-12-31
10                          Accounts Receivable, Net, Current   usd 11556000000      <NA> 2015-12-31
11             Receivable Under Reverse Repurchase Agreements   usd   875000000      <NA> 2014-12-31
12             Receivable Under Reverse Repurchase Agreements   usd   450000000      <NA> 2015-12-31
13                           Income Taxes Receivable, Current   usd   591000000      <NA> 2014-12-31
14                           Income Taxes Receivable, Current   usd  1903000000      <NA> 2015-12-31
15    Prepaid Revenue Share Expenses And Other Assets Current   usd  3412000000      <NA> 2014-12-31
16    Prepaid Revenue Share Expenses And Other Assets Current   usd  3139000000      <NA> 2015-12-31
17                                            Assets, Current   usd 78656000000      <NA> 2014-12-31
18                                            Assets, Current   usd 90114000000      <NA> 2015-12-31
19 Prepaid Revenue Share Expenses And Other Assets Noncurrent   usd  3187000000      <NA> 2014-12-31
20 Prepaid Revenue Share Expenses And Other Assets Noncurrent   usd  3181000000      <NA> 2015-12-31

GetCashFlow()

GetCashFlow() returns a company's statement of cash flow from the annual report of a given filing year as a dataframe. This functionality is only available for queries of cash flow statements that belong to domestic companies. Note that all data returned by this function comes from the company's 10-K, not 10-K/A.

Arguments:

GetCashFlow(symbol, year)

where

  • symbol is a character string that represents the relevant stock ticker symbol.
  • year is the year during which the annual report was filed. (Note: This is not necessarily identical to the fiscal year for which the annual report was filed)

Example:

###   Fetch first 20 lines of Google's cash flow statement in the Form 10-K published in 2016.

> head(GetCashFlow("GOOG", 2016), 20)

                                                                   Metric Units      Amount  startDate    endDate
1                                Net Income (Loss) Attributable to Parent   usd 12733000000 2013-01-01 2013-12-31
2                                Net Income (Loss) Attributable to Parent   usd 14136000000 2014-01-01 2014-12-31
3                                Net Income (Loss) Attributable to Parent   usd 16348000000 2015-01-01 2015-12-31
4    Depreciation and Impairment on Disposition of Property and Equipment   usd  2781000000 2013-01-01 2013-12-31
5    Depreciation and Impairment on Disposition of Property and Equipment   usd  3523000000 2014-01-01 2014-12-31
6    Depreciation and Impairment on Disposition of Property and Equipment   usd  4132000000 2015-01-01 2015-12-31
7              Amortization and Impairment of Intangible and Other Assets   usd  1158000000 2013-01-01 2013-12-31
8              Amortization and Impairment of Intangible and Other Assets   usd  1456000000 2014-01-01 2014-12-31
9              Amortization and Impairment of Intangible and Other Assets   usd   931000000 2015-01-01 2015-12-31
10                                               Share-based Compensation   usd  3343000000 2013-01-01 2013-12-31
11                                               Share-based Compensation   usd  4279000000 2014-01-01 2014-12-31
12                                               Share-based Compensation   usd  5203000000 2015-01-01 2015-12-31
13 Excess Tax Benefit from Share-based Compensation, Operating Activities   usd   481000000 2013-01-01 2013-12-31
14 Excess Tax Benefit from Share-based Compensation, Operating Activities   usd   648000000 2014-01-01 2014-12-31
15 Excess Tax Benefit from Share-based Compensation, Operating Activities   usd   548000000 2015-01-01 2015-12-31
16                                  Deferred Income Taxes and Tax Credits   usd  -437000000 2013-01-01 2013-12-31
17                                  Deferred Income Taxes and Tax Credits   usd  -104000000 2014-01-01 2014-12-31
18                                  Deferred Income Taxes and Tax Credits   usd  -179000000 2015-01-01 2015-12-31
19     Gain (Loss) on Sale of Business, Including Discontinued Operations   usd   700000000 2013-01-01 2013-12-31
20     Gain (Loss) on Sale of Business, Including Discontinued Operations   usd   740000000 2014-01-01 2014-12-31

Bug Reports and Feedback

Please use the GitHub issue tracker for bug reports, feature request, or general discussions.

finreportr's People

Contributors

sewardlee337 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

finreportr's Issues

Error: Cannot Open URL

Trying to follow along the book "Processing and Analyzing Financial Data with R" by
Marcelo S. Perlin , Ch.7.
Similar errors ("error in download.file") occur for functions GetBalanceSheet and GetCashFlow.

image

Error Received in Certain Ticker Symbols

When I try to run GetIncome("CAT", 2016)

I receive the following error: Error in filter_impl(.data, quo) : Result must have length 1855, not 0

Here is the output from sessionInfo()

R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] bindrcpp_0.2     xml2_1.2.0       curl_3.1         XBRL_0.99.18     finreportr_1.0.1

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.13     XML_3.98-1.9     dplyr_0.7.4      assertthat_0.2.0 R6_2.2.2         magrittr_1.5     httr_1.3.1       stringi_1.1.5   
 [9] rlang_0.1.4      tools_3.4.1      stringr_1.2.0    selectr_0.3-1    glue_1.2.0       yaml_2.1.14      compiler_3.4.1   pkgconfig_2.0.1 
[17] rvest_0.3.2      knitr_1.17       bindr_0.1        tibble_1.3.4 

I've tried successfully with a few other symbols (i.e., AAPL), but can't seem to get it to work consistently. Also, this is my first bug report, so please let me know if you need any other information.

High latency to fetch data

It's now taking several seconds to return financials. For instance, the call below took over 8 seconds to return results. It's now causing RStudio to crash.

head(GetIncome("GOOG", 2016), 20)

This seems to be a new issue as I was not observing this behavior 2 days ago.

Cannot Open URL

No finreportr functions work when year = 2019. Have tested on multiple companies and multiple years, problem is not company specific and only exists when year = 2019.

GetBalanceSheet('GOOG', 2019)

Error in fileFromCache(file) : Error in download.file(file, cached.file, quiet = !verbose) : cannot open URL 'https://www.sec.gov/Archives/edgar/data/1652044/000165204419000004/https://xbrl.sec.gov/dei/2018/dei-2018-01-31.xsd'

Session Info:

R version 3.6.0 (2019-04-26)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)

Matrix products: default

Random number generation:
 RNG:     Mersenne-Twister 
 Normal:  Inversion 
 Sample:  Rounding 
 
locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] forcats_0.4.0    stringr_1.4.0    dplyr_0.8.1      purrr_0.3.2      readr_1.3.1      tidyr_0.8.3      tibble_2.1.3     ggplot2_3.1.1   
 [9] tidyverse_1.2.1  finreportr_1.0.1 lubridate_1.7.4  rvest_0.3.4      xml2_1.2.0       edgar_2.0.1     

loaded via a namespace (and not attached):
 [1] tidyselect_0.2.5  xfun_0.7          slam_0.1-45       NLP_0.2-0         haven_2.1.0       lattice_0.20-38   colorspace_1.4-1 
 [8] generics_0.0.2    yaml_2.2.0        XML_3.98-1.20     rlang_0.3.4       R.oo_1.22.0       pillar_1.4.1      withr_2.1.2      
[15] glue_1.3.1        R.utils_2.8.0     selectr_0.4-1     readxl_1.3.1      modelr_0.1.4      plyr_1.8.4        cellranger_1.1.0 
[22] munsell_0.5.0     gtable_0.3.0      R.methodsS3_1.7.1 XBRL_0.99.18      qdapRegex_0.7.2   knitr_1.23        tm_0.7-6         
[29] parallel_3.6.0    curl_3.3          broom_0.5.2       Rcpp_1.0.1        backports_1.1.4   scales_1.0.0      jsonlite_1.6     
[36] hms_0.4.2         stringi_1.4.3     grid_3.6.0        cli_1.1.0         tools_3.6.0       magrittr_1.5      lazyeval_0.2.2   
[43] crayon_1.3.4      pkgconfig_2.0.2   assertthat_0.2.1  httr_1.4.0        rstudioapi_0.10   R6_2.4.0          nlme_3.1-139     
[50] compiler_3.6.0   

Error Parsing UNF's report from 2012 q1

Hello when parsing UNF (CIK 717954) q1 report from 2012.
Link to SEC XBRL
I am getting the following error:
Error in eval(substitute(expr), envir, enclos) : expecting a single value

xbrl_url_unf2012 <- "...../UNF/2012/q1/xbrl/unf-20111126.xml"
old_o <- options(stringsAsFactors = FALSE)
xbrl_data_unf2012 <- xbrlDoAll(xbrl_url_unf2012, verbose = TRUE)
options(old_o)
statement <- xbrl_get_statements(xbrl_data_unf2012)

NOTE: this also fails on their 2013 reports but not their 2014 reports (could be malformed xbrl, but sadly I don't know enough about the format to be sure??)

Can we get financials based on CIK number?

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?

Error in filter_impl(.data, dots) : basic_string::resize

GetIncome("MSFT", 2016)
Error in filter_impl(.data, dots) : basic_string::resize

head(GetIncome("AMZN", 2016),5)
Metric Units Amount startDate endDate
1 Sales Revenue, Goods, Net usd 60903000000 2013-01-01 2013-12-31
2 Sales Revenue, Goods, Net usd 70080000000 2014-01-01 2014-12-31
3 Sales Revenue, Goods, Net usd 79268000000 2015-01-01 2015-12-31
4 Sales Revenue, Services, Net usd 13549000000 2013-01-01 2013-12-31
5 Sales Revenue, Services, Net usd 18908000000 2014-01-01 2014-12-31

Could not resolve host

Once in many try it does go through the request and get's me the data. The rest of the time I get the error
AnnualReports("AAPL") on any ticker I get this in the console:

Error in open.connection(x, "rb") : Could not resolve host: www.sec.gov

The problem is not just present with the function AnnualReports(), but also with all the others

I read there that it could be because sec.gov try to se if i'm a bot. (https://stackoverflow.com/questions/33295686/rvest-error-in-open-connectionx-rb-timeout-was-reached)

sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.6
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] bindrcpp_0.2 finreportr_1.0.1
loaded via a namespace (and not attached):
[1] Rcpp_0.12.12 dplyr_0.7.3 assertthat_0.2.0 XBRL_0.99.18 R6_2.2.2 magrittr_1.5
[7] httr_1.3.1 stringi_1.1.5 rlang_0.1.2.9000 curl_2.8.1 xml2_1.1.1 tools_3.4.1
[13] stringr_1.2.0 selectr_0.3-1 glue_1.1.1 compiler_3.4.1 pkgconfig_2.0.1 rvest_0.3.2
[19] bindr_0.1 tibble_1.3.4

Timeout was Reached

Receiving the below error when trying to pull IS/BS/CF. I am at work and that is the cause of the issue. Was wondering if there was a known work around? I am able to install/update packages directly from CRAN so it is possible to connect via R. I attempted via a proxy but to no avail.

> GetIncome("FB", 2016)
Error in open.connection(x, "rb") :
Timeout was reached: Connection timed out after 10015 milliseconds

Reports until 2018 are available, those of 2019 & 2020 are not

After successfully reading SEC financial data until 2018 inclusive, my attemps to read 2019 & 2020 fail.

I get the following message:

_> GetIncome("NVDA", 2019)
Error in fileFromCache(file) :
Error in download.file(file, cached.file, quiet = !verbose) :
no fue posible abrir la URL -> it was not possible to open URL 'https://www.sec.gov/Archives/edgar/data/1045810/000104581019000023/https://xbrl.sec.gov/dei/2018/dei-2018-01-31.xsd'

Además: Warning message:
In download.file(file, cached.file, quiet = !verbose) :
cannot open URL 'https://www.sec.gov/Archives/edgar/data/1045810/000104581019000023/https://xbrl.sec.gov/dei/2018/dei-2018-01-31.xsd': HTTP status was '404 Not Found'_

Reports for 2019 & 2020 (and 2021) are available

AnnualReports(symbol = "NVDA", foreign = FALSE)
filing.name filing.date accession.no
1 10-K 2021-02-26 0001045810-21-000010
2 10-K 2020-02-20 0001045810-20-000010
3 10-K 2019-02-21 0001045810-19-000023
4 10-K 2018-02-28 0001045810-18-000010
5 10-K 2017-03-01 0001045810-17-000027
6 10-K 2016-03-17 0001045810-16-000205
7 10-K 2015-03-12 0001045810-15-000036
8 10-K 2014-03-13 0001045810-14-000030
9 10-K 2013-03-12 0001045810-13-000008
10 10-K 2012-03-13 0001045810-12-000013
11 10-K 2011-03-16 0001045810-11-000015
12 10-K 2010-03-18 0001045810-10-000006
13 10-K 2009-03-13 0001045810-09-000013
14 10-K 2008-03-21 0001045810-08-000011
15 10-K 2007-03-16 0001045810-07-000008
16 10-K/A 2006-11-29 0001193125-06-243224
17 10-K 2006-03-16 0001045810-06-000014
18 10-K 2005-03-22 0001045810-05-000008
19 10-K/A 2004-05-20 0001045810-04-000014
20 10-K 2004-03-29 0001045810-04-000007
21 10-K 2003-04-25 0001045969-03-001196
22 10-K 2002-05-14 0001012870-02-002262
23 10-K405/A 2001-05-25 0001012870-01-501023
24 10-K405 2001-04-27 0001012870-01-500492
25 10-K405 2000-03-13 0001012870-00-001346
26 10-K405 1999-04-29 0000929624-99-000772

However, I think there might be a problem with a date, since finreportr is trying to find a file whose date "2018-01-31.xsd" it's unavaible to find.

Is it possible that there might be a problem with the dates?

And congratulations for the package, it can be very useful.

VS

Cannot Open URL, HTTP status was '403 Forbidden'

Hi,

I have been able to download Data for some years and not others. I continue to get the same error with older data. I know that the package can see the data that I want because I get a full list of 10Ks with the Annual Reports Function.

`library(quantmod)
library(finreportr)

CompanyInfo("BAC")
AnnualReports("BAC")
BAC.BS.2017 <- GetBalanceSheet("BAC",2017)
BAC.BS.2015 <- GetBalanceSheet("BAC",2015)
BAC.BS.2014 <- GetBalanceSheet("BAC",2014)
BAC.BS.2012 <- GetBalanceSheet("BAC",2012)
BAC.BS.2005 <- GetBalanceSheet("BAC",2005)
`
when i try to get the 2005 data I get the following error

`> BAC.BS.2005 <- GetBalanceSheet("BAC",2005)
Error in fileFromCache(file.inst) :
Error in download.file(file, cached.file, quiet = !verbose) :
cannot open URL 'https://www.sec.gov/Archives/edgar/data/70858/000119312505039878/bac-20041231.xml'

In addition: Warning message:
In download.file(file, cached.file, quiet = !verbose) :
cannot open URL 'https://www.sec.gov/Archives/edgar/data/70858/000119312505039878/bac-20041231.xml': HTTP status was '403 Forbidden'`

Additionally, is there any way to make the same Balance Sheet call from the accession numbers generated by the AnnualReports function?

Thanks in advance for your help

could not find function "xpath_class"

Following errors were produced when execute provided functions

Error in do.call(method, list(parsed_selector)) :
could not find function "xpath_class"

or

Error in do.call(method, list(parsed_selector)) :
could not find function "xpath_combinedselector"

errow with 2019 reports

hello
when working in r with the following function, i get an error

> TSLA.inc <- GetIncome("TSLA", 2019)
Error in fileFromCache(file) : 
  Error in download.file(file, cached.file, quiet = !verbose) : 
  cannot open URL 'https://www.sec.gov/Archives/edgar/data/1318605/000156459019003165/https://xbrl.sec.gov/dei/2018/dei-2018-01-31.xsd'

when trying to retrieve the same data from a different year, it does work

> TSLA.inc <- GetIncome("TSLA", 2018)
> head(TSLA.inc)
                                           Metric        Units     Amount  startDate    endDate
1                         Sales Revenue Goods Net U_iso4217USD 3431587000 2015-01-01 2015-12-31
2                         Sales Revenue Goods Net U_iso4217USD 5589007000 2016-01-01 2016-12-31
3                         Sales Revenue Goods Net U_iso4217USD 8534752000 2017-01-01 2017-12-31
4 Operating Leases Income Statement Lease Revenue U_iso4217USD  309386000 2015-01-01 2015-12-31
5 Operating Leases Income Statement Lease Revenue U_iso4217USD  761759000 2016-01-01 2016-12-31
6 Operating Leases Income Statement Lease Revenue U_iso4217USD 1106548000 2017-01-01 2017-12-31

HTTP error 403

Hello,

I am getting a 403 error when attempting the following

`> GetIncome("FB", 2016)
Error in fileFromCache(file) :
Error in download.file(file, cached.file, quiet = !verbose) :
cannot open URL 'https://www.sec.gov/Archives/edgar/data/1326801/000132680116000043/fb-20151231.xsd'

In addition: Warning message:
In download.file(file, cached.file, quiet = !verbose) :
cannot open URL 'https://www.sec.gov/Archives/edgar/data/1326801/000132680116000043/fb-20151231.xsd': HTTP status was '403 Forbidden'`

Do the source links need updating? Thank you!

No filings available for given year

My run of the example README.md code for GetIncome, GetBalanceSheet, and GetCashFlow
does not produce the expected output. For example, running GetIncome("GOOG", 2015) produces:

Error in GetAccessionNo(symbol, year, foreign = FALSE) :
no filings available for given year

openjournals/joss-reviews#119

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.