EarningsFeed Rust SDK
Official Rust client for the EarningsFeed API — SEC filings, insider transactions, and institutional holdings.
Installation
Add to your Cargo.toml:
[]
= "0.1"
= { = "1", = ["rt-multi-thread", "macros"] }
Quick Start
use EarningsFeed;
async
Features
- Async/await — Built on tokio and reqwest
- Streaming pagination — Auto-pagination with
Stream - Type-safe — Full Rust type definitions
- Builder patterns — Ergonomic parameter construction
Usage
SEC Filings
use ;
use StreamExt;
use pin;
let client = new?;
// List filings with filters
let params = builder
.ticker
.forms
.limit
.build;
let filings = client.filings.list.await?;
// Iterate through all filings (auto-pagination)
let params = builder
.ticker
.forms
.build;
let filings_resource = client.filings;
let mut stream = pin!;
while let Some = stream.next.await
// Get filing details with documents
let detail = client.filings.get.await?;
for doc in detail.documents
Insider Transactions
use ;
use StreamExt;
use pin;
let client = new?;
// Recent insider purchases
let params = builder
.ticker
.direction
.codes // Open market purchases
.limit
.build;
let purchases = client.insider.list.await?;
for txn in purchases.items
// Large sales across all companies
let params = builder
.direction
.min_value
.build;
let insider_resource = client.insider;
let mut stream = pin!;
while let Some = stream.next.await
Institutional Holdings (13F)
use ;
use StreamExt;
use pin;
let client = new?;
// Who owns Apple?
let params = builder
.ticker
.min_value // $1B+ positions
.build;
let holdings = client.institutional.list.await?;
for h in holdings.items
// Track a specific fund (Berkshire Hathaway)
let params = builder
.manager_cik
.build;
let institutional_resource = client.institutional;
let mut stream = pin!;
while let Some = stream.next.await
Companies
use ;
let client = new?;
// Get company profile
let company = client.companies.get.await?;
println!;
println!;
if let Some = company.sic_codes.first
// Search companies
let params = builder
.q
.state
.limit
.build;
let results = client.companies.search.await?;
for company in results.items
Error Handling
use ;
let client = new?;
match client.filings.get.await
Configuration
use ;
use Duration;
// Custom configuration
let config = builder
.api_key
.timeout
.base_url // Optional, this is the default
.build?;
let client = with_config?;
API Reference
Full API documentation: earningsfeed.com/api/docs
License
MIT