| name | description |
|---|---|
analyzing-sec-filings |
Retrieves and parses SEC EDGAR filings (10-K, 10-Q, 8-K, DEF 14A) into markdown or structured financial data using the edgartools Python library. Use when working with SEC filings, EDGAR data, XBRL financials, or company fundamental analysis. |
Use edgartools for all SEC filing work. Do not use curl, manual HTML parsing, or filing.full_text_submission().
from edgar import Company, set_identity
set_identity("research research@example.com") # required before any callcompany = Company("AAPL")
filing = company.get_filings(form="10-K").latest()
# Other forms: "10-Q", "8-K", "DEF 14A"
# Filter by year: company.get_filings(form="10-K", year=2024)Default method for full-text reading:
md = filing.markdown() # full filing as clean markdown, iXBRL stripped| Method | Returns | Use for |
|---|---|---|
filing.markdown() |
Clean markdown | Full-text reading, thesis writing |
filing.text() |
Plain text | Regex / keyword extraction |
filing.html() |
Raw HTML | Post-processing |
filing.search(query) |
BM25-ranked matches | Finding topics in large filings |
tenk = filing.obj() # returns TenK with typed accessors
tenk.business # Item 1
tenk.risk_factors # Item 1A
tenk.management_discussion # Item 7 (MD&A)Returns plain text strings for prose sections.
Use the Company API for multi-period comparison (faster, single API call):
income = company.income_statement(periods=3) # last 3 fiscal years
balance = company.balance_sheet(periods=3)
quarterly = company.income_statement(periods=4, annual=False)Use XBRL from a specific filing when you need exact as-filed line items:
xbrl = filing.xbrl()
inc = xbrl.statements.income_statement()
df = inc.to_dataframe()Orient before reading in full:
company.to_context() # ~88 tokens — company profile
filing.to_context() # ~109 tokens — filing metadata + available methods