ib-insync
Python sync/async framework for Interactive Brokers API
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a running TWS or IB Gateway application (version 1023 or higher) with API port enabled and 'Download open orders on connection' checked.
- 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 · maintenance · safety
BSD (permissive) — BSD permissive license allows commercial and private use with minimal restrictions.
last release 2023-07-02 (1139 days) · last repo commit 2024-03-14 · 3,285 stars · archived
0 known vulnerabilities (OSV.dev, 2026-08-14) · 784,858 downloads/mo, #5,070 on PyPI
Alternatives
Verify before relying
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)- 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.
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 on this page. Verify before relying on it.
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
ib-insync on PyPI
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.
Requires a running TWS or IB Gateway application (version 1023 or higher) with API port enabled and 'Download open orders on connection' checked.
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)
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 the current Python release >=3.6 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 4 packageseventkitnest-asynciodataclassesbackports.zoneinfo |
| Maintenance | Abandoned 1,139 days since the last release |
| Last repo commit | repository archived |
| First released | |
| Downloads | 784,858 / month, #5,070 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Office/Business :: Financial :: Investment |
Evidence: ib_insync-0.9.86-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “interactive brokers api python”
- ib-insyncProvides a Python async/sync interface to Interactive Brokers' Trader…
- ib_asyncib_async provides a Python interface to Interactive Brokers' Trader…
- backtraderBacktrader is a Python backtesting and live trading engine that…
Give your agent the search over MCP, or paste the wish link into any chat.
More Investment packages
Generates country- and subdivision-specific government holiday calendars on demand, supporting 250 country codes with optional language localization and holiday categories.
Fetches financial and market data from Yahoo Finance's public APIs, including ticker information, historical prices, and live streaming data.
However, do not use it for commercial applications or high-volume data collection without confirming compliance with Yahoo's terms of service.
Provides elementary financial functions (IRR, NPV, PMT, and others) that were deprecated and removed from NumPy, offering a dedicated replacement for financial calculations.
However, given the aging status (no releases since 2019) and unclear compatibility with modern Python and recent numpy versions, verify that it works with your target…
CCXT is a unified API library for connecting to and trading on more than 100 cryptocurrency exchanges and prediction markets, supporting both REST and WebSocket protocols with normalized cross-exchange data access.
Official Python client for accessing live and historical market data from Databento, supporting multiple asset classes, schemas, and data formats with normalized message structures.
Install it if you need programmatic access to Databento's historical or live market data; skip it if you don't have a Databento account or need data from a different…
EdgarTools parses SEC EDGAR filings into typed Python objects and pandas DataFrames, extracting financial statements, insider trades, fund holdings, and other filing types with a consistent API.
The main gotcha is that you must provide an email to the SEC with every request, but that is a documented requirement.
See also ib_async · metatrader5 · kiteconnect · growwapi · aeventkit · python-binance · eventkit · finvizfinance · shioaji