Date Range on Order History API Endpoint

I have now completed the building my own SQL Server database using T212 API Calls. The problem is keeping it up to date and there is one API Endpoint which makes this more than a little tiresome and this will become increasingly so as my order history increases in size. For those who don’t know, this endpoint is restricted to 6 calls each minute and the maximum number of entries allowed to be retrieved on each call is 50. That means my program has to sleep for 10 seconds between each call.

I would like to be able to use this endpoint with a date range in a way similar to downloading history from the platform. This will benefit both API users and Trading 212 because we will then be able to update our database tables without retrieving the whole history each time.

1 Like

Firstly, I like your style :slight_smile:

Whilst I agree that query filters (e.g. date, time, status etc) might be useful for that API Endpoint, I would expect there are workarounds in code that are also possible.

The endpoint can deliver the most recent 50 order history every minute, of which your db could remove duplicates compared to the current SQL table!

Can I ask what your end goal is? Real time or historical. I prefer to use the endpoints for tracking stock price changes (every 5 mins) and generate the generated report CSV’s nightly.

Happy to discuss further.

1 Like

How up to date are you looking for your system to be?

I scrape the contract notes to google sheets as I don’t trade a lot and what I buy today, I won’t sell today.

I didn’t know that order history data was delivered in reverse chronological order. Knowing that helps a lot.

My aim is just to maintain my own copy of history in an up to day state so the last 50 is fine and you can withdraw my request.

1 Like