Hello everyone,
I used to be able to download files from the SEC using URLDownload as in
URLDownload[remoteFileName, localFile]
where, when downloading multiple files, I would throttle the loop to respect the SEC's maximum access rate of 10 requests per second. It worked like a charm. But no more. I receive denial messages instead.
The SEC allows programmatic downloading but, since I last downloaded, now requires (I'm quoting the SEC here) the declaration of my user agent in the request headers. I don't know how to do that.
The SEC's help page gives an example of what to include in the request headers.
- User-Agent: Sample Company Name AdminContact@<sample company domain>.com
- Accept-Encoding: gzip, deflate
- Host: www.sec.gov
How would I add this to URLDownload? I am doing research and am not affiliated with a company.
I tried
URLDownload[remoteFileName, localFileName,
Authentication -> <|"Username" -> "myEmailUserName@domain.com"|>]
but it did not work. Any tips would be appreciated.
Greg