Skip to main content

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:

  1. Downloads the latest TWS API zip file from https://interactivebrokers.github.io/
  2. Extracts only the Python client (IBJts/source/pythonclient)
  3. Commits the extracted code to a git branch
  4. Tags the commit with the API version number
  5. (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):

  1. Open https://interactivebrokers.github.io/ in your browser
  2. Find the download link in the table (usually the third row: tr.linebottom:nth-child(3) > td:nth-child(2) > a)
  3. Right-click and copy the link address
  4. 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 → version 1040.01
  • twsapi_macunix.1051.00.zip → version 1051.00

Git Workflow

  1. The Python client code is copied to the ibapi/ directory
  2. Changes are committed with message: Update IB API to version X.XX
  3. 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:

  1. Download the TWS API zip from https://interactivebrokers.github.io/
  2. Extract the zip file
  3. Copy IBJts/source/pythonclient/* to ibapi/ in this repository
  4. 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

Metadata

Release files for ibapi-stable 10.50.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ibapi-stable 10.50.2
File Size Uploaded Provenance
ibapi_stable-10.50.2.tar.gz 162.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ibapi-stable 10.50.2
File Interpreter ABI Platform
ibapi_stable-10.50.2-py3-none-any.whl Python 3 none any Details

Total release size: 574.0 kB

Release files / ibapi_stable-10.50.2.tar.gz

Download URL ibapi_stable-10.50.2.tar.gz
Size 162.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3cb1fa3356145b8a6c7d6f70ef5bdbc6f56e376f838e977009b3fce59df00954
BLAKE2b-256 checksum
How to use checksums
96c236f73c336d4006fe3fbf4c0eeff57fba828f282674f4cf9b91528ff45fa7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release files / ibapi_stable-10.50.2-py3-none-any.whl

Download URL ibapi_stable-10.50.2-py3-none-any.whl
Size 411.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e3142009030173869dcd4039826370e42ab3be1563d2e5892326562f7aa5fbab
BLAKE2b-256 checksum
How to use checksums
f10f9379842825af8bf8f03e61782d806d67e9ece5b680bccab708db9d48d15c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Security for ibapi-stable 10.50.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ibapi_stable-10.50.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page