I’m trying to figure out how to fix some error messages in R while using edgar
package to download filings by following this post.
Code:
ua <- "Name [email protected]" #declare user-agent
business_desc <- getBusinDescr(cik.no =
c(12345, 123456, 1234567), #cik examples
filing.year = c(2010, 2011), ua
)
Error message:
Error in getBusinDescr(cik.no = c(12345, 123456, 123456, :
unused argument (ua)
It seems that the user-agent argument is no longer supported in getBusinDescr
In addition, when I did not include the user-agent into the code, I got another error message,
No filing information found for given CIK(s) and Form Type in the mentioned year(s)/quarter(s). No annual statements found for given CIK(s) and year(s).
After checking some other posts, I tried to set the user-agent and re-run the code again,
request("www.sec.gov") |>
req_user_agent("Name [email protected]") |>
req_perform()
business_desc <- getBusinDescr(cik.no =
c(12345, 123456, 1234567), #cik examples
filing.year = c(2010, 2011)
)
However, it did not work.
References: This is the requirements from the SEC (link)
Please declare your user agent in request headers:
Sample Declared Bot Request Headers:
-
User-Agent:Sample Company Name AdminContact@<sample company domain>.com
-
Accept-Encoding:gzip, deflate
-
Host:www.sec.gov