edgar — retrieving, parsing, and mining SEC EDGAR filings at scaleWith a background in programming, I've always been drawn to the intersection of code and finance — particularly text mining in corporate finance research. A large part of my published work relies on large-scale textual analysis of corporate filings, and I'm increasingly interested in combining text mining with AI to extract richer signals from financial disclosures.
To make this kind of research more accessible, I built edgar, an open-source R package that lets researchers, students, and analysts download and scrape financial statements directly from the SEC's EDGAR database — no manual downloading required. Below is the full functionality of the package; the GitHub repository has detailed documentation, installation instructions, and code examples.
getDailyMaster()
Downloads the daily filing master index from the SEC EDGAR server for a given date and converts it into a clean dataframe.
getMasterIndex()
Downloads quarterly and yearly master indexes of all filings for a given year, merging them into a single dataframe for easy searching.
getFilingInfo()
Looks up a firm by name or CIK and returns its filing history for chosen years, quarters, and form types.
getFilings()
Bulk-downloads filings for one or more companies by CIK, form type, year, and quarter in a single call.
getFilingsHTML()
Retrieves filings and converts them into clean HTML view, stripping exhibits for easier reading and downstream parsing.
getFilingHeader()
Parses and extracts structured header information (filer details, fiscal year end, SIC code, addresses, and more) from filings.
searchFilings()
Searches downloaded filings for user-specified keywords and returns keyword hit counts plus HTML snapshots of the matches in context.
getBusinDescr()
Extracts the "Item 1" business description section from annual statements (10-K, 10-K405, 10KSB, 10KSB40).
getMgmtDisc()
Extracts the "Item 7" Management's Discussion & Analysis section from annual statements.
get8KItems()
Parses Form 8-K filings to identify and extract triggering-event information for each filing.
getSentiment()
Computes text-based sentiment measures for filings using the Loughran-McDonald financial dictionary — word counts, tone, uncertainty, litigiousness, and more.