https://github.com/secapi-ai/secapi-rust
Official Rust SDK for SEC API
https://github.com/secapi-ai/secapi-rust
financial-data rust sdk sec-api sec-edgar
Last synced: 10 days ago
JSON representation
Official Rust SDK for SEC API
- Host: GitHub
- URL: https://github.com/secapi-ai/secapi-rust
- Owner: secapi-ai
- License: mit
- Created: 2026-05-21T00:47:32.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-05-21T00:48:48.000Z (about 1 month ago)
- Last Synced: 2026-05-21T19:35:07.886Z (30 days ago)
- Topics: financial-data, rust, sdk, sec-api, sec-edgar
- Language: Rust
- Homepage: https://docs.secapi.ai
- Size: 5.86 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SEC API Rust SDK
Bootstrap async Rust client for SEC API.
## Representative workflows
- canonical entity resolution and search
- filing lookup, accession reads, and section reads
- all-statements bundle
- offerings, market calendar, and volatility signal utilities
- MCP info discovery
## Example
Methods return `Result`: HTTP failures, non-2xx API responses (with parsed JSON body when possible), JSON decode errors, and invalid `x-api-key` header values are surfaced instead of being ignored.
```rust
use sec_api_sdk_rust::SecApiClient;
#[tokio::main]
async fn main() {
let api_key = std::env::var("SECAPI_API_KEY")
.or_else(|_| std::env::var("OMNI_DATASTREAM_API_KEY"))
.ok();
let client = SecApiClient::new(api_key);
let entity = client.resolve_entity(&[("ticker", "AAPL")]).await.unwrap();
let filing = client.latest_filing(&[("ticker", "AAPL"), ("form", "10-K")]).await.unwrap();
let section = client.latest_section("item_1a", &[("ticker", "AAPL"), ("form", "10-K"), ("mode", "compact")]).await.unwrap();
println!("{} {} {}", entity["name"], filing["id"], section["title"]);
}
```
`OmniDatastreamClient` remains available for existing integrations.
## Environment variables
| Variable | Description |
|---|---|
| `SECAPI_API_KEY` | Preferred SEC API key variable |
| `OMNI_DATASTREAM_API_KEY` | Legacy fallback for existing integrations |
| `SECAPI_BASE_URL` | Preferred API base URL override |
| `OMNI_DATASTREAM_BASE_URL` | Legacy base URL override fallback |
## Release path
- crate metadata lives in `packages/sdk-rust/Cargo.toml`
- smoke command: `bun run smoke:sdk-rust`
- package verification command: `cargo test --examples` or `cargo run --example basic`