SEC Filings Python Tutorials — Free Colab Notebooks
Access SEC EDGAR data with Python — completely free, no API key or paid subscription required.
Every notebook runs instantly in Google Colab with one click. Install locally with pip install edgartools.
Getting Started
New to edgartools? Start here. These notebooks cover installation, company lookups, and your first SEC filing queries.
| Notebook | Difficulty | Links |
|---|---|---|
| SEC EDGAR API in Python — Comprehensive overview: companies, filings, financials, insiders, and holdings in one notebook | Beginner | |
| SEC Company Data with Python — Look up any company by ticker or CIK: metadata, filing history, industry classification | Beginner | |
| Getting Started with SEC Filings — First steps: install, configure, and pull your first filing | Beginner | |
| Beginner's Guide to EdgarTools — Complete walkthrough of the core API | Beginner | |
| Search SEC Filings by Ticker Symbol — Find filings by ticker, CIK, or company name | Beginner | |
| Troubleshooting SSL Issues — Fix SSL/TLS connection problems in corporate or restricted environments | Beginner |
Filings
Search, filter, download, and analyze SEC filings. From today's filings to bulk downloads to full 10-K/10-Q/8-K parsing.
| Notebook | Difficulty | Links |
|---|---|---|
| Search and Filter SEC Filings — Search across all companies by date, form type, or quarter | Beginner | |
| Get Today's SEC Filings — Real-time access to filings submitted today | Beginner | |
| Monitor Filings for Multiple Companies — Watch multiple tickers for new SEC submissions | Intermediate | |
| Download 10-K Annual Reports — Download and parse 10-K annual reports | Beginner | |
| Analyze 10-K Annual Reports — Extract business description, risk factors, MD&A, and financials | Intermediate | |
| Extract Business Description from 10-K Item 1 — Pull the company overview section from annual reports | Intermediate | |
| 10-Q Quarterly Earnings — Parse quarterly financial data from 10-Q filings | Intermediate | |
| Extract 8-K Earnings Releases — Pull earnings announcements from 8-K current event reports | Intermediate | |
| Download SEC Filings in Bulk — Batch download filings across companies and date ranges | Intermediate | |
| Filter Companies by Industry and SIC Code — Find companies by sector using SEC industry classifications | Beginner | |
| SEC Filing Text for NLP — Extract raw text from filings for natural language processing | Advanced | |
| Filing Exhibits and Attachments — Access exhibits, press releases, and supplemental documents | Intermediate | |
| Analyze SEC Comment Letters — Parse CORRESP filings: SEC staff questions and company responses | Advanced | |
| Browse and Page Through Filings — Navigate large filing collections with paging | Beginner | |
| Working with Filing Attachments — Access individual documents within a filing | Beginner |
Financial Statements
Extract income statements, balance sheets, and cash flow statements from SEC filings. Compare financials across companies and time periods.
| Notebook | Difficulty | Links |
|---|---|---|
| Financial Statements from SEC Filings — Extract income statements, balance sheets, and cash flows from 10-K/10-Q | Intermediate | |
| Extract Revenue and Earnings — Pull revenue, net income, and EPS from SEC filings | Intermediate | |
| Compare Company Financials — Side-by-side financial comparisons across companies | Intermediate | |
| Viewing Financial Statements — Display and navigate financial statement tables | Beginner | |
| Financial Statements to DataFrame — Build quarterly IS, BS, and CF DataFrames with multi-index (Ticker, Period) for multiple companies | Intermediate |
Prefer a visual interface?
Every tutorial above runs as Python code. edgar.tools puts the same data in a web UI — no code, no notebooks, no setup.
- Browse any company's filings and financials →
- See filings arrive in real time →
- Explore insider trades with sentiment analysis →
Free tier available. Also includes a REST API and hosted MCP server for AI integrations.
XBRL Deep Dive
Parse structured XBRL financial data — fact queries, multi-period views, custom tags, and advanced statement analysis.
| Notebook | Difficulty | Links |
|---|---|---|
| Parse XBRL Financial Data — Work with XBRL-tagged data: income statements, balance sheets, disclosures | Intermediate | |
| Read Data from XBRL — Extract structured data from XBRL documents | Intermediate | |
| XBRL Fact Queries — Query individual XBRL facts with the enhanced API | Advanced | |
| Multi-Period Financial Views — Compare financial statements across quarters and years | Advanced | |
| Cash Flow Statements — Analyze cash flow statements in detail | Advanced | |
| Standardized Financial Statements — Map company-specific tags to standardized concepts | Advanced | |
| Quarterly Financial Statements — Quarterly statement analysis and comparison | Advanced | |
| Stitch Statements Across Filings — Combine statements from multiple filings into time series | Advanced | |
| Custom XBRL Tags — Handle company-specific extension tags | Advanced | |
| Non-Financial Statements — Segment disclosures and non-financial XBRL data | Advanced | |
| Instance-Only XBRL — Parse XBRL documents without a taxonomy schema | Advanced | |
| Explore XBRL Concepts — Browse the XBRL taxonomy and concept hierarchy | Advanced |
Insider Trading
Track insider buying, selling, and ownership changes from SEC Form 3 and Form 4 filings.
| Notebook | Difficulty | Links |
|---|---|---|
| Track Insider Trading from Form 4 — Monitor officer and director buys, sells, and option exercises | Intermediate | |
| Initial Insider Ownership (Form 3) — Analyze initial ownership disclosures for new insiders | Intermediate |
Beneficial Ownership
Track large shareholders and activist investors through SEC Schedule 13D/G filings.
| Notebook | Difficulty | Links |
|---|---|---|
| Beneficial Ownership (Schedule 13D/G) — Track 5%+ shareholders, activist positions, and ownership changes | Intermediate |
Institutional Holdings
Analyze what hedge funds, mutual funds, and large investors are buying and selling.
| Notebook | Difficulty | Links |
|---|---|---|
| 13F Institutional Holdings — Quarterly portfolio disclosures from hedge funds and institutional investors | Intermediate |
Investment Funds
Analyze mutual fund, ETF, and closed-end fund portfolios from SEC N-PORT and other fund filings.
| Notebook | Difficulty | Links |
|---|---|---|
| Mutual Fund Holdings (N-PORT) — Complete portfolio holdings from monthly N-PORT filings | Intermediate | |
| Money Market Fund Holdings (N-MFP) — Portfolio holdings, yields, NAV, and liquidity from monthly N-MFP filings | Intermediate | |
| ETF and Fund Holdings — Analyze ETF portfolios and fund composition | Intermediate | |
| Fund Census (N-CEN) — Annual fund census: series, service providers, directors, ETF mechanics, broker commissions | Intermediate | |
| Fund Filing Types — Overview of SEC fund filing types and structures | Beginner | |
| Fund Derivative Holdings — Analyze derivative positions within fund portfolios | Advanced |
Business Development Companies
Analyze BDC portfolio investments, lending activity, and SEC filings.
| Notebook | Difficulty | Links |
|---|---|---|
| BDC SEC Filings and Portfolios — Analyze BDC investment portfolios and lending activity | Intermediate |
Executive Compensation & Proxy Statements
Parse proxy statements for executive pay, board composition, and shareholder proposals.
| Notebook | Difficulty | Links |
|---|---|---|
| Proxy Statements (DEF 14A) — Parse proxy statements: proposals, board members, and voting items | Intermediate | |
| Executive Compensation — Extract CEO and executive pay from proxy statements | Intermediate |
Why EdgarTools?
sec-api.io is a data access API -- it gives you JSON from REST endpoints, and you build the analysis yourself. EdgarTools is a data analysis library -- it parses filings into structured Python objects with built-in methods for the analysis you actually want to do. And it's free.
The Core Difference
With sec-api, getting 13F institutional holdings means calling an endpoint, receiving JSON, then writing code to compare quarters, calculate position changes, and format results. With edgartools, that analysis is built in:
from edgar import *
# Parse a 13F filing into a structured object
thirteenf = Company("BERKSHIRE HATHAWAY").get_filings(form="13F-HR")[0].obj()
# Built-in quarter-over-quarter comparison
thirteenf.compare_holdings() # NEW, CLOSED, INCREASED, DECREASED positions
# Multi-quarter trend analysis with sparklines
thirteenf.holding_history(periods=4)
# All holdings as a pandas DataFrame, ready for analysis
thirteenf.holdings_data()
sec-api returns the raw holdings data as JSON. The comparison logic, trend analysis, and DataFrame conversion are left to you.
What You Get Out of the Box
EdgarTools doesn't just fetch data -- it structures it into objects with properties, methods, and DataFrames designed for the analysis Python developers actually do:
| Filing Type | What edgartools gives you | What a JSON API gives you |
|---|---|---|
| 10-K / 10-Q | TenK / TenQ objects with .financials, section extraction, multi-period statements |
Raw XBRL JSON -- you build the statement structure |
| 8-K | EightK with item-level parsing, earnings extraction |
Section text or structured fields for a few items |
| 13F | ThirteenF with compare_holdings(), holding_history(), sparklines |
Holdings array -- you write the diff logic |
| N-PORT | FundReport with investment_data(), asset allocation, country exposure |
Holdings array -- you aggregate and categorize |
| N-MFP | MoneyMarketFund with yield/NAV/liquidity time series, category breakdowns |
-- |
| N-CEN | FundCensus with series, providers, broker commissions, board composition |
-- |
| DEF 14A | ProxyStatement with executive compensation tables, board data |
Separate exec comp and board endpoints |
| 13D/G | Schedule13DG with ownership parsing |
Structured JSON |
| Form 4 | Ownership with transaction details |
Structured JSON |
Pricing
| EdgarTools | sec-api.io | |
|---|---|---|
| Price | Free forever | Free trial (100 calls), then $49-$239/mo |
| API key | Not required | Required |
| Open source | Yes (MIT license) | No |
| Works offline | Yes (with local storage) | No |
Use sec-api if you need...
sec-api is a hosted platform backed by databases and infrastructure, so it can offer things a client-side library can't: real-time WebSocket filing streams, full-text boolean search across all filings, filing-to-PDF conversion, and prebuilt datasets like SEC enforcement actions and Form ADV investment adviser data. It also works with any programming language via REST, not just Python.
Use EdgarTools if you need...
EdgarTools is for Python developers who want to go straight from a filing to analysis. No API key, no HTTP plumbing, no JSON wrangling -- just pip install edgartools and you get structured objects with built-in analysis methods, pandas DataFrames, Rich terminal display, and native Jupyter/Colab support. Free forever, open source, and works offline.
Running on Google Colab
Click any Open in Colab badge above, or:
- Go to colab.research.google.com
- File > Open notebook > GitHub tab
- Enter
dgunning/edgartoolsand select a notebook