bezant
Ergonomic async Rust client for the Interactive Brokers Client Portal Web
API, layered over the auto-generated bezant-api
crate.
See the workspace root for the full picture: https://github.com/isaacrowntree/bezant.
Quick feature tour
Client::new/builder()— sane defaults for talking to the Gateway (self-signed certs, 30s timeout, cookie jar, useful user-agent).spawn_keepalive— drop-to-stop background task that tickles/tickle.health()/auth_status()— typed check against/iserver/auth/statusreturningNotAuthenticated/NoSessionas distinct errors.all_positions— auto-paginated helper across/portfolio/{id}/positions/{page}.SymbolCache— ticker → conid resolver with per-session memoisation.WsClient— WebSocket streaming using the REST session's cookie, with typed subscribe helpers for market data / orders / PnL.api()— escape hatch onto the full generated client for endpoints this facade doesn't wrap explicitly.
Example
use Duration;
async
Runnable examples
The examples/ directory ships three canonical recipes:
# health check only
# paginated positions
IBKR_ACCOUNT_ID=DU123456
# real-time quotes over WebSocket
IBKR_SYMBOL=AAPL
Each example defaults to the bundled Docker gateway at
https://localhost:5000/v1/api. Set IBKR_GATEWAY_URL to override.
License
Dual-licensed under MIT or Apache-2.0 at your option.