Skip to content

Cheat Sheet

Common EdgarTools operations at a glance. For a step-by-step introduction, see the Quick Start.

Setup

Code
Set your EDGAR identity in Linux/Mac export EDGAR_IDENTITY="email@domain.com"
Set your EDGAR identity in Windows set EDGAR_IDENTITY="email@domain.com"
Set identity in Windows Powershell $env:EDGAR_IDENTITY="email@domain.com"
Set identity in Python set_identity("email@domain.com")
Importing the library from edgar import *

Working with a company ๐Ÿข

See also: Find a Company

Code
๐Ÿ” Get a company by ticker company = Company("AAPL")
๐Ÿ” Get a company by CIK company = Company("0000320193")
๐Ÿ”Ž Find filings by form and ticker find(form="10-K", ticker="AAPL")
๐Ÿ“Š Get shares outstanding company.shares_outstanding
๐Ÿ’ฐ Get public float company.public_float
๐Ÿญ Get industry company.industry
๐Ÿ“‹ Get company facts company.get_facts()
๐Ÿผ Get company facts as a DataFrame company.get_facts().to_pandas()

Financial statements ๐Ÿ’ต

See also: Financial Statements Guide

Code
๐Ÿ“Š Get a company's financials financials = company.get_financials()
๐Ÿ“ˆ Get the income statement financials.income_statement()
๐Ÿฆ Get the balance sheet financials.balance_sheet()
๐Ÿ’ธ Get the cash flow statement financials.cashflow_statement()
๐Ÿ’ฐ Get revenue financials.get_revenue()
๐Ÿ’ต Get net income financials.get_net_income()
๐Ÿ“Š Get operating income financials.get_operating_income()
๐Ÿผ Export statement to DataFrame financials.income_statement().to_dataframe()

Working with filings ๐Ÿ“

See also: Working with Filings ยท Search & Filter

๐Ÿ” Getting Filings

Code
๐Ÿ“… Get filings for the year to date filings = get_filings()
๐Ÿ“Š Get only XBRL filings filings = get_filings(index="xbrl")
๐Ÿ“† Get filings for a specific year filings = get_filings(2020)
๐Ÿ—“๏ธ Get filings for a specific quarter filings = get_filings(2020, 1)
๐Ÿ“š Get filings for multiple years filings = get_filings([2020, 2021])
๐Ÿ“ˆ Get filings for a range of years filings = get_filings(year=range(2010, 2020))
๐Ÿ“ˆ Get filings released just now filings = get_latest_filings()

๐Ÿ“„ Filtering Filings

Code
๐Ÿ“ Filter by form type filings.filter(form="10-K")
๐Ÿ“‘ Filter by multiple forms filings.filter(form=["10-K", "10-Q"])
๐Ÿ”„ Include form amendments filings.filter(form="10-K", amendments=True)
๐Ÿข Filter by CIK filings.filter(cik="0000320193")
๐Ÿ™๏ธ Filter by multiple CIKs filings.filter(cik=["0000320193", "1018724"])
๐Ÿท๏ธ Filter by ticker filings.filter(ticker="AAPL")
๐Ÿท๏ธ๐Ÿท๏ธ Filter by multiple tickers filings.filter(ticker=["AAPL", "MSFT"])
๐Ÿ“… Filter on a specific date filings.filter(date="2020-01-01")
๐Ÿ“…โ†”๏ธ๐Ÿ“… Filter between dates filings.filter(date="2020-01-01:2020-03-01")
๐Ÿ“…โฌ…๏ธ Filter before a date filings.filter(date=":2020-03-01")
๐Ÿ“…โžก๏ธ Filter after a date filings.filter(date="2020-03-01:")
๐Ÿ”€ Combine multiple filters filings.filter(form="10-K", date="2020-01-01:", ticker="AAPL")

๐Ÿ“Š Viewing and Manipulating Filings

