ib_async
Python sync/async framework for Interactive Brokers API
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-asyncuv
uv add ib-asyncpoetry
poetry add ib-asyncInstalling 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
Tags
More Investment packages
Generates country- and subdivision-specific…
permissive · top 1,000 on PyPI
yfinanceFetches financial and market data from Yahoo…
permissive · top 1,000 on PyPI
numpy-financialProvides elementary financial functions (IRR,…
permissive · top 5,000 on PyPI
ccxtCCXT is a unified API library for connecting to…
permissive · top 5,000 on PyPI
databentoOfficial Python client for accessing live and…
permissive · top 5,000 on PyPI
edgartoolsEdgarTools parses SEC EDGAR filings into typed…
permissive · top 5,000 on PyPI
ib-insyncProvides a Python async/sync interface to…
permissive · top 15,000 on PyPI
kiteconnectOfficial Python client for the Kite Connect…
permissive · top 15,000 on PyPI
snaptrade-python-sdkPython SDK client for SnapTrade's brokerage…
permissive · top 15,000 on PyPI
python-binanceUnofficial Python wrapper for the Binance…
permissive · top 15,000 on PyPI
py-clob-clientPython client library for trading on…
permissive · top 15,000 on PyPI
growwapiSDK for connecting to Groww's trading platform…
permissive · top 15,000 on PyPI
injective-pyInjective Python SDK provides client libraries…
permissive · top 15,000 on PyPI
fyers-apiv3Official Python client library for the Fyers…
permissive · top 15,000 on PyPI
polymarket-clientOfficial Python SDK for Polymarket that…
permissive · top 15,000 on PyPI