--- id: ib-insync version: "0.9.86" license: BSD license_treatment: permissive maintenance: abandoned --- # ib-insync — Python sync/async framework for Interactive Brokers API License: permissive · Maintenance: abandoned · Downloads: 784.9K/mo ## What it is and what it does ib-insync is a Python framework that wraps Interactive Brokers' Trader Workstation (TWS) API to simplify programmatic trading and market data retrieval. It provides both synchronous and asynchronous interfaces built on asyncio and eventkit, allowing developers to write linear-style code or build advanced async applications. The library automatically keeps an IB component in sync with a running TWS or IB Gateway application, handling connection state and data updates transparently. The package is designed for traders and developers who need to fetch historical data, place orders, or monitor live market data from Interactive Brokers without directly managing the low-level protocol. It supports Jupyter notebooks for interactive exploration and includes utilities for converting market data to pandas DataFrames. However, the repository is now archived with no active maintenance, meaning new API changes or Python compatibility issues will not be addressed. Use it for: - Download historical OHLC data for backtesting or analysis from Interactive Brokers. - Build async trading bots that monitor live prices and execute orders programmatically. - Explore market data interactively in Jupyter notebooks with automatic data synchronization. - Retrieve account information, positions, and order status from a running TWS or IB Gateway. - Develop multi-asset trading strategies that react to real-time market events. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a Python async/sync interface to Interactive Brokers' Trader Workstation API, automating connection management and data synchronization with live market data. Yes, if you actively trade with Interactive Brokers and need a Python interface to TWS—the library is mature and widely used. However, proceed with caution: the repository is archived and unmaintained since March 2024. Install only if your TWS version and Python environment are stable, and be prepared to fork or patch the code if you encounter compatibility issues. ## Install pip install ib-insync uv add ib-insync poetry add ib-insync ## Installing ib-insync Before you install: Low install friction with a pure-Python wheel. Repository is archived and last release was over a year ago; maintenance is inactive, so bug fixes and compatibility updates are unlikely. License in practice: BSD permissive license allows commercial and private use with minimal restrictions. Quickstart: pip install ib-insync from ib_insync import IB, Forex ib = IB() ib.connect('127.0.0.1', 7497, clientId=1) contract = Forex('EURUSD') bars = ib.reqHistoricalData(contract, endDateTime='', durationStr='30 D', barSizeSetting='1 hour', whatToShow='MIDPOINT', useRTH=True) Requires a running TWS or IB Gateway application (version 1023 or higher) with API port enabled and 'Download open orders on connection' checked. Verify before relying: - Whether the package remains compatible with current TWS/IB Gateway versions post-abandonment. - Whether all runtime dependencies (eventkit, nest-asyncio, backports.zoneinfo) are actively maintained. - Whether the package works reliably with Python 3.10 and 3.11 given the lack of recent updates. ## Package facts - License: BSD (permissive) - Python support: supports_current - Install friction: low - Maintenance: abandoned - Downloads: 784.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags interactive brokers api python, tws api wrapper, ib gateway python client, async trading api, market data sync python, interactive brokers historical data, asyncio trading framework, trading-api, asyncio-framework, market-data [View on SkillFed](https://skillfed.io/packages/ib-insync) · [View on PyPI](https://pypi.org/project/ib-insync/)