Expand description
§EdgarKit - A Rust client for the SEC EDGAR system
EdgarKit provides a comprehensive and ergonomic API for interacting with the SEC’s EDGAR (Electronic Data Gathering, Analysis, and Retrieval) system.
§Features
- Rate-limited HTTP client - Complies with SEC.gov fair access rules
- Filing operations - Access company filings, submissions, and text documents
- Company information - Retrieve company facts, tickers, and metadata
- Search capabilities - Find filings with customizable search criteria
- Feed operations - Access Atom and RSS feeds for filings and news
- Index operations - Retrieve and parse daily and quarterly filing indices
§Requirements
EdgarKit is an async-first library and requires an async runtime. We recommend tokio, which is the most widely used async runtime in the Rust ecosystem.
§Basic Usage
ⓘ
use edgarkit::{Edgar, FilingOperations, FilingOptions};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Initialize with a proper user agent (required by SEC.gov)
let edgar = Edgar::new("YourAppName contact@example.com")?;
// Get recent 10-K filings for a company
let options = FilingOptions::new()
.with_form_type("10-K")
.with_limit(5);
let filings = edgar.filings("320193", Some(options)).await?;
for filing in filings {
println!("Filing: {} on {}", filing.form, filing.filing_date);
}
Ok(())
}Modules§
Structs§
- Company
Concept - Historical data for a single XBRL concept across a company’s filings.
- Company
Facts - Complete set of XBRL facts reported by a company across all filings.
- Company
Ticker - Mapping between stock ticker symbols and company CIKs.
- Company
Ticker Exchange - Company ticker with exchange information included.
- Detailed
Filing - A normalized filing record derived from the “recent filings” table.
- Directory
- Directory listing payload for filings and entities.
- Directory
Item - A file entry inside a directory listing.
- Directory
Response - Response wrapper for EDGAR
index.jsondirectory listings. - Edgar
- Edgar
Config - Configuration settings for the Edgar HTTP client.
- Edgar
Day - A specific day in EDGAR’s system (must be 1994 or later).
- Edgar
Period - A fiscal period (year + quarter) used to locate quarterly index directories.
- Edgar
Urls - Base URLs for the different SEC EDGAR service endpoints.
- Feed
Options - Options for customizing SEC feed requests.
- Filing
Options - Options for filtering and configuring filing queries.
- Frame
- Aggregated data for a specific concept across all companies for a time period.
- Hit
- A single search result representing a matching SEC filing.
- Hits
- Container for search results including total count and individual hit documents.
- Index
Response - Mutual
Fund Ticker - Mutual fund ticker with series and class identifiers.
- Search
Options - Configurable options for searching SEC EDGAR filings.
- Search
Response - Response container from the EDGAR search API containing search metadata and results.
- Submission
- A company’s submissions payload (
/submissions/CIK##########.json). - Total
Hits - Total count of matching documents and the relationship type.
Enums§
- Edgar
Error - Comprehensive error type for all EdgarKit operations.
- Quarter
- Fiscal quarter (Q1-Q4).
Constants§
- VERSION
- Current crate version
Traits§
- Company
Operations - Operations for retrieving company information and financial data.
- Feed
Operations - Operations for accessing EDGAR Atom and RSS feeds.
- Filing
Operations - Operations for accessing SEC filings and related documents.
- Index
Operations - Operations for retrieving daily and quarterly filing indices.
- Search
Operations - Operations for searching EDGAR filings with flexible criteria.