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
| Field | Type | Required | Description |
|---|---|---|---|
category | string | Yes | spot for spot or linear for futures. |
symbol | string | No | Contract or trading pair name. Supply either symbol or orderId. |
orderId | string | No | Order ID. Supply either symbol or orderId. |
startTime | Long | Yes | Start timestamp in milliseconds. The time range can span up to 90 days. |
endTime | Long | Yes | End timestamp in milliseconds. The time range can span up to 90 days. |
pageSize | integer | Yes | Records per page. Default: 20. Maximum: 100. |
pageIndex | integer | Yes | Page number. Use cursor for subsequent pages to improve performance. |
cursor | string | No | Pagination cursor. Leave empty on the first request and use the returned cursor for the next page. |
Response Parameters
| Field | Type | Description |
|---|---|---|
symbol | string | Contract/trading pair name |
symbolId | integer | Unique contract or trading pair ID. |
orderId | string | Parent order ID. |
side | string | Trade direction, BUY or SELL. |
execPrice | string | Execution price. |
execQty | string | Executed quantity. |
execFee | string | Trading fee. |
execValue | string | Executed value (execPrice × execQty). |
execTime | string | Execution timestamp. |
execId | string | Execution ID. |
settleCoin | string | Fee asset. |
action | string | Open/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"); |
cumClosedPnl | string | Realized profit and loss. |
leverage | int | Leverage multiplier. |
avgEntryPrice | string | Average entry price. |
markPrice | string | Liquidation price (mark price). |
liquidityRole | string | Taker or maker. Liquidations are undifferentiated. |
orderType | string | Order 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
}