ibkr 0.2.0

A Rust client for the Interactive Brokers TWS API
Documentation
  • Coverage
  • 71.15%
    111 out of 156 items documented1 out of 55 items with examples
  • Size
  • Source code size: 79.88 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 8.36 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 39s Average build duration of successful builds.
  • all releases: 39s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • wxveio/ibkr
    1 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • AG3NTZ3R0

ibkr

A Rust client for Interactive Brokers' TWS API.

Usage

use ibkr::{Client, Contract, BarSize, Duration, WhatToShow};

#[tokio::main]
async fn main() -> ibkr::Result<()> {
    let client = Client::connect("127.0.0.1:7496", 1).await?;

    let contract = Contract::stock("AAPL", "SMART", "USD");
    let bars = client.historical_data(
        contract,
        Duration::Days(5),
        BarSize::Day1,
        WhatToShow::Trades,
        true,
    ).await?;

    for bar in bars {
        println!("{}: {}", bar.date, bar.close);
    }
    Ok(())
}

Architecture

See CLAUDE.md.

IBKR Documentation

https://www.interactivebrokers.com/campus/ibkr-api-page/twsapi-doc/#api-introduction