# Choosing a broker API for Python

Independent and unofficial. Not affiliated with or endorsed by any broker or platform named here. Educational only: nothing here is advice, and nothing here recommends a broker or a trade.

This is the markdown version of https://openbrokerapi.com/guides/choosing-python-broker-api, written from the same records as that page.

Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.

The honest state of the Python wrapper ecosystem for retail broker APIs. Star count is a bad guide, because the most starred options are archived.

- Checked: 2026-09-23
- For: Python hobbyists and quants

## Steps

### 1. Do not pick by stars

Star count measures how many people once thought a repository looked useful. It does not measure whether the code still runs against the broker it wraps. On the Python side of retail broker APIs the two facts point in opposite directions: the single most starred wrapper we track is archived, and the package that replaced it has roughly half its stars. Judge a wrapper on three things you can read in under a minute on its own repository page: the date of the last push, the open issue count, and whether the broker or platform vendor publishes the package itself. Everything below is those three readings, taken on 23 September 2026.

Status: verified. Source: [github.com](https://github.com/erdewit/ib_insync), checked 2026-09-23.

### 2. Interactive Brokers: ib_insync is archived, ib_async is the live fork

erdewit/ib_insync carries 3,282 stars and was last pushed on 14 March 2024. It is archived, so nothing new lands in it. The work moved to ib-api-reloaded/ib_async, 1,742 stars, last pushed on 19 August 2026. This is the clearest case of stars pointing the wrong way. A search result, and an AI assistant trained on older code, will very often hand you ib_insync. Read the archive banner before you build on it.

Status: verified. Source: [github.com](https://github.com/ib-api-reloaded/ib_async), checked 2026-09-23.

### 3. IBKR sessions are hard enough to have their own tools

Voyz/ibeam and Voyz/ibind exist because keeping an IBKR Client Portal session alive is genuinely awkward: the gateway wants a browser login and the session has to be kept warm. If you are choosing IBKR for a Python project, budget for session handling as a separate problem from the trading logic, and look at those two before you write your own keepalive loop.

Status: verified. Source: [github.com](https://github.com/Voyz/ibeam), checked 2026-09-23.

### 4. IG: trading-ig is the only actively maintained wrapper

ig-python/trading-ig carries 374 stars and was last pushed on 2 September 2026. It is community code rather than an IG package, but it is the only IG wrapper we track that is still moving. If you want an IG project in Python, this is the practical starting point, and the session and confirm behaviour it implements is the part worth reading before you trust it.

Status: verified. Source: [github.com](https://github.com/ig-python/trading-ig), checked 2026-09-23.

### 5. OANDA: the usual wrapper has not been pushed since 2023

hootnot/oanda-api-v20 carries 416 stars. Its last push was 11 December 2023. That is not the same as broken, because OANDA's v20 REST surface has been stable, but it does mean nobody is fixing it for you. Read the open issues before you commit, and be ready to call the REST API directly.

Status: verified. Source: [github.com](https://github.com/hootnot/oanda-api-v20), checked 2026-09-23.

### 6. cTrader and TradeLocker: official, small, slow moving

spotware/OpenApiPy is the official cTrader Python package: 192 stars, last pushed 7 August 2024. TradeLocker/tradelocker-python is official too: 57 stars, last pushed 18 December 2024. Small star counts on vendor packages mean very little. What matters is that the vendor publishes them, so a protocol change and the package that speaks it come from the same place. Slow pushes on a vendor package are a different risk from slow pushes on community code: the vendor can change the protocol without updating the package.

Status: verified. Source: [github.com](https://github.com/spotware/OpenApiPy), checked 2026-09-23.

### 7. XTB: the wrapper is archived

federico123579/XTBApi is archived. Treat any XTB Python project that depends on it as unmaintained code you now own.

Status: verified. Source: [github.com](https://github.com/federico123579/XTBApi), checked 2026-09-23.

### 8. MetaTrader 5: a PyPI package, and it needs a Windows terminal

MetaQuotes ships MetaTrader5 for Python on PyPI, not on GitHub, so there is no repository to read and no star count to mislead you. The constraint is different and bigger: the package talks to a MetaTrader 5 terminal running locally on Windows. No terminal, no API. That rules it out for a Linux container or a cheap always on VPS unless you are willing to run Windows.

Status: verified. Source: [pypi.org](https://pypi.org/project/MetaTrader5/), checked 2026-09-23.

### 9. The checklist

Open the repository and answer these before you install anything. Is it archived? An archive banner is the end of the conversation. When was the last push, in months rather than years? Anything past about eighteen months on community code is code you are adopting. Who publishes it, the broker or a volunteer? A vendor package ties the protocol and the client together. Community code does not. How many open issues, and are recent ones answered? An unanswered issue from this year tells you more than a thousand stars. Does the broker's own API still exist in the form the wrapper assumes? The wrapper cannot tell you that. The broker's own pages can.

Status: verified. Source: [github.com](https://github.com/ig-python/trading-ig), checked 2026-09-23.

## Sources

- Status: verified. Source: [erdewit/ib_insync (archived)](https://github.com/erdewit/ib_insync), checked 2026-09-23.
- Status: verified. Source: [ib-api-reloaded/ib_async](https://github.com/ib-api-reloaded/ib_async), checked 2026-09-23.
- Status: verified. Source: [ig-python/trading-ig](https://github.com/ig-python/trading-ig), checked 2026-09-23.
- Status: verified. Source: [hootnot/oanda-api-v20](https://github.com/hootnot/oanda-api-v20), checked 2026-09-23.
- Status: verified. Source: [spotware/OpenApiPy](https://github.com/spotware/OpenApiPy), checked 2026-09-23.
- Status: verified. Source: [TradeLocker/tradelocker-python](https://github.com/TradeLocker/tradelocker-python), checked 2026-09-23.
- Status: verified. Source: [federico123579/XTBApi (archived)](https://github.com/federico123579/XTBApi), checked 2026-09-23.
- Status: verified. Source: [MetaTrader5 on PyPI](https://pypi.org/project/MetaTrader5/), checked 2026-09-23.
- Status: verified. Source: [Voyz/ibeam](https://github.com/Voyz/ibeam), checked 2026-09-23.
- Status: verified. Source: [Voyz/ibind](https://github.com/Voyz/ibind), checked 2026-09-23.

## Related pages

- [Getting started with API trading](https://openbrokerapi.com/guides/getting-started-with-api-trading): What an API is, what you need and how to make a first call safely.
- [All guides](https://openbrokerapi.com/guides): Step by step guides, each step with the page it was read on.
- [Brokers](https://openbrokerapi.com/brokers): The record for each broker: access, limits, endpoints and error codes.
- [Platform APIs](https://openbrokerapi.com/platforms): APIs that belong to trading software offered by many brokers.
- [Error codes](https://openbrokerapi.com/errors): What each error means, and the fix where the source gives one.
- [Compare two APIs](https://openbrokerapi.com/compare): The same fields from two records, side by side.
- [Learn to code](https://openbrokerapi.com/learn): A learning track from a first script to a demo account call.

## Licence and how to cite

The records behind this page are all rights reserved. This file is the page itself, at its own address, in another format. It is not part of the CC BY 4.0 downloads listed at https://openbrokerapi.com/data. Quote from it with a link to the page.

Cite as: Choosing a broker API for Python. Broker API Hub, https://openbrokerapi.com/guides/choosing-python-broker-api, newest check 2026-09-23.

Where you rely on a single figure, cite the source and the checked date printed beside it as well. Where this page and a broker's own documentation differ, the documentation wins.
