Crate edgarkit

Crate edgarkit 

Source
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§

parsing

Structs§

CompanyConcept
Historical data for a single XBRL concept across a company’s filings.
CompanyFacts
Complete set of XBRL facts reported by a company across all filings.
CompanyTicker
Mapping between stock ticker symbols and company CIKs.
CompanyTickerExchange
Company ticker with exchange information included.
DetailedFiling
A normalized filing record derived from the “recent filings” table.
Directory
Directory listing payload for filings and entities.
DirectoryItem
A file entry inside a directory listing.
DirectoryResponse
Response wrapper for EDGAR index.json directory listings.
Edgar
EdgarConfig
Configuration settings for the Edgar HTTP client.
EdgarDay
A specific day in EDGAR’s system (must be 1994 or later).
EdgarPeriod
A fiscal period (year + quarter) used to locate quarterly index directories.
EdgarUrls
Base URLs for the different SEC EDGAR service endpoints.
FeedOptions
Options for customizing SEC feed requests.
FilingOptions
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.
IndexResponse
MutualFundTicker
Mutual fund ticker with series and class identifiers.
SearchOptions
Configurable options for searching SEC EDGAR filings.
SearchResponse
Response container from the EDGAR search API containing search metadata and results.
Submission
A company’s submissions payload (/submissions/CIK##########.json).
TotalHits
Total count of matching documents and the relationship type.

Enums§

EdgarError
Comprehensive error type for all EdgarKit operations.
Quarter
Fiscal quarter (Q1-Q4).

Constants§

VERSION
Current crate version

Traits§

CompanyOperations
Operations for retrieving company information and financial data.
FeedOperations
Operations for accessing EDGAR Atom and RSS feeds.
FilingOperations
Operations for accessing SEC filings and related documents.
IndexOperations
Operations for retrieving daily and quarterly filing indices.
SearchOperations
Operations for searching EDGAR filings with flexible criteria.

Type Aliases§

Result