ibapi
Automated publisher for the Interactive Brokers TWS API Python client on PyPI.
๐ฆ Installation
Two packages available on PyPI:
Latest Version (Recommended)
pip install ibapi-latest
Stable Version
pip install ibapi-stable
You can also install a specific version:
pip install ibapi-latest==10.40.01
pip install ibapi-stable==10.37.02
๐ Usage
from ibapi.client import EClient
from ibapi.wrapper import EWrapper
from ibapi.contract import Contract
class IBApp(EWrapper, EClient):
def __init__(self):
EClient.__init__(self, self)
app = IBApp()
app.connect("127.0.0.1", 7497, clientId=1)
app.run()
For complete examples and documentation, visit the official IB API documentation.
๐ About This Package
This is an unofficial automated publisher for the Interactive Brokers TWS API Python client. The source code is from Interactive Brokers' official TWS API distribution, packaged and published to PyPI for easy installation.
โ ๏ธ DISCLAIMER
This package is NOT officially affiliated with, endorsed by, or supported by Interactive Brokers LLC. It is an independent community project that automates the packaging and distribution of the official IB API source code.
- The IB API source code is proprietary to Interactive Brokers and is licensed under the TWS API Non-Commercial License
- This automation tool is provided "as is" without any warranties
- For official support, please contact Interactive Brokers
- Trading involves risk. Use at your own discretion.
Two PyPI Packages
ibapi-latest: The newest IB API version (from main branch)
ibapi-stable: Previous IB API versions (from stable branch)
Both packages are automatically updated weekly when new IB API versions are released.
๐๏ธ Project Structure
ibapi/
โโโ .github/
โ โโโ workflows/ # GitHub Actions for automation
โ โโโ update-ibapi-latest.yml # Latest version publisher
โ โโโ update-ibapi-stable.yml # Stable version publisher
โโโ scripts/ # Automation scripts
โ โโโ get_download_url.py # Fetch IB API download URLs
โ โโโ update_ibapi.py # Download and commit IB API
โ โโโ check_and_update.py # Orchestrator (legacy)
โโโ ibapi/ # IB API Python client (auto-updated)
โ โโโ ibapi/
โ โโโ client.py
โ โโโ wrapper.py
โ โโโ ...
โโโ pyproject.toml # Package configuration
โโโ README.md
๐ How It Works
Automated Workflow
- Weekly Check: GitHub Actions runs every Monday at 9:00 AM UTC
- Version Detection: Scrapes https://interactivebrokers.github.io/ for new versions
- Download & Extract: Downloads the TWS API zip and extracts the Python client
- Auto-Fix: Automatically fixes version strings and package configuration
- Build & Publish: Builds the package and publishes to PyPI
- Tag & Release: Creates git tags and GitHub releases
Version Management
- Versions follow IB's format:
10.40.01, 10.37.02, etc.
- Git tags:
v10.47.01-latest (latest channel), v10.46.01-stable (stable channel)
- PyPI packages:
- Latest:
ibapi-latest==10.40.01
- Stable:
ibapi-stable==10.37.02
๐ License
This project has a dual license structure:
IB API Source Code (ibapi/ directory)
The Interactive Brokers TWS API source code is proprietary software owned by Interactive Brokers LLC and is licensed under the TWS API Non-Commercial License.
Key restrictions:
- โ
Use for personal trading and account management
- โ
Develop internal proprietary tools for your own IB account
- โ NOT permitted: Selling software to third parties
- โ NOT permitted: Distributing software to generate indirect financial benefit (e.g., commissions)
- โ ๏ธ Requires: Active Interactive Brokers account
For commercial use, contact Interactive Brokers at: opensource@interactivebrokers.com
Full license text: See LICENSE file
Automation Scripts (scripts/ directory, workflows)
The automation tooling that packages and publishes the IB API is licensed under the MIT License.
See the LICENSE file for complete details.
๐ Links
๐ Support
For issues with:
โ๏ธ Configuration
The package configuration is in pyproject.toml:
[project]
name = "ibapi"
dynamic = ["version"] # Version from ibapi.__version__
dependencies = ["protobuf==5.29.3"]
[tool.setuptools]
packages = ["ibapi", "ibapi.protobuf"]
package-dir = {"" = "ibapi"} # Maps ibapi/ibapi/* to ibapi/*
This ensures imports work as expected:
from ibapi.client import EClient # Not from ibapi.ibapi.client