Skip to content

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.

Get Started | View on GitHub


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 Open In Colab   GitHub
SEC Company Data with Python — Look up any company by ticker or CIK: metadata, filing history, industry classification Beginner Open In Colab   GitHub
Getting Started with SEC Filings — First steps: install, configure, and pull your first filing Beginner Open In Colab   GitHub
Beginner's Guide to EdgarTools — Complete walkthrough of the core API Beginner Open In Colab   GitHub
Search SEC Filings by Ticker Symbol — Find filings by ticker, CIK, or company name Beginner Open In Colab   GitHub
Troubleshooting SSL Issues — Fix SSL/TLS connection problems in corporate or restricted environments Beginner Open In Colab   GitHub

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 Open In Colab   GitHub
Get Today's SEC Filings — Real-time access to filings submitted today Beginner Open In Colab   GitHub
Monitor Filings for Multiple Companies — Watch multiple tickers for new SEC submissions Intermediate Open In Colab   GitHub
Download 10-K Annual Reports — Download and parse 10-K annual reports Beginner Open In Colab   GitHub
Analyze 10-K Annual Reports — Extract business description, risk factors, MD&A, and financials Intermediate Open In Colab   GitHub
Extract Business Description from 10-K Item 1 — Pull the company overview section from annual reports Intermediate Open In Colab   GitHub
10-Q Quarterly Earnings — Parse quarterly financial data from 10-Q filings Intermediate Open In Colab   GitHub
Extract 8-K Earnings Releases — Pull earnings announcements from 8-K current event reports Intermediate Open In Colab   GitHub
Download SEC Filings in Bulk — Batch download filings across companies and date ranges Intermediate Open In Colab   GitHub
Filter Companies by Industry and SIC Code — Find companies by sector using SEC industry classifications Beginner Open In Colab   GitHub
SEC Filing Text for NLP — Extract raw text from filings for natural language processing Advanced Open In Colab   GitHub
Filing Exhibits and Attachments — Access exhibits, press releases, and supplemental documents Intermediate Open In Colab   GitHub
Analyze SEC Comment Letters — Parse CORRESP filings: SEC staff questions and company responses Advanced Open In Colab   GitHub
Browse and Page Through Filings — Navigate large filing collections with paging Beginner Open In Colab   GitHub
Working with Filing Attachments — Access individual documents within a filing Beginner Open In Colab   GitHub

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 Open In Colab   GitHub
Extract Revenue and Earnings — Pull revenue, net income, and EPS from SEC filings Intermediate Open In Colab   GitHub
Compare Company Financials — Side-by-side financial comparisons across companies Intermediate Open In Colab   GitHub
Viewing Financial Statements — Display and navigate financial statement tables Beginner Open In Colab   GitHub
Financial Statements to DataFrame — Build quarterly IS, BS, and CF DataFrames with multi-index (Ticker, Period) for multiple companies Intermediate Open In Colab   GitHub

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.

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 Open In Colab   GitHub
Read Data from XBRL — Extract structured data from XBRL documents Intermediate Open In Colab   GitHub
XBRL Fact Queries — Query individual XBRL facts with the enhanced API Advanced Open In Colab   GitHub
Multi-Period Financial Views — Compare financial statements across quarters and years Advanced Open In Colab   GitHub
Cash Flow Statements — Analyze cash flow statements in detail Advanced Open In Colab   GitHub
Standardized Financial Statements — Map company-specific tags to standardized concepts Advanced Open In Colab   GitHub
Quarterly Financial Statements — Quarterly statement analysis and comparison Advanced Open In Colab   GitHub
Stitch Statements Across Filings — Combine statements from multiple filings into time series Advanced Open In Colab   GitHub
Custom XBRL Tags — Handle company-specific extension tags Advanced Open In Colab   GitHub
Non-Financial Statements — Segment disclosures and non-financial XBRL data Advanced Open In Colab   GitHub
Instance-Only XBRL — Parse XBRL documents without a taxonomy schema Advanced Open In Colab   GitHub
Explore XBRL Concepts — Browse the XBRL taxonomy and concept hierarchy Advanced Open In Colab   GitHub

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 Open In Colab   GitHub
Initial Insider Ownership (Form 3) — Analyze initial ownership disclosures for new insiders Intermediate Open In Colab   GitHub

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 Open In Colab   GitHub

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 Open In Colab   GitHub

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 Open In Colab   GitHub
Money Market Fund Holdings (N-MFP) — Portfolio holdings, yields, NAV, and liquidity from monthly N-MFP filings Intermediate Open In Colab   GitHub
ETF and Fund Holdings — Analyze ETF portfolios and fund composition Intermediate Open In Colab   GitHub
Fund Census (N-CEN) — Annual fund census: series, service providers, directors, ETF mechanics, broker commissions Intermediate Open In Colab   GitHub
Fund Filing Types — Overview of SEC fund filing types and structures Beginner Open In Colab   GitHub
Fund Derivative Holdings — Analyze derivative positions within fund portfolios Advanced Open In Colab   GitHub

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 Open In Colab   GitHub

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 Open In Colab   GitHub
Executive Compensation — Extract CEO and executive pay from proxy statements Intermediate Open In Colab   GitHub

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:

  1. Go to colab.research.google.com
  2. File > Open notebook > GitHub tab
  3. Enter dgunning/edgartools and select a notebook

Resources