edgartools — SEC EDGAR Data
Python library for accessing all SEC filings since 1994 with structured data extraction.
Authentication (Required)
The SEC requires identification for API access. Always set identity before any operations:
from edgar import set_identity
set_identity("Your Name your.email@example.com")
Set via environment variable to avoid hardcoding: EDGAR_IDENTITY="Your Name your@email.com".
Installation
uv pip install edgartools
# For AI/MCP features:
uv pip install "edgartools[ai]"
Core Workflow
Find a Company
from edgar import Company, find
company = Company("AAPL") # by ticker
company = Company(320193) # by CIK (fastest)
results = find("Apple") # by name search
Get Filings
# Company filings
filings = company.get_filings(form="10-K")
filing = filings.latest()
# Global search across all filings
from edgar import get_filings
filings = get_filings(2024, 1, form="10-K")
# By accession number
from edgar import get_by_accession_number
filing = get_by_accession_number("0000320193-23-000106")
Extract Structured Data
# Form-specific object (most common approach)
tenk = filing.obj() # Returns TenK, EightK, Form4, ThirteenF, etc.
# Financial statements (10-K/10-Q)
financials = company.get_financials() # annual
financials = company.get_quarterly_financials() # quarterly
income = financials.income_statement()
balance = financials.balance_sheet()
cashflow = financials.cashflow_statement()
# XBRL data
xbrl = filing.xbrl()
income = xbrl.statements.income_statement()
Access Filing Content
text = filing.text() # plain text
html = filing.html() # HTML
md = filing.markdown() # markdown (good for LLM processing)
filing.open() # open in browser
Key Company Properties
company.name # "Apple Inc."
company.cik # 320193
company.ticker # "AAPL"
company.industry # "ELECTRONIC COMPUTERS"
company.sic # "3571"
company.shares_outstanding # 15115785000.0
company.public_float # 2899948348000.0
company.fiscal_year_end # "0930"
company.exchange # "Nasdaq"
Form → Object Mapping
| Form |
Object |
Key Properties |
| 10-K |
TenK |
financials, income_statement, balance_sheet |
| 10-Q |
TenQ |
financials, income_statement, balance_sheet |
| 8-K |
EightK |
items, press_releases |
| Form 4 |
Form4 |
reporting_owner, transactions |
| 13F-HR |
ThirteenF |
infotable, total_value |
| DEF 14A |
ProxyStatement |
executive_compensation, proposals |
| SC 13D/G |
Schedule13 |
total_shares, items |
| Form D |
FormD |
offering, recipients |
Important: filing.financials does NOT exist. Use filing.obj().financials.
Common Pitfalls
filing.financials → AttributeError; use filing.obj().financials
get_filings() has no limit param; use .head(n) or .latest(n)
- Prefer
amendments=False for multi-period analysis (amended filings may be incomplete)
- Always check for
None before accessing optional data
Reference Files
Load these when you need detailed information:
- companies.md — Finding companies, screening, batch lookups, Company API
- filings.md — Working with filings, attachments, exhibits, Filings collection API
- financial-data.md — Financial statements, convenience methods, DataFrame export, multi-period analysis
- xbrl.md — XBRL parsing, fact querying, multi-period stitching, standardization
- data-objects.md — All supported form types and their structured objects
- entity-facts.md — EntityFacts API, FactQuery, FinancialStatement, FinancialFact
- ai-integration.md — MCP server setup, Skills installation,
.docs and .to_context() properties
1---2name: edgartools3description: Python library for accessing, analyzing, and extracting data from SEC EDGAR filings. Use when working with SEC filings, financial statements (income statement, balance sheet, cash flow), XBRL financial data, insider trading (Form 4), institutional holdings (13F), company financials, annual/quarterly reports (10-K, 10-Q), proxy statements (DEF 14A), 8-K current events, company screening by ticker/CIK/industry, multi-period financial analysis, or any SEC regulatory filings.4license: MIT5---6
7# edgartools — SEC EDGAR Data
8
9Python library for accessing all SEC filings since 1994 with structured data extraction.
10
11## Authentication (Required)
12
13The SEC requires identification for API access. Always set identity before any operations:
14
15```python
16from edgar import set_identity
17set_identity("Your Name your.email@example.com")
18```
19
20Set via environment variable to avoid hardcoding: `EDGAR_IDENTITY="Your Name your@email.com"`.
21
22## Installation
23
24```bash
25uv pip install edgartools
26# For AI/MCP features:
27uv pip install "edgartools[ai]"
28```
29
30## Core Workflow
31
32### Find a Company
33
34```python
35from edgar import Company, find
36
37company = Company("AAPL") # by ticker
38company = Company(320193) # by CIK (fastest)
39results = find("Apple") # by name search
40```
41
42### Get Filings
43
44```python
45# Company filings
46filings = company.get_filings(form="10-K")
47filing = filings.latest()
48
49# Global search across all filings
50from edgar import get_filings
51filings = get_filings(2024, 1, form="10-K")
52
53# By accession number
54from edgar import get_by_accession_number
55filing = get_by_accession_number("0000320193-23-000106")
56```
57
58### Extract Structured Data
59
60```python
61# Form-specific object (most common approach)
62tenk = filing.obj() # Returns TenK, EightK, Form4, ThirteenF, etc.
63
64# Financial statements (10-K/10-Q)
65financials = company.get_financials() # annual
66financials = company.get_quarterly_financials() # quarterly
67income = financials.income_statement()
68balance = financials.balance_sheet()
69cashflow = financials.cashflow_statement()
70
71# XBRL data
72xbrl = filing.xbrl()
73income = xbrl.statements.income_statement()
74```
75
76### Access Filing Content
77
78```python
79text = filing.text() # plain text
80html = filing.html() # HTML
81md = filing.markdown() # markdown (good for LLM processing)
82filing.open() # open in browser
83```
84
85## Key Company Properties
86
87```python
88company.name # "Apple Inc."
89company.cik # 320193
90company.ticker # "AAPL"
91company.industry # "ELECTRONIC COMPUTERS"
92company.sic # "3571"
93company.shares_outstanding # 15115785000.0
94company.public_float # 2899948348000.0
95company.fiscal_year_end # "0930"
96company.exchange # "Nasdaq"
97```
98
99## Form → Object Mapping
100
101| Form | Object | Key Properties |
102|------|--------|----------------|
103| 10-K | TenK | `financials`, `income_statement`, `balance_sheet` |
104| 10-Q | TenQ | `financials`, `income_statement`, `balance_sheet` |
105| 8-K | EightK | `items`, `press_releases` |
106| Form 4 | Form4 | `reporting_owner`, `transactions` |
107| 13F-HR | ThirteenF | `infotable`, `total_value` |
108| DEF 14A | ProxyStatement | `executive_compensation`, `proposals` |
109| SC 13D/G | Schedule13 | `total_shares`, `items` |
110| Form D | FormD | `offering`, `recipients` |
111
112**Important:** `filing.financials` does NOT exist. Use `filing.obj().financials`.
113
114## Common Pitfalls
115
116- `filing.financials` → AttributeError; use `filing.obj().financials`
117- `get_filings()` has no `limit` param; use `.head(n)` or `.latest(n)`
118- Prefer `amendments=False` for multi-period analysis (amended filings may be incomplete)
119- Always check for `None` before accessing optional data
120
121## Reference Files
122
123Load these when you need detailed information:
124
125- **[companies.md](references/companies.md)** — Finding companies, screening, batch lookups, Company API
126- **[filings.md](references/filings.md)** — Working with filings, attachments, exhibits, Filings collection API
127- **[financial-data.md](references/financial-data.md)** — Financial statements, convenience methods, DataFrame export, multi-period analysis
128- **[xbrl.md](references/xbrl.md)** — XBRL parsing, fact querying, multi-period stitching, standardization
129- **[data-objects.md](references/data-objects.md)** — All supported form types and their structured objects
130- **[entity-facts.md](references/entity-facts.md)** — EntityFacts API, FactQuery, FinancialStatement, FinancialFact
131- **[ai-integration.md](references/ai-integration.md)** — MCP server setup, Skills installation, `.docs` and `.to_context()` properties
132