Welcome to the most comprehensive Python toolkit for downloading SEC EDGAR 10-K filings and extracting company financial data directly from the SEC EDGAR database. This repository provides everything you need to access SEC filings, parse 10-K documents, and analyze public company financial data with ease.
In today's data-driven financial landscape, accessing SEC filings and analyzing 10-K documents is crucial for:
- Investment research and financial analysis
- Quantitative trading strategies
- Risk management and compliance monitoring
- Academic research in finance and economics
- AI-powered financial analysis (like the insights shared in our blog post: The Rise of AI Copilots in FinanceβOpenAI Leads the Way)
- Method 1: Professional-grade SEC API integration using sec-api.io
- Method 2: Simplified SEC EDGAR downloading with sec-edgar-downloader
- Method 3: Direct SEC EDGAR API access (no API key required)
- Method 4: Advanced company facts extraction from SEC filings
- Download 10-K filings for any public company
- Extract financial metrics from SEC filings
- Batch download multiple companies' SEC filings
- Access historical 10-K documents for trend analysis
- Parse structured financial data from company facts API
- Automate SEC data collection for your research pipeline
# Clone the SEC EDGAR API repository
git clone git@github.com:psachdev/sec_data_downloader.git
cd sec_data_downloader
# Install required packages
pip install sec-api sec-edgar-downloader requests beautifulsoup4 pandas
from sec_edgar_downloader import Downloader
# Initialize the SEC EDGAR downloader
dl = Downloader("Your Company", "your-email@example.com")
# Download Apple's latest 5 10-K filings
dl.get("10-K", "AAPL", amount=5)
# Download multiple companies' SEC filings
companies = ["AAPL", "MSFT", "GOOGL", "AMZN", "TSLA"]
for ticker in companies:
dl.get("10-K", ticker, amount=3)
Extract structured financial data directly from the SEC EDGAR database:
# Get comprehensive company facts including revenue, assets, liabilities
company_data = get_company_facts("AAPL")
# Returns detailed financial metrics from 10-K filings
# Download SEC filings for 50+ companies simultaneously
results = download_multiple_companies(
["AAPL", "MSFT", "GOOGL", "AMZN", "TSLA", "NVDA", "JPM", "V", "JNJ"],
filings_per_company=10,
download_filings=True,
download_facts=True
)
# Download SEC filings from specific periods
dl.get("10-K", "AAPL", before_date="2023-12-31", after_date="2020-01-01")
# Perfect for historical analysis and trend identification
Use this SEC EDGAR toolkit to conduct deep financial analysis like our AI-driven examination of Apple stock: Was Apple Stock a Smart Buy in Late 2023? AI Analysis Reveals. The analysis reveals how SEC filing data combined with AI financial analysis can uncover investment opportunities.
# Example: Calculate financial ratios from SEC data
def analyze_financial_ratios(ticker):
filings = get_10k_filings(ticker, 5)
facts = get_company_facts(ticker)
# Calculate key metrics from SEC filings
revenue_growth = calculate_growth(facts, 'Revenues')
profit_margins = calculate_margins(facts, 'NetIncomeLoss')
return_metrics = {
'revenue_growth': revenue_growth,
'profit_margins': profit_margins
}
Monitor SEC filing compliance, track financial reporting changes, and identify regulatory risks through automated SEC data collection.
This SEC EDGAR API toolkit pairs perfectly with AI-powered financial analysis tools. As discussed in our blog post about The Rise of AI Copilots in Finance, combining SEC filing data with AI analysis creates powerful insights for:
- Real-time investment suggestions based on SEC filings
- Automated risk assessment from 10-K disclosures
- Predictive analytics using historical SEC data
- Sentiment analysis of management discussions in 10-K filings
# Core packages for SEC EDGAR access
pip install sec-api
pip install sec-edgar-downloader
pip install requests
pip install beautifulsoup4
pip install pandas
# Set your SEC API key (optional but recommended for heavy use)
SEC_API_KEY = "your_sec_api_key_here"
# Configure user agent (REQUIRED for SEC compliance)
USER_AGENT = "Your Name/Company your-email@example.com"
This toolkit complies with SEC EDGAR access guidelines:
- Respects rate limits (10 requests per second)
- Includes proper User-Agent headers
- Uses data for legitimate research purposes
- Doesn't overwhelm SEC servers
- SEC filings: Public domain (no copyright)
- Code: MIT License
- Derivative analyses: Your ownership
Ready to transform your financial analysis with SEC EDGAR data? Star this repository, fork it for your projects, and join the revolution in data-driven investment research! Built with β€οΈ by financial data enthusiasts | Part of the FunAI Buddy ecosystem