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

+1 for the feature.

2 Likes

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.

1 Like

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.

7 Likes

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.

4 Likes

at less we need API to fetch trading history for one asset with pagination

2 Likes

If I understand it correctly, you can paginate using fromId.

Can there be list of past trades just for symbols. For example in the past I traded
-ETHUSDT
-BTCUSDT

but for now I do not have BTC and ETH in my wallet. Can there be a list of all past symbols. Just a list without any price,quantity,time information.

I do not believe this should be as heavy as you suggest. The applications of binance itself (the windows app, or the website) can request that information in not time. So a webservice / API should be able to do it in the same time.

There are two things incorrect with this answer. First: The websocket gives you actual data, not data from the past. Does it?

Second what should I do when I am asleep, my PC is down, my application is also down. The next morning I wake up and I want to collect all modified / filled orders. What is the correct way to go? How can storing a local copy know about the order that are given. Maybe I gave some orders on the Binance app in bed, so my application does not know about it.

1 Like

I also think this endpoint is mandatory. I use other exchange APIs like Kraken and Bitmex and I can get my historical trades from one endpoint without having to loop over every possible asset.

You say that looping over assets is expensive, but surely that’s not how your devs would write this endpoint. In the Binance database surely each trade record has a foreign key to an account or user. So just use the reverse relationship there. Simple SQL stuff surely?

I like Binance a lot. But I hit your API over 400 times (looping over assets) which takes 15-20 minutes) to get my account historical trades. This is bad for me and bad for you. Surely there is a better way Binance devs! Please take a look at this again.

33 Likes

“But I hit your API over 400 times (looping over assets) which takes 15-20 minutes) to get my account historical trades.”

What about separate symbols in 20 groups and load each group info via its own proxy?

Of course it can not be difficult to implement becase Binance already has order API without required symbol. When you go to order history in your Binance account HERE you can see that symbol is not required, only date range which is not a problem. This allows to traverse through whole orders history. Binance uses it`s own internal API gateway for that. Try network inspect and you will see calls to this URL https://www.binance.com/gateway-api/v1/private/streamer/order/get-trade-orders which is not available for public. Please Binance take a look on that. Current version of orders API is very poor and unusable. This thread already has many views and votes. Many devs are interested about it. Thank you.

13 Likes

Agree 100%. It’s ridiculous for the largest crypto exchange in the world not to have this endpoint already for the public, especially considering the volume of unnecessary calls to the API they cause by that… Makes you wonder…

2 Likes

I landed here to say the same - it’s already available from UI, so I bet they don’t loop over all the symbols like we do. That would be crazy.
I’m quite surprised that this basic functionality is not available. It was reported ages ago :confused:

2 Likes

It is so weird to see that for such an important feature nothing has been planned and more disappointing to see only 56 developers voted so far! Since it is all available on Binance private API, I assume that it shouldn’t be so hard to prepare it for the Public API as well. Come on Binance developers!! I hope someone saves us from this struggle soon!

2 Likes

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.

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.

2 Likes

@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: