EdgarKit
An unofficial Rust client for the SEC EDGAR (Electronic Data Gathering, Analysis, and Retrieval) system.
Why EdgarKit
EdgarKit is built for financial apps and high-throughput, production-grade pipelines that need to ingest, search, and process SEC filings reliably and fast. It’s a great fit for:
- High-performance financial data pipelines (ETL and streaming)
- Quantitative and fundamental investment research
- Corporate event tracking and governance analytics
- Compliance monitoring and audit workflows
- Building dashboards and alerting for market-moving filings
Rust shines here: many SEC filings (especially S-1, 10-K, 10-Q) are large and complex. Parsing, validating, and extracting structure from these can be very CPU- and IO-intensive. With Rust’s zero-cost abstractions and async runtime, you can scale to millions of documents with predictable latency and minimal overhead.
Compared to Python tools like edgartools or sec-edgar-downloader, Rust typically:
- Processes heavy filings dramatically faster (no GIL, native threading)
- Uses far less memory (no large dynamic overhead)
- Offers compile-time guarantees and stronger type safety
- Integrates cleanly into modern distributed systems (containers, services)
If you’ve hit bottlenecks with scripting solutions, EdgarKit lets you keep the developer ergonomics while upgrading performance and reliability.
Features
- 🚦 Rate-Limited HTTP Client - Automatic compliance with SEC.gov fair access rules
- 📄 Filing Operations - Access company filings, submissions, and documents
- 🏢 Company Information - Retrieve company facts, tickers, and metadata
- 🔍 Search Capabilities - Find filings with customizable search criteria
- 📡 Feed Operations - Monitor Atom and RSS feeds for filings and news
- 📊 Index Operations - Download and parse daily and quarterly filing indices
- ⚡ Async-First - Built on tokio for high-performance concurrent operations
- 🎯 Type-Safe - Strongly-typed API with comprehensive error handling
- 🔧 Flexible - Feature flags for modular compilation
Installation
Add EdgarKit to your Cargo.toml:
[]
= "0.1.0"
= { = "1", = ["full"] }
Feature Flags
EdgarKit uses feature flags to allow you to compile only what you need:
[]
= { = "0.1.0", = ["search", "filings", "company"] }
Available features:
search- Search API functionality (requiresserde_urlencoded,futures)filings- Filing operations (requiresflate2,chrono)company- Company information APIs (requireschrono)feeds- RSS/Atom feed support (requiresquick-xml)index- Index file operations (requiresflate2,chrono,regex)
Default features: ["search", "filings", "company", "feeds", "index"] (all features enabled)
Quick Start
use ;
async
Filing Types You’ll Use Most
Understanding common forms helps target the right data:
- 8-K: Current reports for material events. Ideal for event tracking (mergers, leadership changes, financing, bankruptcy). See the official guide: https://www.sec.gov/files/form8-k.pdf
- 10-K: Annual report with audited financials, risk factors, MD&A, business overview. Deep, comprehensive view. https://www.sec.gov/files/form10-k.pdf
- 10-Q: Quarterly report with unaudited financials and updates. More frequent pulse than 10-K. https://www.sec.gov/files/form10-q.pdf
Other frequent forms for governance and ownership:
- 3/4/5: Insider ownership changes
- Schedule 13D/13G: Beneficial ownership disclosures
- Form D: Exempt offerings
- Investment company forms like
NCEN,N-PORT,N-CSR
Tips & Tricks
DetailedFiling.items: Quickly scan 8-K items to identify important events. The official 8-K item reference is here: https://www.sec.gov/files/form8-k.pdf. For example, items like1.01, 2.03, 5.01indicate significant agreements, creation of liabilities, or a change in control of registrant (5.01).is_xbrlvsis_inline_xbrl: Indicates whether the filing contains XBRL (machine-readable financials) or Inline XBRL (embedded in HTML). Use XBRL parsers for precise numeric extraction; Inline XBRL often improves context and presentation.primary_document: Often the main HTML/XML file to parse. If you fetch the text filing, the primary document usually appears first.- Use feature filters and
FilingOptionsto constrain the workload (form types, limits, offsets). For S-1 workflows, consider including amendments (S-1/A) or disabling them when you need only originals.
Companion Crates (Recommended)
crabrl: High-performance XBRL parser and validator for financial statements. Parse us-gaap concepts at scale. https://crates.io/crates/crabrlquick-xml: Fast XML parsing, perfect for lightweight forms (3/4/5, Form D, NCEN, Schedule 13D/13G) and structured feeds. https://crates.io/crates/quick-xmlrig.rs: For complex, narrative-heavy filings (S-1, 10-K, 10-Q), use rig.rs with strong models (DeepSeek 3.2, Claude Haiku 4.5, Qwen Plus) to extract sections, summarize, and classify. https://rig.rs/
Why Rust (A Short Story)
I originally built a filing pipeline in TypeScript. It worked—until it needed to process heavy S-1 filings at scale. Regex-based parsing slowed to a crawl, memory usage spiked, and throughput collapsed. Rewriting the pipeline in Rust solved the core problems: faster IO, deterministic performance, safe concurrency, and efficient parsing. EdgarKit is the distilled client layer born from that migration.
Usage Examples
Examples are provided in the examples/ directory to keep this README concise.
Download Filing Content
use ;
async
Access Index Files
use ;
async
More Examples
Check out the examples/ directory for comprehensive examples:
basic_usage.rs- Getting started with EdgarKitsearch_filings.rs- Advanced search patternsdownload_filings.rs- Filing retrieval and processingrss_feeds.rs- Working with RSS/Atom feedsindex_operations.rs- Index file operations
Run any example with:
Mini-Projects
EdgarKit includes two standalone CLI tools in the examples/ directory that demonstrate real-world usage:
IPO Scanner
Scans recent EDGAR daily indices for S-1 filings (IPOs) and displays them in an interactive terminal UI (TUI).
# Run from examples/ipo-scanner
Investment Adviser
A CLI that fetches the latest 10-K/10-Q filings and uses an LLM (via OpenRouter) to generate investment recommendations.
# Run from examples/investment-adviser
Rate Limiting
EdgarKit automatically handles rate limiting to comply with SEC.gov's fair access policy:
- Default: 10 requests per second
- Configurable: Adjust via
EdgarConfig - Automatic retry: Exponential backoff on rate limit errors
use ;
use Duration;
let config = EdgarConfig ;
let edgar = with_config?;
SEC.gov Compliance
When using EdgarKit, please follow SEC.gov's guidelines:
- User Agent Required: Always provide a descriptive user agent with contact information
- Rate Limiting: Respect the 10 requests/second limit (enforced automatically)
- Fair Use: Avoid excessive bulk downloading during peak hours (9 AM - 5 PM ET)
- Terms of Service: Review SEC.gov's guidelines
Error Handling
EdgarKit provides comprehensive error types:
use ;
match edgar.filings.await
Documentation
Full API documentation is available at docs.rs/edgarkit.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Development Setup
Running Tests
# Run unit tests
# Run all tests including integration tests
# Run integration tests separately (requires network)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Inspired in part by Joey Chilson’s work-in-progress
edgar_client(Elixir/Rust). Thanks to Joey for publishing the endpoint URLs and early implementation ideas that helped shape this client; EdgarKit rewrites and extends those concepts in a Rust-first, consistent API. - Built with reqwest for HTTP requests
- Rate limiting via governor
- XML parsing with quick-xml
- Powered by the tokio async runtime
Author
Created by Sergey Monin
Disclaimer
This library is not affiliated with or endorsed by the U.S. Securities and Exchange Commission. Please ensure your use complies with SEC.gov's terms of service and applicable regulations.
Made with ❤️ for the Rust community