Hello, I’am currently retrieving the full list of historical orders executed for the symbol BTCUSDT.
My qestion is simple:
There is a way to retrieve the placement timestamp of an historical order?
For example:
{
“id”: 0,
“price”: “4261.48”,
“qty”: “0.1”,
“quoteQty”: “426.148”,
“time”: 1502942428322, // Trade executed timestamp, as same as T in the stream
“isBuyerMaker”: true,
“isBestMatch”: true
}
This one is the first order ever executed for BTCUSDT in Binance, we know that this order was executed at timestamp 1502942428322 but we don’t know the timestamp at which this order was placed. There is a way to retrieve this information?
Thanks.
Ok, just another question: the hisorical order I am retrieving this way are only market buy/sell? or also limit buy/sell? In this case, there is a way todistinguish them?
Your response example seems to come from GET /api/v3/historicalTrades, which doesn’t directly retrieve orders information, it gets trades information. This endpoint returns with trades from all types of orders.
The following field, allows you to identify if it’s an MARKET order or other types* that doesn’t place the order in the order book form the buyer side.
"isBuyerMaker": true,
Order types can be seem at https://binance-docs.github.io/apidocs/spot/en/#new-order-trade's Type table.
isBuyerMaker is not related to the order type. It’s true if the buyer was maker (i.e., BUY order existed on the order book, it was filled when seller placed their order), and false otherwise (i.e., SELL order was on the order book, buyer took it).
@AlexFiliberto97, as @aisling2 said, you seem to confuse trades with orders. /api/v3/historicalTrades lists trades. Information about market trades does not include which orders caused the trade to happen, nor the information about the order types.
You can list your own trades using GET /api/v3/myTrades endpoint, or use GET /api/v3/allOrders for all your orders. However, it is not possible to access information about orders placed by other people.