skillfed

ib_async

Python sync/async framework for Interactive Brokers API

ib-async v2.1.0 628.4K downloads/30d#5,674 on PyPI1,715
Permissive license BSD Active released

What it is and what it does

ib_async is a Python library that wraps the Interactive Brokers API, providing a clean async-first interface to TWS and IB Gateway. It eliminates the need to use IB's official ibapi package by implementing the IBKR binary protocol internally, and handles connection management, data synchronization, and event handling automatically. The library is built on asyncio and eventkit, making it suitable for both simple scripts and high-performance applications.

You use it to stream live market data, request historical bars, place and monitor orders, track positions and account balances, and analyze contract details—all from Python without dealing with callback complexity. It supports Jupyter notebooks through a special loop mode, and includes reconnection logic and comprehensive logging for production use. The library requires a running IB Gateway or TWS instance to connect to, and supports Python 3.10 and later.

Use it for:

  • Stream live stock, forex, or options quotes and build real-time market data dashboards
  • Backtest and deploy algorithmic trading strategies with programmatic order placement and monitoring
  • Track portfolio positions, account balances, and P&L in real-time across multiple accounts
  • Analyze historical price data and option chains for research and strategy development
  • Build risk management tools that monitor exposures and trigger automated hedges or alerts

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

ib_async provides a Python interface to Interactive Brokers' Trader Workstation and IB Gateway, enabling programmatic access to market data, order placement, and portfolio management through an async-first API.

Yes. ib_async is actively maintained, production-stable, has low install friction, and offers a permissive BSD license. It solves a real problem—providing a modern async Python interface to Interactive Brokers—without requiring IB's official ibapi package. Install it if you need programmatic access to IB's trading and market data APIs. The only prerequisite is running IB Gateway or TWS locally.

Install

ib-async on PyPI

pip

pip install ib-async

uv

uv add ib-async

poetry

poetry add ib-async

Installing ib_async

Before you install

Low friction installation with three lightweight runtime dependencies. Active maintenance with recent commits and production-stable status. Requires Python 3.10 or higher and a running IB Gateway or TWS instance.

License in practice

BSD permissive license allows commercial and private use with minimal restrictions, making it suitable for production trading applications and research tools.

Quickstart

pip install ib_async

from ib_async import IB, Stock

ib = IB()
ib.connect('127.0.0.1', 7497, clientId=1)
contract = Stock('AAPL', 'SMART', 'USD')
ticker = ib.reqMktData(contract, '', False, False)
print(f"Last: {ticker.last}")
ib.disconnect()

Requires a running IB Gateway or TWS instance with API enabled on the specified port (default 7497 for TWS, 4001 for Gateway). Python 3.10 or higher required.

Verify before relying

  • Whether the package handles reconnection and error recovery automatically in production scenarios
  • Performance characteristics when streaming high-frequency market data or managing large portfolios
  • Compatibility with different IB Gateway versions and any known breaking changes

Package facts

License BSD (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 3 — aeventkit, nest_asyncio, tzdata
Maintenance actively maintained — 249 days since the last release
Last repo commit
First released
Downloads 628,366/month — #5,674 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: ib_async-2.1.0-py3-none-any.whl

Keywords: ibapi, tws, asyncio, jupyter, interactive, brokers, async, ib_async, ib_insync

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: Other/Proprietary LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Office/Business :: Financial :: Investment

Tags

interactive brokers api pythonib gateway trading clientasync market data streamingprogrammatic order placementtws api wrapperreal-time portfolio trackingibkr python client
trading-apiasynciomarket-data

More Investment packages