Fetch all account orders

Hi.

Is it possible to fetch the whole account order history, without specifying the symbol? This would be used if I would need to fetch orders of all symbols that this account has used.
Ideally, I would expect an API similar to /api/v3/allOrders, but not requiring the symbol parameter, so my client is agnostic of which currencies have been used by the SPOT account.

Thanks in advance,
Ioannis

Hi Ioannis, thank you for the enquiry.

Unfortunately for now these endpoints require specific symbol for each request. There are hundreds of trading symbols in Binance, it requires significant amount of time to loop all of them. So in order to respond in proper time, it is required to give the symbol in the request.

For now, the best solution is to listen to websocket server, any order/trade regardless the symbol will be pushed to client. Having a copy of these data locally will give you the flexibility to search fast without any limit.

It looks like it can not be a really good reason to skip this function.

Look here https://docs.ftx.com/#get-order-history
They have implemented this feature.

Could do you have any idea how it is possible to implement it, please?

There are many of exchanges with has this functions in API.

1 Like

Hi Dino, thank you too for your prompt answer.

Is it possible to receive the history of orders through the WebSocket API? That would be an interesting approach.

Also, taken the amount of required requests and their weight, would it be unrealistic to try fetching all account orders?

Thank you.

Here are just another examples of API with this function.
https://huobiapi.github.io/docs/spot/v1/en/#search-historical-orders-within-48-hours

As you see there are exchanges witch are able to implement this feature.

1 Like

Yes, from websocket stream, you could get all order’s updated information.
https://binance-docs.github.io/apidocs/spot/en/#payload-order-update

this is a recommended approach, without limits.

1 Like

@dino Thanks a lot for all the answers, can you maybe just clarify a bit how exactly could we get historical orders? I managed to connect to streams and receiving events when they happen, but couldn’t figure out how to get historical data (my previous trades)?

@bomb-on Unfortunately it’s not possible to get historical data from websocket, only current orders/trades pushed from stream.

For historical orders or trades, please fetch them from restful endpoints by following the requests limits. :slight_smile:

Hi
fetching history of Trades and order is one of mandatory features for developers who are trying to have their own software to work with Binance.
To calculate profit/loss from the beginning or have a portfolio management software we have to fetch list of full orders and trades in the past.
Fetching history by symbol is the only way that we can use just now, but still there are some problems to do that. iterating over symbols need symbol list from binance that can be fetched using various endpoints like ExchangeInfo. but it shows only active pairs and if you have orders and trades on pairs that were active in past and now they are unlisted from binance you will never reach them. so there is no way to fetch full history of trades and orders.
It would be very useful if binance can provide endpoints to fetch full history of orders/trades
or at least have an endpoint to fetch all traded/ordered pairs of an account

You don’t need external services to get your full history, but yes, you are completely right, it is a mess currently to get all that data:

  • Fetch Exchange Info to get all trading pairs information
  • Fetch User’s Account Information to get current balances (and hope that user never converted dust to BNB)
  • Finally, go through user’s assets and match them with trading pairs from “Exchange Info” response and go fetch all possible trading pairs for each asset (since we cannot tell which pair user actually traded)

As far as I understood, if user converted some asset to BNB (e.g. dust), you won’t be able to tell that user ever traded that asset, so you will have hard time to get trading history for that asset’s pairs…