Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting all filled orders from the Binance API

I am working on a trading bot and I wanted to train it by getting a list of my order history from Binance for a specific period of time. I looked at the API documentation here, but it seems that I am always required to provide a ticker symbol. While iterating over all tickers is an option, it will take forever to complete (I'm trying to get data for a full year). Can anyone point me to a less stupid way of doing this?

P.s. I also looked into allOrdersList but that only provides OCO orders and that is different than regular orders. See here. Any help would be greatly appreciated.

like image 818
Rangel Milushev Avatar asked Jun 29 '20 12:06

Rangel Milushev


1 Answers

It's not currently possible (still, as of June 2021).

Many developers are complaining about the lack of such a commonly-used endpoint. See https://dev.binance.vision/t/fetch-all-account-orders/279

The only workarounds seems to be:

  • Looking at the user's current coin balances, and iterating over those relevant trading pairs (although this will miss the trades where the balance is now zero)

  • Iterate over every symbol offered by Binance. This is ridiculous, and requires careful management of rate limits, but appears to be the only comprehensive solution.

Add your voice to the thread above, so that perhaps Binance might implement a more sane endpoint.

like image 143
Simon East Avatar answered Oct 06 '22 20:10

Simon East