# We jump through these hoops to make sure we're re-using the same cache path cache.path = if (file.exists(file.path(getwd(),"docs"))) { file.path(getwd(),"docs","README_cache/") } else { file.path(getwd(),"README_cache/") } knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-", cache.path = cache.path ) library(edgarWebR)
edgarWebR provides an interface to access the SEC's EDGAR system for company financial filings.
edgarWebR does not provide any functionality to extract financial data or other information from filings, only the metadata and company information. For processing of the financial data.
Because of abusive use of this library, the SEC is likely to block its use "as is" without setting a custom 'User Agent' identifier. Details for setting a custom agent are below.
Users of this library are required to follow the SEC's Privacy and Security Policy. Failure to follow that guidance may result in having your requests blocked. Per the SEC's Developer Resources:
To ensure that everyone has equitable access to SEC EDGAR content, please use efficient scripting, downloading only what you need and please moderate requests to minimize server load. Current guidelines limit each user to a total of no more than 10 requests per second, regardless of the number of machines used to submit requests.
To ensure that SEC.gov remains available to all users, we reserve the right to block IP addresses that submit excessive requests. The SEC does not allow "unclassified" bots or automated tools to crawl the site. Any request that has been identified as part of an unclassified bot or an automated tool outside of the acceptable policy will be managed to ensure fair access for all users.
Users of this library are advised to set a custom user-agent by setting the
environment variable EDGARWEBR_USER_AGENT
.
The EDGAR System provides a number of tools for filing and entity lookup and examination. As of v1.0, edgarWebR supports all public search and browse interfaces.
Search Interfaces:
| Tool | URL | edgarWebR function(s) |
|-------------------------------|-----------------------------------------------------------------|-----------------------|
| Company | https://www.sec.gov/edgar/searchedgar/companysearch.html | company_search()
, company_information()
, company_details()
, company_filings()
|
| Recent Filings | https://www.sec.gov/cgi-bin/browse-edgar?action=getcurrent | latest_filings()
|
| Full Text | https://www.sec.gov/edgar/search/ | full_text()
|
| Header Search | https://www.sec.gov/cgi-bin/srch-edgar | header_search()
|
| Fund Disclosures | https://www.sec.gov/edgar/searchedgar/prospectus.htm | Use company_search()
and specify the 'type' parameter as 485 |
| Fund Voting Records | https://www.sec.gov/edgar/searchedgar/n-px.htm | Use company_search()
and specify the 'type' parameter as 'N-PX' |
| Fund Search | https://www.sec.gov/edgar/searchedgar/mutualsearch.html | fund_search()
, fund_fast_search()
|
| Var. Insurance Products | https://www.sec.gov/edgar/searchedgar/vinsurancesearch.html | variable_insurance_search()
, variable_insurance_fast_search()
|
| Confidential treatment orders | https://www.sec.gov/edgar/searchedgar/ctorders.htm | Use header_search()
, company_search()
, latest_filings()
, or full_text()
and use form types 'CT ORDER'|
| Effectiveness notices | https://www.sec.gov/cgi-bin/browse-edgar?action=geteffect | effectiveness()
|
| CIK | https://www.sec.gov/edgar/searchedgar/cik.htm | cik_search()
|
| Daily Filings | https://www.sec.gov/edgar/searchedgar/currentevents.htm | current_events()
|
| Correspondence | https://www.sec.gov/answers/edgarletters.htm | Use header_search()
, company_search()
, latest_filings()
, or full_text()
and use form types 'upload' or 'corresp'|
Once a filing is found via any of the above, there are a number of functions to process the result -
filing_documents()
filing_filers()
filing_funds()
filing_information()
filing_details()
- returns all 4 of the filing components in a list.While edgarWebR is primarily focused on providing an interface to the online SEC tools, there are a few activities for handling filing documents for which no current tools exist.
parse_submission()
- takes a full submission SGML document and parses out
component documents. Most of the time, the documents of interest in a
particular submission will be online and accessible via
filing_documents()
- this function is to unpack the raw submission to get
all the documents. You may also find it more efficient if you're regularly
downloading all of the files in a given submission.parse_filing()
- Takes a HTML narrative filing and annotates each
paragraph with item and part numbers.There is one dataset provided with edgarWebR - sic_codes
, providing a
catalog of SIC codes and their hierarchy.
There are also a number of utility functions to help construct useful URL's once you have a company CIK, submission accession number or specific file.
company_href()
for linking to the company pagesubmission_index_href()
and its family of related functions for linking
to a specific submission and file.edgarWebR is available from CRAN, so can be simply installed via
install.packages("edgarWebR")
To install the development version,
# Install the development version from GitHub: # install.packages("devtools") devtools::install_github("mwaldstein/edgarWebR")
company_filings("AAPL", type = "10-K", count = 10)
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. Report violations to (micah@waldste.in).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.