Guide
BrokerStocksETFs API key

Trading 212 API guide

Trading 212 is one of the UK’s and Europe’s biggest commission-free apps; its beta API finally allows automation of an Invest or ISA account.

Last verified · Also known as Trading 212 API, Trading212 API, T212 API

Quick answer

Trading 212 has an official Public API in beta for Invest and Stocks ISA accounts. You create a key and secret under Settings → API (Beta) and send them as HTTP Basic auth. It reads the portfolio, cash and history and places orders; in the live environment only market orders are supported, orders are in the primary account currency, and order endpoints are not idempotent, so never blindly retry.

Trading 212 API at a glance

Pricing
Free; beta with live market orders only
Availability
UK and EU (Invest and Stocks ISA accounts)
Paper trading
Practice (demo) account with its own keys
Integration type
REST + API key
In AlgoGP
Design and backtest in AlgoGP, connect the exported code
Auth
API key + secret as HTTP Basic
Accounts
Invest and Stocks ISA (not CFD)
Live orders
Market orders only, primary currency
Demo
demo.trading212.com with its own keys

Beta limits to design around

  • Order endpoints are not idempotent: a retried request can create a duplicate order. Check open orders before retrying.
  • Live trading accepts market orders only; limit and stop orders work in demo.
  • Ordering by value is not supported; send a quantity.
  • At most 50 pending orders per ticker, and per-account rate limits on every endpoint.

Build a Trading 212 strategy with AlgoGP

AlgoGP does not connect to Trading 212 natively yet. Trading 212 uses plain HTTPS with an API key, so it is a good candidate for a native adapter; it is not built in yet.

  1. 1

    Design and backtest in AlgoGP

    Describe the strategy to the copilot and backtest it on years of normalized history. The result does not depend on any vendor.

  2. 2

    Export the Python project

    Every project exports strategy.py, market_data.py, brokers.py and live.py. The strategy only sees bars, cash, positions and orders, never a vendor’s wire format.

  3. 3

    Plug in Trading 212

    Implement the four adapter methods (account, positions, submit_market_order and a candle fetcher) with Trading 212’s SDK, or keep a built-in platform for paper trading and add Trading 212 when you go live.

Built-in brokers for the same markets: Alpaca, Tradier, Interactive Brokers.

Trading 212 API: frequently asked questions

Does Trading 212 have an API?

Yes, a beta Public API for Invest and Stocks ISA accounts.

Can I use the Trading 212 API for CFDs?

No, CFD accounts are not supported.

Design and backtest your Trading 212 strategy first

AlgoGP turns an idea into Python and tests it on years of history before you connect it to Trading 212. The exported code keeps the broker behind four small adapter methods.

  • AI copilot writes and revises the rules
  • Backtests with realistic costs
  • Exported Python ready to wire to Trading 212

Free plan, no card required.

Trading 212 alternatives

Independent guide. AlgoGP is not affiliated with Trading 212. Limits, prices and availability change; confirm them in the official documentation. Nothing here is investment advice.

Build a strategy