Learn· Guide

How to Connect Trading 212 to Openbook: The API Key Guide

A friendly, step-by-step guide to connecting your Trading 212 account to Openbook with a read-only API key — how to generate the key, what to copy, and how to stay safe. No technical skills needed.

· Updated 27 July 2026· 9 min read

Connecting your Trading 212 account to Openbook lets you see all your holdings in one place — with live performance, dividend tracking, and Openbook's Reward and Risk scores layered on top. You do it with something called a read-only API key, which sounds technical but really isn't. This guide walks you through the whole thing in plain English.

The short version: you generate a key inside the Trading 212 app, copy two values across to Openbook, and you're done. It takes about two minutes, and because the key is read-only, Openbook can look at your portfolio but can never place a trade or move your money.

!
Openbook only ever reads your holdings. A read-only key cannot buy, sell, or withdraw anything.

What you'll need

Before you start, make sure you have:

  • A Trading 212 account — either Invest or Stocks ISA (both work).
  • The Trading 212 app on your phone, or Trading 212 open in a web browser.
  • About two minutes.

That's it. You don't need to install anything or understand any code.

What an API key actually is (and why it's safe)

Think of an API key as a read-only guest pass to your account. Instead of handing over your Trading 212 username and password, you create a special pass that grants only the permissions you choose — in this case, permission to look at your account data and portfolio, and nothing more.

Trading 212 actually gives you two values when you create one: an API Key ID and a Secret Key. They work as a pair, a bit like a username and password that only ever talk to each other. You'll copy both into Openbook — the API Key ID into the "API key" box, and the Secret Key into the "API secret" box.

Three things keep this safe:

  • Read-only permissions. You'll only switch on the "Account data" and "Portfolio" permissions. Openbook never asks for — and you should never grant — permission to trade.
  • Encrypted storage. Once you connect, Openbook encrypts your key with bank-grade AES-256 encryption and stores it as scrambled text. It's never kept in plain sight.
  • You stay in control. You can disconnect in Openbook at any time, and you can delete the key entirely inside Trading 212 whenever you like.

Before you start: one key per account

This trips a lot of people up, so it's worth knowing up front. In Trading 212, your Invest account and your Stocks ISA are two separate accounts. Each one needs its own API key.

So if you want to import both, you'll generate one key for Invest and a second key for your ISA, and connect each to Openbook separately. If you only have one of them, you only need one key.

!
If you have both an Invest account and a Stocks ISA, generate a separate key for each.

There's also a Practice account (Trading 212's demo mode with pretend money). Keys generated in Practice only work with Practice, and keys from your Live account only work with Live — so keep track of which one you're in.

How to generate your Trading 212 API key

Here's the part everyone worries about, broken into small steps. The wording below matches exactly what you'll see in the Trading 212 app.

1. Open the API settings and tap "Generate API key". In Trading 212, go to Settings → API (Beta). On the mobile app the Settings menu sits behind your profile icon; on the web it's in the main menu. The feature is labelled "Beta" — if you can't find it, update your app to the latest version. Then tap the blue Generate API key button.

The Trading 212 API (Beta) screen with the blue Generate API key button at the bottom.
Settings → API (Beta), then tap Generate API key.

2. Name the key, set the permissions, and choose IP access. On the New API key screen, three things matter:

  • Name it "Openbook Analytics" so you'll recognise it later.
  • Under Permissions, switch on only "Account data" and "Portfolio". Leave everything else off — especially anything under Orders.
  • Under IP access restrictions, choose Unrestricted. Openbook connects from its own secure servers, not from your phone or laptop, so restricting the key to your own device's IP address would stop it working.

