Fetch all account orders

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:

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

19 Likes

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…

4 Likes

Being able to fetch all trade without ticker and in a paginated way is really a mandatory feature.

It’s a win win, since it will ease developers life, while requiring less charge on binance server, since binance servers won’t be spammed with batch of requests for all existing pairs (when most of them probably do not have any trade records)
As well as solving issues like disabled pairs etc…

11 Likes

Any idea if this is on the backlog or ever will see the light of day? Would LOVE to have this endpoint. Bruteforcing it by pair is just way too expensive.

People have been waiting an endpoint like this for years;


10 Likes