Code
โญ๏ธ Show the next page of filings filings.next()
โฎ๏ธ Show the previous page of filings filings.previous()
๐Ÿ” Get the first n filings filings.head(20)
๐Ÿ”š Get the last n filings filings.tail(20)
๐Ÿ•’ Get the latest n filings by date filings.latest(20)
๐ŸŽฒ Get a random sample of filings filings.sample(20)
๐Ÿผ Get filings as a pandas DataFrame filings.to_pandas()

Company filings ๐Ÿ“‚

See also: Find a Company

Code
๐Ÿ“ Get company filings company.get_filings()
๐Ÿ“ Get company filings by form company.get_filings(form="10-K")
๐Ÿ•’ Get the latest 10-Q company.latest("10-Q")
๐Ÿ“‘ Get the last 5 10-Qs company.get_filings(form="10-Q").head(5)
๐Ÿ”ข Get a filing by accession number company.get_filing(accession_number="0000320193-21-000139")

Working with a filing ๐Ÿ“„

See also: Working with Filings

๐Ÿ” Accessing and Viewing a Filing

Code
๐Ÿ“Œ Get a single filing filing = filings[3]
๐Ÿ”ข Get a filing by accession number filing = get_by_accession_number("0000320193-20-34576")
๐Ÿ  Get the filing homepage filing.homepage
๐ŸŒ Open a filing in the browser filing.open()
๐Ÿ  Open homepage in the browser filing.homepage.open()
๐Ÿ’ป View the filing in the terminal filing.view()

๐Ÿ“Š Extracting Filing Content

Code
๐ŸŒ Get the HTML of the filing filing.html()
๐Ÿ“Š Get the XBRL of the filing filing.xbrl()
๐Ÿ“ Get the filing as markdown filing.markdown()
๐Ÿ“„ Get the full submission text filing.full_text_submission()
๐Ÿ” Preview data object type filing.obj_type
๐Ÿ”ข Get and parse filing data object filing.obj()
๐Ÿ“‘ Get filing header filing.header

๐Ÿ”Ž Searching Inside a Filing

Code
๐Ÿ” Search within the filing filing.search("query")
๐Ÿ” Search with regex filing.search("pattern", regex=True)
๐Ÿ“Š Get filing sections filing.sections()

๐Ÿ“Ž Working with Attachments

See also: Filing Attachments

Code
๐Ÿ“ Get all filing attachments filing.attachments
๐Ÿ“„ Get a single attachment attachment = filing.attachments[0]
๐ŸŒ Open attachment in browser attachment.open()
โฌ‡๏ธ Download an attachment content = attachment.download()

10-K Annual Report data ๐Ÿ“Š

See also: Working with Filings

Code
๐Ÿ“„ Get 10-K as data object tenk = company.get_filings(form="10-K").latest().obj()
๐Ÿข Get auditor information tenk.auditor
๐Ÿข Get auditor name tenk.auditor.name
๐Ÿ”ข Get PCAOB firm ID tenk.auditor.firm_id
๐Ÿ—๏ธ Get subsidiaries tenk.subsidiaries
๐Ÿผ Subsidiaries as DataFrame tenk.subsidiaries.to_dataframe()

Proxy statements (executive compensation) ๐Ÿ’ผ

See also: Proxy Statements Guide

Code
๐Ÿ“‹ Get latest proxy statement proxy = company.get_filings(form="DEF 14A").latest().obj()
๐Ÿ‘ค Get CEO name proxy.peo_name
๐Ÿ’ฐ Get CEO total compensation proxy.peo_total_comp
๐Ÿ“Š Get 5-year exec compensation DataFrame proxy.executive_compensation
๐Ÿ“ˆ Get pay vs performance DataFrame proxy.pay_vs_performance
๐Ÿ“‰ Get company TSR proxy.total_shareholder_return
๐Ÿ“‰ Get peer group TSR proxy.peer_group_tsr

Prefer a visual interface?

Every operation above also works through edgar.tools โ€” the same SEC data in a web UI, no code required.

Also includes a REST API (20+ endpoints), hosted MCP server, and data exports. Free tier: 100 API calls/day.