Interactive Brokers Python API
Project description
IB API Python - Automated Publisher
This project automatically downloads the Interactive Brokers TWS API Python client and publishes it to PyPI.
Overview
The Interactive Brokers TWS API is distributed as a zip file containing multiple language bindings. This project:
- Downloads the latest TWS API zip file from https://interactivebrokers.github.io/
- Extracts only the Python client (
IBJts/source/pythonclient) - Commits the extracted code to a git branch
- Tags the commit with the API version number
- (Future) Publishes to PyPI automatically
Quick Start
Method 1: Automatic (if web access is unrestricted)
# Get the download URL from the IB website
python get_download_url.py
# Update the IB API using the URL from above
python update_ibapi.py <download_url>
Method 2: Manual URL
If automatic scraping doesn't work (e.g., due to firewall/proxy restrictions):
- Open https://interactivebrokers.github.io/ in your browser
- Find the download link in the table (usually the third row:
tr.linebottom:nth-child(3) > td:nth-child(2) > a) - Right-click and copy the link address
- Run the update script:
python update_ibapi.py <download_url>
Example:
python update_ibapi.py https://interactivebrokers.github.io/downloads/twsapi_macunix.1040.01.zip
How It Works
Version Detection
The version is automatically extracted from the zip filename. For example:
twsapi_macunix.1040.01.zip→ version1040.01twsapi_macunix.1051.00.zip→ version1051.00
Git Workflow
- The Python client code is copied to the
ibapi/directory - Changes are committed with message:
Update IB API to version X.XX - A git tag is created:
vX.XX
File Structure
ibapi-python/
├── README.md # This file
├── get_download_url.py # Helper script to fetch download URL
├── update_ibapi.py # Main automation script
├── scrape_and_publish.py # Legacy script (alternative method)
└── ibapi/ # IB Python client code (created after first run)
├── client.py
├── wrapper.py
└── ...
Requirements
pip install requests beautifulsoup4
Manual Steps (Alternative)
If you prefer to do it manually:
- Download the TWS API zip from https://interactivebrokers.github.io/
- Extract the zip file
- Copy
IBJts/source/pythonclient/*toibapi/in this repository - Commit and tag:
git add ibapi/
git commit -m "Update IB API to version X.XX"
git tag -a vX.XX -m "Version X.XX"
Future Enhancements
- Automatic publishing to PyPI
- GitHub Actions workflow for scheduled checks
- Version comparison to detect updates
- Automated testing of the Python client
- setup.py for PyPI packaging
License
The IB API code is proprietary to Interactive Brokers. This automation tool is provided as-is.
Support
For issues with:
- The IB API itself: Contact Interactive Brokers
- This automation tool: Open an issue in this repository
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ibapi_stable-10.37.2.tar.gz.
File metadata
- Download URL: ibapi_stable-10.37.2.tar.gz
- Upload date:
- Size: 90.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
189b22896beadea81da0c88c4145897ef0fff8dc92a68970281b3227afec2672
|
|
| MD5 |
f99cb1c52fe8823e903643b0fab9775a
|
|
| BLAKE2b-256 |
97ca4ead4f48fd2985bba4653c75a544918d1ebd81512170406aaf600dde1dd7
|
Provenance
The following attestation bundles were made for ibapi_stable-10.37.2.tar.gz:
Publisher:
update-ibapi-stable.yml on deepentropy/ibapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ibapi_stable-10.37.2.tar.gz -
Subject digest:
189b22896beadea81da0c88c4145897ef0fff8dc92a68970281b3227afec2672 - Sigstore transparency entry: 701526024
- Sigstore integration time:
-
Permalink:
deepentropy/ibapi@449f37c03e4bd8a4c02bf07737bce9c5dd02c54d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/deepentropy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
update-ibapi-stable.yml@449f37c03e4bd8a4c02bf07737bce9c5dd02c54d -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file ibapi_stable-10.37.2-py3-none-any.whl.
File metadata
- Download URL: ibapi_stable-10.37.2-py3-none-any.whl
- Upload date:
- Size: 115.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6b616c9530979d440e1e6d24f47d9a287763626ded07e7fffb1890064b51989
|
|
| MD5 |
62aea3e07c2addd771f4826f904cc757
|
|
| BLAKE2b-256 |
965fdb648859e80d7f707a85a746b7333d3abefb82fbb9d7d72713110d33b989
|
Provenance
The following attestation bundles were made for ibapi_stable-10.37.2-py3-none-any.whl:
Publisher:
update-ibapi-stable.yml on deepentropy/ibapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ibapi_stable-10.37.2-py3-none-any.whl -
Subject digest:
a6b616c9530979d440e1e6d24f47d9a287763626ded07e7fffb1890064b51989 - Sigstore transparency entry: 701526026
- Sigstore integration time:
-
Permalink:
deepentropy/ibapi@449f37c03e4bd8a4c02bf07737bce9c5dd02c54d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/deepentropy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
update-ibapi-stable.yml@449f37c03e4bd8a4c02bf07737bce9c5dd02c54d -
Trigger Event:
workflow_dispatch
-
Statement type: