New Equity Trading API in Beta - Try it Out in Practice Mode!

Thanks for the feedback @Papaflesas. We’ll have it in mind when we start working on the project again.

1 Like

There seems to be an official API now :astonished::partying_face:

Docs: https://t212public-api-docs.redoc.ly/

It even provides a Swagger Definition: https://t212public-api-docs.redoc.ly/73531b68-5c54-4d5c-80b7-552fd4612d6d

Welcome to the Community, @bennycode :wave:

I moved your post to this topic instead, as the previous one you posted in was quite old and inactive. Seems like you’re a bit late to the party, but yes - there is an official API release now :smile:

1 Like

Any one uses the T212 API with Python?

Hi, Can you add a method to check the granted permissions please. I want to be able to reject tokens with certain permissions. Cheers.

Hi - thanks for a great API.
My question might be a little daft, but here goes.

I’m using history/transactions and python.
The response returns nextpagepath.
I have tried various things e.g. adding the path to the url, breaking it down and supplying the values in nextpagepath to the query, but nothing works. Either i get a response of 500 or nothing.

Any examples of how to use nextpagepath ?

this was posted earlier [quote=“ms32035, post:82, topic:61788”]

[/quote]

it is a good starting point.

I can see the button but order execute is only available for demo accounts
Screenshot 2024-02-02 at 21.24.37

When using the orders option, and when the order is placed for a number for pounds, is there a way to see how many units were purchased with that order? Currently i only see the amount of pounds spent, but not the number of units purchased.

A streaming API via websocket would be perfect for getting continuous data (for various time intervals). It will be a great help if the values of the basic technical indicators (such as MA, BB, MACD, RSI) are available via API.

Hi,
I have been integrating this api with one of my products however there are large gaps in the data provided for historical orders. E.g. It returns I have -6 shares in airbus but there is no matching buy order in any of the pages. Is there a timeline on this being out of beta? Is it still being worked on or has it been parked for now as its coming up to a year since this was announced. Unfortunately this is substantial enough that it means that endpoint is not useful.
Cheers

Hi,

I am looking to extract data for a CFD index and company stock price that I am interested in investigating as part of a personal data science project. I was wondering how possible it was to extract the historical data of stock price and financial information (if available) in the trading212 app and website via a rest API request and then use my own piece of software to analyse it? Any help with this would be greatly appreciated.

Thanks

1 Like

Hey there, first post here so correct me if I‘m in the wrong category or so….

So, I’m using the trading212 API in a python program to automize my trading. I just finalized my code and everything works fine but upon trying to update a pie, the request returns internalError as response. I use the correct endpoint and also tried it in a standalone test surrounding.

Now, the question is if anyone has experience with that endpoint, if it worked for someone already and if so, how did you do it?

Happy to share the code if needed as well.

1 Like

Not sure if this is just an error for me or not
But I believe when I’m getting rated limited, Im getting the 403 response not the 429 as documented.
So it’s saying missing scope rather than Limited 1 / 50s
Only had this happen to me on https://t212public-api-docs.redoc.ly/#operation/instruments so far, but other endpoints haven’t rate limited me yet

Also it would be nice to have a roadmap of the API (even if its just a simple “x feature”, nothing detailed)

I think Trading212 have said there is no development of the API for now while they focus on other things

Hi, will this become available for ISA accounts? It looks to be restricted to Invest & Practice.

1 Like

Suggestions for Enhancing the Trading212 API:

  1. Consider implementing streaming data functionality to provide real-time market updates for instruments.

  2. Explore the possibility of integrating websocket support to enable live data streaming and efficient order execution.

  3. Enhance user experience by providing comprehensive account balance information, including cash balance and equity value.

  4. Introduce features for accessing historical order data, enabling users to perform thorough analysis and track their trading history.

  5. Improve user confidence by implementing trade execution confirmation mechanisms to ensure transparent order processing.

  6. Expand order types to include customizable options such as trailing stop and bracket orders for more advanced trading strategies.

  7. Continuously refine documentation clarity and provide ample examples to facilitate easier integration and usage for developers.

  8. Consider adding endpoints for accessing historical price data, allowing users to conduct in-depth research and analysis.

  9. Explore the feasibility of offering candlestick data for different time intervals to assist users in making informed trading decisions.

  10. Provide historical volume data and market depth information to offer deeper insights into market trends and liquidity.

  11. Include information on corporate actions like dividends, stock splits, and mergers to enable accurate historical analysis.

  12. Offer adjustment factors for events such as stock splits and dividends to ensure the accuracy of historical price data.

  13. Implement reasonable API rate limits and pagination to maintain server stability and prevent overload during data retrieval.

  14. Support various data formats like JSON, CSV, and XML to accommodate diverse user preferences and consumption methods.

  15. Ensure robust error handling mechanisms are in place to gracefully manage data retrieval failures and provide helpful feedback to users.

These suggestions aim to enhance the Trading212 API’s functionality, usability, and reliability, ultimately providing a better trading experience for users.

Any plans to allow order execution on a real money account this year?

4 Likes

Hi,

I’m looking for some help with getting the transaction list using the API. In the documentation it says only cursor key in query dictionary is needed. However, after trying it, I find that the time is also needed. After including it my query dictionary looks like this.

query = {"limit": "20", 'cursor':'cursor_string', 'time':'time_string'}

Implementing this within a loop and updating the cursor and time keys I am able to extract older items in the transaction history. However towards the end of the history I get a Request 500 error. Is there any way to resolve this?

Many Thanks

1 Like

Hi, I am using the API with python. I have reported two problems/bugs in the official email but will post it here for reference too:

  1. Any limit order placed during pre or post market hours will not get filled until the market opens again. I could not find any additional parameter to specify if we want the order to be filled also outside of core market hours.

  2. Any limit order placed with “GTC” as timeValidity will not go through. Specifying the validity as “DAY” works well.