Skip to main content

Get Trade History

Description​

Query trade records, up to 90 days of data can be queried

HTTP Request​

  • POST /api/v3/order/user/trade-history
  • Supported Products: spot / linear
  • Rate Limit: 10 requests per second per UID

Request Parameters​

FieldTypeRequiredDescription
categorystringYesspot for spot or linear for futures.
symbolstringNoContract or trading pair name. Supply either symbol or orderId.
orderIdstringNoOrder ID. Supply either symbol or orderId.
startTimeLongYesStart timestamp in milliseconds. The time range can span up to 90 days.
endTimeLongYesEnd timestamp in milliseconds. The time range can span up to 90 days.
pageSizeintegerYesRecords per page. Default: 20. Maximum: 100.
pageIndexintegerYesPage number. Use cursor for subsequent pages to improve performance.
cursorstringNoPagination cursor. Leave empty on the first request and use the returned cursor for the next page.

Response Parameters​

FieldTypeDescription
symbolstringContract/trading pair name
symbolIdintegerUnique contract or trading pair ID.
orderIdstringParent order ID.
sidestringTrade direction, BUY or SELL.
execPricestringExecution price.
execQtystringExecuted quantity.
execFeestringTrading fee.
execValuestringExecuted value (execPrice × execQty).
execTimestringExecution timestamp.
execIdstringExecution ID.
settleCoinstringFee asset.
actionstringOpen/close flag
OPEN_LONG(1, "OPEN_LONG", "open long")
OPEN_SHORT(2,"OPEN_SHORT","open short")
CLOSE_LONG(3,"CLOSE_LONG","close long")
CLOSE_SHORT(4,"CLOSE_SHORT","close short")
NONE(0,"NONE","NONE");
cumClosedPnlstringRealized profit and loss.
leverageintLeverage multiplier.
avgEntryPricestringAverage entry price.
markPricestringLiquidation price (mark price).
liquidityRolestringTaker or maker. Liquidations are undifferentiated.
orderTypestringOrder type: Take-profit and stop-loss, scheduled order, limit order
(MARKET/LIMIT/TP_SL/UNKNOWN)

Request Example​

POST /api/v3/order/user/trade-history HTTP/1.1
Host: openapi.lbank.com
Content-Type: application/json
ex-api-key: <your_api_key>
ex-timestamp: <current_unix_timestamp_ns>
ex-nonce: <unique_random_hex>
ex-signature: <your_signature>
ex-client-type: API

{
"startTime": 1793241426035,
"endTime": 1793846226035,
"symbol": "BTCUSDT",
"category": "linear",
"pageIndex": 1,
"pageSize": 10
}

Response Example​

{
"code": 200,
"message": "success",
"data": {
"list": [
{
"symbol": "BTCUSDT",
"symbolId": 10013,
"orderId": "86f30462-0a11-490e-8b9a-5386daf9fc41",
"orderType": "LIMIT",
"execFee": "0.0003",
"execPrice": "1.3",
"side": "BUY",
"execQty": "25.13"
}
],
"cursor": "",
"sumCount": 0,
"resultCode": 0,
"resultMessage": ""
},
"extras": null
}