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.45.1

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.45.1
File Size Uploaded Provenance
ibapi_stable-10.45.1.tar.gz 160.5 kB With provenance Details

Built distribution (wheel)

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

Total release size: 487.4 kB

Release files / ibapi_stable-10.45.1.tar.gz

Download URL ibapi_stable-10.45.1.tar.gz
Size 160.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b85d28e562b4dd3368dce5db349ede4ebd2bc7bef0bca967e90d3bf8d7f019ad
BLAKE2b-256 checksum
How to use checksums
2a541c3d7983d2939b2b01659660e928378b404eff82ecd09fb60c091bd33570
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 Sep 24, 2026.

Transparency log

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

Download URL ibapi_stable-10.45.1-py3-none-any.whl
Size 326.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
006e24c012f5e77059858b2e7ed5f1e10fbd85125096cbe5acd0c5c2adbf6b80
BLAKE2b-256 checksum
How to use checksums
3c734b2d9d4b9e947ee200ff5436d7a684b2386441dd8f2d58ed877fb63d7cc6
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 Sep 24, 2026.

Transparency log

Security for ibapi-stable 10.45.1

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.45.1.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 Sep 24, 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