Then tap Generate key (which agrees to Trading 212's API Terms).

!
The key is read-only, so even set to "Unrestricted" it can never trade or withdraw — it can only read your holdings.
The Trading 212 New API key form showing the Name field, the IP access restrictions options, and the Account data permission toggle.
Name it, switch on Account data + Portfolio only, and choose Unrestricted.

3. Copy your API Key ID and Secret Key. Trading 212 now shows two values: an API Key ID and a Secret Key. Copy both. When you connect on Openbook, the API Key ID goes in the API key box and the Secret Key goes in the API secret box.

!
Your Secret Key is shown only once — the moment the key is created. Copy it straight away. If you lose it you can't get it back; you'd just delete the key and generate a fresh one.
The Trading 212 screen after a key is created, showing the API Key ID and the Secret Key, with a note that the secret is only visible at creation.
Copy both — the Secret Key can't be viewed again afterwards.

4. Treat both values like a password. Don't share them, post them anywhere, or email them to yourself in plain text. Anyone with your API Key ID and Secret Key could read your portfolio.

Connect it to Openbook

With your key and secret copied, the Openbook side takes under a minute.

1. Open the connect window. On Openbook, go to your Portfolio page and choose Import from Trading 212, or head to Account → Settings and connect from your broker connections. A short three-step window opens.

2. Set up your account details. Choose the account type (Invest or Stocks ISA) that matches the key you generated, pick the environment (Live or Practice), and choose your display currency (GBP or USD) — this is simply how your totals are shown, converted at Openbook's live exchange rate. You can change the currency later on the Portfolio page.

3. Paste your API key and API secret. Drop the two values into their matching boxes and select Connect.

Openbook checks the credentials with Trading 212, imports your positions and cash, and automatically builds a portfolio for you on the Portfolio page — tagged so you always know it came from Trading 212. Holdings on the London and US markets are matched to Openbook securities so you get full scores and research pages for each one.

Tips for a smooth connection

A few small things make the difference between "it just worked" and "why won't it connect":

  • Match the account type to the key. A key generated on your Invest account won't validate if you pick "Stocks ISA" in Openbook, and vice versa.
  • Match Live vs Practice. Use the same environment you were in when you created the key.
  • Copy carefully. Stray spaces at the start or end of the key or secret are the most common cause of a rejection. Openbook trims obvious whitespace, but a clean copy-paste is best.
  • Expect a couple of "unmatched" lines. Openbook covers UK (London) and US listings. Holdings on other exchanges — say, a stock listed in Frankfurt or Amsterdam — still count toward your totals but won't get an Openbook research page. That's normal, not an error.

Keeping your Trading 212 account secure

Connecting is designed to be low-risk, but it's your money, so here's exactly where you stand:

  • Read-only means read-only. With only "Account data" and "Portfolio" granted, the key physically cannot trade or withdraw.
  • Your key is encrypted at rest. Openbook stores it as encrypted ciphertext, never plain text, and never shows it back to you or anyone else.
  • Disconnecting is not the same as revoking. If you disconnect in Openbook, it deletes Openbook's encrypted copy of your key and the portfolio it created — but the key itself stays alive on Trading 212's side. To switch it off completely, delete the key inside Trading 212 under Settings → API. It's good housekeeping to do both if you ever stop using the connection.

Troubleshooting

"Trading 212 rejected these credentials." Usually one of three things: a typo or stray space in the key or secret, the wrong account type selected (Invest vs Stocks ISA), or a Live/Practice mismatch. Double-check each, and if in doubt, generate a fresh key in Trading 212 and try again.

"Rate limit reached — try again in a minute." Trading 212 limits how often its API can be called. Wait sixty seconds and retry — nothing is wrong.

"I can't find API (Beta) in Trading 212." It's a beta feature, so make sure your app is updated to the latest version. It lives under Settings → API (Beta).

"Some of my holdings are missing." Check the "unmatched" count on the holdings view. Instruments outside the UK and US markets aren't matched to an Openbook page by design; their value still counts toward your totals.

If Trading 212 changes their app, their own reference is the official Trading 212 API help article — but the steps above are written specifically for connecting to Openbook.

Ready to connect?

Once your Trading 212 portfolio is in Openbook, everything else opens up: live performance, dividend income tracking, diversification checks, and Reward and Risk scores on every holding. Head to your Portfolio page to start the import, or browse more Learn guides if you'd like to read first.

Frequently asked

Common questions

Is it safe to connect Trading 212 to Openbook?
Yes. You connect with a read-only API key, which only grants permission to view your account data and portfolio — it cannot place trades or move money. Openbook encrypts the key with AES-256 encryption, stores it as ciphertext rather than plain text, and never displays it back. You can disconnect at any time, and delete the key entirely inside Trading 212 whenever you choose.
Can Openbook place trades or withdraw my money?
No. As long as you grant only the "Account data" and "Portfolio" permissions when you create the key, it is physically read-only. There is no permission that would let Openbook buy, sell, or withdraw, and Openbook never asks for one.
Do I need a separate key for my ISA and Invest accounts?
Yes. In Trading 212, your Invest account and your Stocks ISA are separate accounts, and each needs its own API key. Generate one key per account and connect them to Openbook individually. If you only have one of the two, you only need a single key.
Where do I find my API key in Trading 212?
Open Trading 212 and go to Settings, then API (Beta), then tap Generate API key. On the mobile app the Settings menu sits behind your profile icon; on the web it's in the main menu. After you set the name, permissions and IP access and tap Generate key, Trading 212 shows an API Key ID and a Secret Key — those are the two values you paste into Openbook. If you don't see API (Beta), update your app to the latest version, as it's a beta feature.
What if I lose my API secret?
Your Secret Key (the API secret) is shown only once, when you first create the key, and can't be recovered afterwards. If you lose it, simply delete that key in Trading 212 under Settings, API, and generate a new one — then reconnect on Openbook with the fresh API Key ID and Secret Key.
How do I disconnect or fully revoke access?
Disconnecting in Openbook removes Openbook's encrypted copy of your key and the portfolio it created, but it does not switch the key off on Trading 212's side. To fully revoke access, delete the key inside Trading 212 under Settings, API. For a clean break, do both.
Why are some of my holdings missing or marked "unmatched"?
Openbook matches holdings on the UK (London) and US markets to its own research pages. Instruments listed on other exchanges are left unmatched by design — their value still counts toward your account totals, but they won't get an Openbook link or scores. A few unmatched lines is expected and not a sign anything went wrong.
Does connecting Trading 212 cost anything?
No. Connecting your Trading 212 account and importing your portfolio is free on Openbook. You generate the API key inside Trading 212 at no cost, and there's no charge to sync your holdings.
Put it into practice
Track your investments with Openbook

Free for UK investors. Connect your holdings, see live performance and dividend tracking, and pick up where this guide leaves off.