Skip to content

Basic Concepts

voyz edited this page May 2, 2024 · 5 revisions

Core Functionality

IBind's core functionality consists of two client classes:

  • IbkrClient - for IBKR REST API

    Using the IbkrClient requires constructing it with appropriate arguments, then calling the API methods.

  • IbkrWsClient - for IBKR WebSocket API

    Using the IbkrWsClient involves handling three areas:

    • Managing its lifecycle. It is asynchronous and it will run on a separate thread, hence we need to construct it, start it and then manage its lifecycle on the originating thread.
    • Subscribing and unsubscribing. It is subscription-based, hence we need to specify which channels we want to subscribe to and remember to unsubscribe later.
    • Consuming data. It uses a queue system, hence we need to access these queues and consume their data.

Their usage differs substantially. Users are encouraged to familiarise themselves with the IbkrClient class first.

Client Portal Gateway Dependency

You need to have a running Java-based Client Portal Gateway in order to successfully communicate with the IBKR CP Web API.

We recommend using IBeam to automate and simplify starting the Gateway and keeping it alive.

IBeam logo

IBeam (the authentication tool) is also built and maintained by the authors of IBind (this Python client library), and the two projects are meant to support one another.


Next

Learn about the IbkrClient.