Broker API HubMenu

Choosing a broker API for Python

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.

Independent and unofficialChecked For: Python hobbyists and quants

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.

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.

    github.comchecked

  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.

    github.comchecked

  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.

    github.comchecked

  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.

    github.comchecked

  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.

    github.comchecked

  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.

    github.comchecked

  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.

    github.comchecked

  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.

    pypi.orgchecked

  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.

    github.comchecked

Sources

Sections