Examples
Learn by doing. These examples show how to solve real problems with EdgarTools.
Interactive Notebooks
Run these in your browser with Google Colab -- no setup required.
Getting Started
| Notebook | Description |
|---|---|
| First Steps | Look up a company, get financials, export data |
| Getting Started | Company lookup, filings, date filtering |
| Troubleshooting SSL | Fix SSL/connection issues |
Financial Statements
| Notebook | Description |
|---|---|
| Financial Statements | Income, balance sheet, cash flow from SEC filings |
| Viewing Financial Statements | get_financials() deep dive |
| Extract Revenue & Earnings | Pull specific financial metrics |
| Compare Company Financials | Side-by-side multi-company analysis |
| Statements to DataFrame | Export to pandas for analysis |
| XBRL Financial Data | Low-level XBRL data access |
Company Research
| Notebook | Description |
|---|---|
| SEC EDGAR API Overview | Comprehensive library overview |
| Company Data | Company metadata, CIK lookup, filing history |
| Ticker Search | Find companies by ticker, name, or keyword |
| Industry & SIC Codes | Filter companies by industry |
Filings
| Notebook | Description |
|---|---|
| Search & Filter Filings | Find filings by date, form type, company |
| Today's Filings | Monitor current SEC filings |
| Download 10-K Reports | Parse and extract 10-K sections |
| Analyze 10-K Reports | Business description, risk factors, MD&A |
| 10-Q Quarterly Earnings | Quarterly report analysis |
| 8-K Earnings Releases | Current event reports |
| Extract Earnings Releases | Press releases and financial tables from 8-Ks |
| Filing Text & NLP | Text extraction for NLP analysis |
| Filing Exhibits | Work with filing attachments and exhibits |
| Bulk Download | Download filings in bulk |
| 10-K Business Description | Extract business overview text |
| Monitor Filings | Watch for new filings |
Insider Trading & Ownership
| Notebook | Description |
|---|---|
| Insider Trading (Form 4) | Track insider buys and sells |
| 13F Institutional Holdings | Fund portfolio analysis |
| Beneficial Ownership | 13D/G activist positions |
| Executive Compensation | Proxy statement compensation data |
| Proxy Statements (DEF 14A) | Board members, shareholder proposals |
Funds
| Notebook | Description |
|---|---|
| ETF & Fund Holdings | ETF portfolio data |
| Mutual Fund Holdings (N-PORT) | Mutual fund portfolio reports |
| Money Market Funds (N-MFP) | Money market fund data |
| Fund Census (N-CEN) | Fund census reports |
| BDCs | Business Development Companies |
Code Examples
Get a company's revenue in 3 lines
from edgar import Company
financials = Company("AAPL").get_financials()
print(f"Revenue: ${financials.get_revenue():,.0f}")
Compare two companies
from edgar import Company
for ticker in ["AAPL", "MSFT"]:
f = Company(ticker).get_financials()
print(f"{ticker}: Revenue ${f.get_revenue():,.0f}, Net Income ${f.get_net_income():,.0f}")
Get the latest 10-K business description
from edgar import Company
tenk = Company("NVDA").latest("10-K")
print(tenk['Item 1'].text[:2000])
Get auditor and subsidiaries from a 10-K
from edgar import Company
tenk = Company("AAPL").get_filings(form="10-K").latest().obj()
print(tenk.auditor) # Ernst & Young LLP, PCAOB ID 42
print(tenk.subsidiaries) # SubsidiaryList from Exhibit 21
Track insider buying
from edgar import Company
for filing in Company("AAPL").get_filings(form=4).head(10):
summary = filing.obj().get_ownership_summary()
if summary.primary_activity == "Purchase":
print(f"{summary.insider_name}: bought {summary.net_change:,} shares")
Export financials to CSV
from edgar import Company
financials = Company("AAPL").get_financials()
df = financials.income_statement().to_dataframe()
df.to_csv("apple_income.csv")