Learn R Programming

edgarfundamentals (version 0.1.2)

get_filing_history: Retrieve recent SEC filing history for a company

Description

Returns a data frame listing the most recent EDGAR filings of a specified form type for a given company. Useful for verifying that a company has filed the expected number of 10-K or 10-Q reports, or for retrieving accession numbers needed to access specific filings.

Usage

get_filing_history(symbol, form_type = "10-K", n = 5)

Value

A data frame with one row per filing and the following columns:

symbol

The ticker symbol passed to the function.

accession_number

The SEC accession number uniquely identifying the filing (e.g. "0000320193-24-000123").

filing_date

The date the filing was submitted to EDGAR.

report_date

The period-end date covered by the filing.

form

The form type as recorded in EDGAR.

primary_document

The filename of the primary HTML document within the filing.

Arguments

symbol

A character string containing the stock ticker symbol (e.g. "AAPL"). Case-insensitive.

form_type

A character string specifying the SEC form type to retrieve. Common values are "10-K" (annual report), "10-Q" (quarterly report), and "8-K" (current report). Defaults to "10-K".

n

An integer specifying the maximum number of filings to return. Defaults to 5.

Details

Data is retrieved from the SEC EDGAR submissions API (https://data.sec.gov/submissions/). The API returns up to the 1,000 most recent filings across all form types; older filings may not appear.

Set your User-Agent once per session: options(edgarfundamentals.user_agent = "Your Name your@email.com")

Examples

Run this code
if (FALSE) {
options(edgarfundamentals.user_agent = "Jane Smith jane@example.com")

# Five most recent annual reports for Lockheed Martin
get_filing_history("LMT", form_type = "10-K", n = 5)

# Most recent quarterly reports for Eli Lilly
get_filing_history("LLY", form_type = "10-Q", n = 4)
}

Run the code above in your browser using DataLab