--- id: ib-async version: "2.1.0" license: BSD license_treatment: permissive maintenance: active --- # ib_async — Python sync/async framework for Interactive Brokers API License: permissive · Maintenance: active · Downloads: 628.4K/mo ## 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 above — 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 pip install ib-async uv add ib-async 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_current - Install friction: low - Maintenance: active - Downloads: 628.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags interactive brokers api python, ib gateway trading client, async market data streaming, programmatic order placement, tws api wrapper, real-time portfolio tracking, ibkr python client, trading-api, asyncio, market-data [View on SkillFed](https://skillfed.io/packages/ib-async) · [View on PyPI](https://pypi.org/project/ib-async/)