| name | sec-edgar-skill |
| description | SEC EDGAR filing analysis using EdgarTools. Use when user asks about SEC filings, company financials, 10-K/10-Q analysis, insider trading, revenue trends, or financial comparisons. Triggers include "SEC filing", "10-K", "10-Q", "8-K", "EDGAR", "company financials", "revenue", "earnings", "insider trading", "financial statements". Do NOT use for real-time stock prices or market data (use market-data skill instead). |
SEC EDGAR Skill - Filing Analysis
Prerequisites
CRITICAL: Run this setup before ANY EdgarTools operations:
from edgar import set_identity
set_identity("Your Name your.email@example.com")
This is a SEC legal requirement. Operations will fail without it.
Installation
EdgarTools must be installed:
pip install edgartools
Token Efficiency Strategy
ALWAYS use .to_context() first - it provides summaries with 56-89% fewer tokens:
| Object | repr() tokens | .to_context() tokens | Savings |
|---|
| Company | ~750 | ~75 | 90% |
| Filing | ~125 | ~50 | 60% |
| XBRL | ~2,500 | ~275 | 89% |
| Statement | ~1,250 | ~400 | 68% |
Rule: Call .to_context() first to understand what's available, then drill down.
Three Ways to Access Filings
1. Published Filings - Bulk Cross-Company Analysis
from edgar import get_filings
filings = get_filings(form="10-K")
filings = get_filings(form="10-K", year=2024, quarter=1)
filings = get_filings(form=["10-K", "10-Q"])
2. Current Filings - Real-Time Monitoring
from edgar import get_current_filings
current = get_current_filings()
current_10k = get_current_filings().filter(form="10-K")
3. Company Filings - Single Entity Analysis
from edgar import Company
company = Company("AAPL")
company = Company("0000320193")
filings = company.get_filings(form="10-K")
latest_10k = filings.latest()
Financial Data Access
Method 1: Entity Facts API (Fast, Multi-Period)
Best for comparing trends across periods:
company = Company("AAPL")
income = company.income_statement(periods=5)
print(income)
balance = company.balance_sheet(periods=3)
cashflow = company.cash_flow_statement(periods=3)
Method 2: Filing XBRL (Detailed, Single Period)
Best for comprehensive single-filing analysis:
company = Company("AAPL")
filing = company.get_filings(form="10-K").latest()
xbrl = filing.xbrl()
statements = xbrl.statements
income_stmt = statements.income_statement
balance_sheet = statements.balance_sheet
cash_flow = statements.cash_flow_statement
Common Workflows
Workflow 1: Compare Revenue Across Companies
from edgar import Company
companies = ["AAPL", "MSFT", "GOOGL"]
for ticker in companies:
company = Company(ticker)
income = company.income_statement(periods=3)
print(f"\n{ticker} Revenue Trend:")
print(income)
Workflow 2: Analyze Latest 10-K
from edgar import Company
company = Company("NVDA")
filing = company.get_filings(form="10-K").latest()
print(filing.to_context())
Workflow 3: Track Insider Trading
from edgar import Company
company = Company("TSLA")
insider_filings = company.get_filings(form="4")
for filing in insider_filings[:10]:
print(filing.to_context())
Workflow 4: Monitor Recent Filings by Sector
from edgar import get_filings
filings = get_filings(form="10-K", year=2024)
Workflow 5: Multi-Year Financial Trend
from edgar import Company
company = Company("AMZN")
income = company.income_statement(periods=20)
balance = company.balance_sheet(periods=20)
print("Income Statement Trend:")
print(income)
print("\nBalance Sheet Trend:")
print(balance)
Search Within Filings
CRITICAL DISTINCTION:
filing = company.get_filings(form="10-K").latest()
results = filing.search("climate risk")
docs_results = filing.docs.search("how to extract")
Do NOT mix these up!
Key Objects Reference
Company
company = Company("AAPL")
company.to_context()
company.name
company.cik
company.sic
company.industry
company.get_filings()
Filing
filing.to_context()
filing.form
filing.filing_date
filing.accession_number
filing.text()
filing.markdown()
filing.xbrl()
filing.items()
XBRL (Financial Data)
xbrl = filing.xbrl()
xbrl.to_context()
xbrl.statements
xbrl.facts
Statement (Financial Statement)
stmt = xbrl.statements.income_statement
print(stmt)
stmt.to_dataframe()
Anti-Patterns (Avoid These)
DON'T: Parse financials from raw text
text = filing.text()
DO: Use structured XBRL data
income = company.income_statement(periods=3)
DON'T: Load full filing when you only need metadata
text = filing.text()
DO: Use context first
print(filing.to_context())
Form Types Quick Reference
| Form | Description | Use Case |
|---|
| 10-K | Annual report | Full-year financials, business description |
| 10-Q | Quarterly report | Quarterly financials |
| 8-K | Current report | Material events (M&A, exec changes) |
| DEF 14A | Proxy statement | Executive comp, board info |
| 4 | Insider trading | Stock transactions by insiders |
| 13F | Institutional holdings | What hedge funds own |
| S-1 | IPO registration | Pre-IPO filings |
| 424B | Prospectus | Bond/stock offerings |
Error Handling
from edgar import Company
try:
company = Company("INVALID")
except Exception as e:
print(f"Company not found: {e}")
filings = company.get_filings(form="10-K")
if len(filings) == 0:
print("No 10-K filings found")
Performance Tips
- Filter before retrieving: Use form type, date filters
- Use Entity Facts API for trends: Faster than parsing multiple filings
- Batch operations: Process multiple companies in loops
- Cache results: Store frequently accessed data
Reference Documentation
For detailed documentation, see:
Or use the built-in docs:
from edgar import Company
company = Company("AAPL")
company.docs.search("how to get revenue")