Trading 212 API Available for real money accounts

Our Trading 212 API, previously exclusive to demo users, is now accessible for real money account holders. You can generate multiple tokens with different permission levels for each application or service. Currently, order execution isn’t available, but we plan to enable it soon.

You can create API tokens by visiting your account settings in the platform’s web version. Management in mobile will be available soon.

We value your feedback on the following aspects:

  1. Usability: Is the API intuitive? Can we improve the documentation?
  2. Features: What additional features or data endpoints would you like added?
  3. Performance: Feedback on response time and reliability.
  4. Security: Thoughts on the token permission system and suggestions for enhanced security?

Your feedback will guide improvements for current and future versions. Thank you for participating in this development. We appreciate your input.

12 Likes

First of all, I would like to express my appreciation towards Trading 212 for always implementing new features.

Would it be possible to use this API with yahoo finance to auto update our portfolio?

Hello,

Great news that the API is now available for real money accounts!!

I still have some questions:

1.) How can I get the real ticker of a instrument:

For “Rocket Lab USA” with the real ticker “RKLB” I get this ticker:
Bildschirmfoto 2023-05-19 um 13.12.22

For “Airbus” with the real ticker “AIR” I get this ticker:
Bildschirmfoto 2023-05-19 um 13.15.05

2.) How can I get the exchange rate for stocks in foreign currency? Must I use extern sources?

3.) How can I get the invested value about a stock? Based only on subtracting the profit/loss from the current market value?

  1. You cannot. We are not using the exchange ticker to execute orders and therefore only have our internal reference ticker to expose.
  2. Market data is unfortunately something that is very costly to redistribute and we aim to keep this free as this is our mantra.
  3. Quantity * AveragePrice will get you there.
1 Like

Thanks looking good ! is there a roadmap to add the ability to manage pots ? i.e. rebalance, add ticket etc. that would be excellent.

We will expand the API in the following weeks. And yes, pies are in the pipeline.

1 Like

You always comes through with amazing stuff for free, it’s seriously mind-blowing! Thank you so much for that.
I was going through the documentation and noticed that we can only place orders using your internal tickers, right? All the examples I saw had something like “ticker”: “AAPL_US_EQ”. It would be awesome if we had the option to use something more universal like the ISIN or a more widely recognized identifier.

1 Like

Fetching the account cash (/api/v0/equity/account/cash) I can see that the returned total is not the same as the amount in “Account Value”, in the app’s header. Is there a delay to the API value (or vice-versa)?

Also, what does ppl mean? Comparing with the data in the app, I can see it’s the current return, but it would be nice to have the definition in the API docs.

1 Like

Hello @noop ,

Enjoying the API so much :slight_smile:
I have a suggestions for starters.
https://t212public-api-docs.redoc.ly/#operation/orders_1 It would be super helpful if we had a way to handle the returned data. Your web uses filters like olderThan :slight_smile: this way we would only be able to request smaller chunks of data.

Also, what is the default ordering for the orders history api? Seems like date desc but would be great to have a bit more visibility.

Edit: It would be super useful to have an action field just like the CSV download. Any you might consider making this a filter as well. This way, a user can achieve what they wanted with less requests :slight_smile:

Few notes here;

filledQuantity seem to be NULL and when mapped with UI I can see the data for this field. Yes, the docs mention “Applicable to quantity orders” but then there is no way to understand how much I purchased.

Quick example to illustrate;
I purchased Apple, paid £3 and 0.0218819 is my Filled Qty.
The order filled for $171.15. If I knew the exchange rate at the time, I could find my filled quantity. But the api is missing exchange rate so I cannot get filled quantity.
I mean if there is away to calculate this, maybe Im missing it

Not sure dateExecuted is intentionally null

dateModified and dateCreated not users local time :slight_smile: The web UI return 18 May 2023, 15:01 and API return 2023-05-18T14:01:37.000Z

Thanks!

1 Like

@danguilherme basically ppl is the return value you see on your portfolio;
See screenshots and the data from the API;

{
    "free": 49433.65,
    "total": 50184.50,
    "ppl": 184.78,
    "result": 0.00,
    "invested": 566.07,
    "blocked": null
}

Hope this helps :pray:t2:


Will this be available for use within the ISA account?

I am unsure about the regulations for ISAs in this area.

Also; I’d like to post this idea here as it related to the API concept.
(Sub account feature for upcoming API)

3 Likes

@JamesJohn I have integrated the API with my ISA account and running analysis on it :blush:
So if I understood you correctly, yes it works with ISA account.
Please note; I have not tested any POST end points.

1 Like

First try:

The API says “free: 3.93”, but my account says £3.91.

Something’s a bit wrong.

1 Like

One more suggestion / request would be to add a field on /metadata/instruments endpoint which is shortName. On the UI when we search for BCPT we get .

  {
    "ticker": "FCPTl_EQ",
    "type": "STOCK",
    "isin": "GG00B4ZPCJ00",
    "currency": "GBX",
    "shortName": "BCPT",
    "fullName": "Balanced Commercial Property Trust",
    "description": "Balanced Commercial Property Trust Ltd",
    "countryOfOrigin": "GG",
  }

But on the API we get,

    {
        "ticker": "FCPTl_EQ",
        "type": "STOCK",
        "workingScheduleId": 59,
        "isin": "GG00B4ZPCJ00",
        "currencyCode": "GBX",
        "name": "Balanced Commercial Property Trust",
        "minTradeQuantity": 1.00000000,
        "maxOpenQuantity": 99884.00000000,
        "addedOn": "2018-07-12T07:10:22.000EEST"
    }

Adding the shortName would help developers to better handle the data.
I have written a logic to map all Trading212 tickers with various sources already :slight_smile: But still many would enjoy this change.

1 Like

Would love to be able to take advantage of using this to automate some of my portfolio tracking, just dont have the time to play with it. if anyone finds a portfolio tracker tool or has some tips on how I can pull simple info like Holdings / Portfolio value etc to Excel/CSV automated or has any websites utilising this API then please let me know :slight_smile:

1 Like

Looks like the Javascript option is now removed from the API :wink:
Will there be no XHR support @noop ?

hi is it possible to use this API on trading view or any other execution platform ? thank you