You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何创建User Agent以解决edgarwebR访问SEC EDGAR时的请求拦截问题

Fixing "EDGAR request blocked from Undeclared Automated Tool" in edgarWebR

Hey there! That error is super common when starting out with EDGAR tools—SEC requires all automated requests to include a clear User Agent so they can reach you if there's any issue with your traffic. Let's fix this quickly.

First, you need a valid User Agent string. The SEC recommends using your full name plus a working email address (this is non-negotiable for compliance). For example:
"Rachael Loh <rachael.loh@example.com>"

You have two easy ways to set this up:

1. Temporary Setup (Current R Session Only)

Run this line before your edgarWebR code to set the environment variable for your current session:

Sys.setenv(EDGARWEBR_USER_AGENT = "Your Full Name <your.email@example.com>")

Then go ahead and run your original code again:

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

2. Permanent Setup (Applies to All Future R Sessions)

If you don't want to set this every time you open R, add the environment variable to your .Rprofile file:

  • Run usethis::edit_r_profile() in R to open your profile file (install the usethis package first if you don't have it: install.packages("usethis"))
  • Add this line to the file:
    Sys.setenv(EDGARWEBR_USER_AGENT = "Your Full Name <your.email@example.com>")
    
  • Save the file and restart R. Now the User Agent will be set automatically every time you launch R.

Just make sure you use a real, reachable email—this is part of SEC's fair access guidelines, and it helps them avoid flagging your requests as suspicious.

内容的提问来源于stack exchange,提问作者Rachael Loh

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.28 15:17:41