Trading 212 API Update šŸ› ļø

It will be useful if ā€œNet Depositsā€ value can be added to /api/v0/equity/account/summary endpoint. Currently, its a tricky call to the transactions endpoint and compute it on the go.

Hi,

I tried to read all my past transactions

It works for the first 2 pages, then the returned nextPagePath seems it’s broken:

GET https://live.trading212.com/api/v0/equity/history/transactions?limit=20&cursor=uuid&time=2026-01-01T00:00:00.000Z

404 Not Found: ā€œ{ā€œtypeā€:ā€/api-errors/entity-not-found",ā€œtitleā€:ā€œRequested entity not foundā€,ā€œstatusā€:404,ā€œdetailā€:ā€œTransaction with id (uuid) not found.ā€,ā€œtraceIdā€:ā€œ****ā€}"

Quick update: You can now place Limit, Stop, and Stop Limit orders via the API on real-money accounts. This change is already live for everyone. The public documentation is currently being regenerated and will be updated shortly.

3 Likes

This is good news :blush:. Do you have any plans to update so multi-currency is also supported?

For now, orders can only be placed using your main account currency. We’ll let you know if multi-currency support becomes available in the future.

Excellent news. I had to get new authorisation keys to make this work. I have successfully cancelled an existing order and set up a new limit order in my ISA account. This didn’t work yesterday but now it works well!

Thanks for your efforts. This is such a simple to use API compared to other API’s I have used in the past, for that alone the programmers should be commended! .

I have a share quantity of 5.59032128 shares ( I assume this has happened because I had purchased by value).
Using the API:
I tried to sell all the shares and got a error returned ā€œinvalid quantity precision 4ā€.
I tried to sell 5.59 shares with the hope that T212 would sensibly sell the lot and I got a message ā€œmust have opened position at least 1.00ā€.
How can I sell these shares using the API?

Yes, it’s caused by ordering by value, which I did at the very beginning and before I knew any better. It didn’t take me long to also work out that every order by value (ie via pies) is a market order, so I switched to limit orders and manual importing into the appropriate pie.

That still left me with some equities with annoying share quantities to 8-decimal places. I’m sufficiently OCD that this drove me crazy. I don’t know whether this will work via the API because API pie end-points are deprecated anyway, but the solution I found was:

  1. export 100% of the problem security from its pie, if not already outside of a pie;
  2. then import it back into its pie (create one if necessary);
  3. the second modal asks what quantity you want to import. The slider will not give you a round number, but you can click on the number of shares (it takes a little precision) and then enter a sensible number.
  4. the rounding error remains still outside of the pie. You can do a market sell, for example, on 100% of that rounding error because you can’t directly sell a security that is in a pie.

It would be great if there was a way to tell which of the stocks are buyable and sellable on CFD from the list of instruments on API.

Here in the list of all the instruments Get all available instruments you could just add two (or more) fields to tell, whether the instrument is present on CFD and also whether it’s also shortable i.e. Remaining Sell Quantity is above 0. Or just add 2 fields for remaining buy and sell quantities.

Because a lot of times I get a signal with a list of stocks that look good for shorting, but maybe one out of 5 is able to be actually shorted and it’s a pain to check every stock manually.

Thank you! This was a much-needed implementation! I’m lucky this functionality was added just before I started looking to use the API to place orders.

It could be argued that T212 has an active incentive not to do that because they’re the counterparty to any CFD trade.

I had a look at the list of available trading instruments (which doesn’t require being logged in), but it only tells you the buy limit, not the sell limit. If the buy limit were sufficient, you could find the public, non-API endpoint that provides those data as JSON (I did). Not terribly difficult to do, but the URL has a long random string in it, and finding where that string comes from might be a little more challenging.

The only other alternative that comes to mind is a Selenium-based solution that relies on being logged in. If you are tempted to do that, be sure to check the Terms of Service permit such activity, or your account could be suspended.

No, I’m specifically after the sell quantity. And yes I know of the endpoint you are talking about.

@Veselin.V Can we also place delete/cancel orders via the API already?
Thanks.

Are market orders currently the only order type that support extended hours trading through the API? I tried sending a limit order through during extended hours and the order remains pending, and only market orders seem to support the extendedHours boolean option in the body of the request as per the API.

As market orders are especially dangerous during extended hours due to larger spreads, it would be hugely beneficial if we could enable extended hours for limit orders (and stop orders) sent to the API. That way, we would have the full functionality that the app provides. Thank you!

@KevinLevin, it’s possible to cancel orders via the API.

@TradingWiz, аt the moment, only market orders are supported for Extended Hours Trading.

I’m trying to imput my API and Secret key into GetQuin but it keeps saying the key is invalid. I’ve tried this 2 or 3 times with the same result. The help page on GetQuin says that it only works with App Version 2.196.1

I don’t know if this is T212 or GetQuin. Both are on my desktop in a browser.

Any suggestions

Any update on get transactions (api/v0/equity/history/transactions) ?
First page and 2nd page work using nextPagePath returned by nthe API, but starting with 3rd page it fails if I follow nextPagePath.

{
"type": "/api-errors/entity-not-found",
"title": "Requested entity not found",
"status": 404,
"detail": "Transaction with id ***** not found.",
"traceId": "******"
}