
Why choose Python?
Python has been crowned #1 once again in the “The Top Programming Languages” by IEEE Spectrum, the world’s largest technical professional organization dedicated to advancing technology for the benefit of humanity.
Python language offers robust programming capabilities and is the preferred language for many quant hedge funds and finance professionals. The Python Software Organization offers a Quick Start Guide that walks you through Python installation: https://www.python.org/about/gettingstarted/. You will also need to pick an IDE to code in Python. There are many choices – some of the most popular seem to be Jupyter Notebook, PyCharm, and Spyder.
Why choose IBKR Python API?
API users who build their own automated rules-based trading application can use our API solutions.
If you are a finance professional who’s realized that it is time to start coding, the Python API provides an easier framework compared to Java or C++. Python syntax is more relaxed, and you can practice with the sample code we provide.
Getting Started Resources
Here is a short list of resources that will help you get started:
First, visit IBKR GitHub https://interactivebrokers.github.io/tws-api/ and click on the Python tab.
Get familiar with the all the resources we offer, including information on Initial setup, Architecture, Streaming Market data, Obtaining Historical Data for backtesting, error handling and message codes, and a list of classes, structs, unions and interfaces with brief descriptions.

Next, install the following
- IBKR API from here http://interactivebrokers.github.io/. Please note that the Python sample
Program.py
is installed automatically in samples/Python/Testbed directory
- Find the latest Trader Workstation here: https://www.interactivebrokers.com/en/index.php?f=16040
Finally, be sure to always test your API components with your simulated trading account or the TWS Demo System before you implement any new API system.
- If you already have an IBKR account, you can practice with their simulated trading version.
or - Start a free trial and a simulated account with IBKR here: https://www.interactivebrokers.com/en/index.php?f=1286
Disclosure: Interactive Brokers
The analysis in this material is provided for information only and is not and should not be construed as an offer to sell or the solicitation of an offer to buy any security. To the extent that this material discusses general market activity, industry or sector trends or other broad-based economic or political conditions, it should not be construed as research or investment advice. To the extent that it includes references to specific securities, commodities, currencies, or other instruments, those references do not constitute a recommendation by IBKR to buy, sell or hold such investments. This material does not and is not intended to take into account the particular financial conditions, investment objectives or requirements of individual customers. Before acting on this material, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice.
The views and opinions expressed herein are those of the author and do not necessarily reflect the views of Interactive Brokers LLC, its affiliates, or its employees.
Any trading symbols displayed are for illustrative purposes only and are not intended to portray recommendations.
In accordance with EU regulation: The statements in this document shall not be considered as an objective or independent explanation of the matters. Please note that this document (a) has not been prepared in accordance with legal requirements designed to promote the independence of investment research, and (b) is not subject to any prohibition on dealing ahead of the dissemination or publication of investment research.