It seems like the CSV download of historic orders provides more insightful data than the historic orders API. While the API allows you to see the trading price in the currency that the share was bought in, the CSV provides the data on the final resultant cost per order in GBP. Additionally, OTC orders different level of data to limit orders unlike the CSV download.
When using the portfolio endpoint, it does not seem possible to convert the share values to the same currency without introducing rates from elsewhere. The web UI provides the share values in a consistent GBP currency.
Is there perhaps a way to get the data from the CSV download into a json endpoint as opposed to a download request? Additionally, is there a way to get a consistent currency as a resultant value in the portfolio endpoint?
The API is available only for virtual funds, and there are no immediate plans to introduce support for real money accounts. Iāll keep you posted, though.
These are both functionalities that are not yet developed, but weāll keep your feedback in mind once we allocate more resources to this project. Meanwhile, you can make use of the appās CSV generator or tools such as CSV to JSON - CSVJSON.
API is looking good.
If I have multiple currencies on my demo account - is there a way to specify which to use in the API? I couldnt find this in the documentation and it seems it will always use the default account currency (will ignore if I select to trade in asset currency in options).
Trying the use the API demo for a equity, place market buy order, using target server - demo.trading212.com, and am getting a UNDEFINED error, clarification āInsufficientFreeForStocksExceptionā. Is a market BUY order been enabled ? I can do a market SELL order
Hi, Iām really enjoying the API so far. I have been using it for months, and it has definitely had a hand in encouraging me to re-sub my ISA with T212!
Would it be possible to have the āinstruments metadataā response include the market exchange name? Eg. āLondon Stock Exchangeā
Hi T212,
This a great new feature and long awaited so thank you! Iāve been trying it out and whilst the functionality works great, I would suggest changing the auth mechanism to OAuth (an industry standard) which would greatly improve security for us and you.
As Iām not using this api personally, I have an app with a sizeable number of users, currently I effectively have to ask each user to copy and paste the token into my app for it to work.
Not only do I have to rely on them selecting the correct permissions for my app to work, I also donāt want to end up with api keys that have excessive permissions (such as execute order).
These problems are solved with OAuth as the app would ask for the correct permissions. It would also benefit T212 to use OAuth as then you would have a better understanding of what apps are using your apis, be able to regulate who is given the Exec Order permission, and regulate api rate limiting.
Great work so far!
Iāve just opened an account with Trading 212 on the promise of the API which is excellent, but I cannot place live orders, this is super disappointing. I would move over Ā£100k of funds into Trading 212 if you supported order execution via the API. Currently Iām stuck with US brokers such as Alpaca or BIKRās awful API. Yourās looks perfect, but the lack of order execution means its not usable.
+1 to the above comments - itās a huge pity to have the API available on demo to submit orders, but to not have that functionality on real money accounts.
I am currently in the live stage testing of an algorithm, and it would be nice to be able to link this to my already existing T212 account rather than set up a new account with another broker.
Iām sure the community would love an update on the status of moving from Beta
At the time, itās not possible as we donāt support API for Value orders.
InsufficientFreeForStocksException is shown when there are not enough free funds to place a Buy order. Check if thereās enough balance before sending the request.
You can use Limit & Stop orders to create Take profit & Stop loss. E.g. if you open a position at a $100 current price, you can place a Limit SELL order with a Limit price of $110, which will be a 10% profit.
Happy to hear that, @Antidev You can get the instrument exchange name using the workingScheduleId property of the instrument:
Each exchange has a list of workingSchedules [id, timeEvents].
Map instrument workingScheduleId to its respective exchange.
Thanks for the suggestion We will consider it once we restart the developments on the Public API.
Not sure about this one You can give ChatGPT a try - you should be able to use anything that sends REST requests.
The Public API is still in beta testing, and we donāt have an ETA on when we will resume the developments. We will definitely keep you in the loop, though.
Im trying to do a simple query using the API which is fetch my pies along with their data.
In order to achieve that I have to first fetch the Pie ids using one function and then for each id I got to fetch each pie separately. For each pie you fetch there is a rate limit of 30s.
I understand the rate limit to avoid overhead, but the way your API works adds overhead. cause if I have 6 Pies I have to make 1 + 6 calls and for every call have a delay of 30 seconds. Why not a single call and get back a json with all my pies details and their instruments?
I know that API is something new, this is my feedback, lets make it better!
keep up the good work!