Search code examples
redgar

How to create user agent?


I'm trying out this function from the package edgarwebR

x <- paste0("https://www.sec.gov/Archives/edgar/data/",
            "933691/000119312517247698/0001193125-17-247698-index.htm")
try(filing_information(x))

But it returns me the following

No encoding supplied: defaulting to UTF-8.
Error in check_result(res) : 
  EDGAR request blocked from Undeclared Automated Tool.
Please visit https://www.sec.gov/developer for best practices.
See https://mwaldstein.github.io/edgarWebR/index.html#ethical-use--fair-access for your responsibilities
Consider also setting the environment variable 'EDGARWEBR_USER_AGENT

So I went to SEC and the information tells me to declare my user agent in the request headers. I'm new to this. How do I create a user agent?


Solution

  • I use the edgar package so I'm not sure this is helpful. But this is how I would do it using edgar package

    library("edgar")    
    useragent = "Your Name [email protected]"
    info <- getFilingInfo('933691', 2021, quarter = c(1,2,3,4), form.type = 'ALL', useragent)