Skip to main content

Get Trade History

Query users' execution records, sorted by execTime in descending order. However, for Classic spot, they are sorted by execId in descending order.

tip
  • Response items will have sorting issues When 'execTime' is the same, it is recommended to sort according to execId+OrderId+leavesQty. This issue is currently being optimized and will be released. If you want to receive real-time execution information, Use the websocket stream (recommended).
  • You may have multiple executions in a single order.
  • You can query by symbol, baseCoin, orderId and orderLinkId, and if you pass multiple params, the system will process them according to this priority: orderId > orderLinkId > symbol > baseCoin. orderId and orderLinkId have a higher priority and as long as these two parameters are in the input parameters, other input parameters will be ignored.
info
  • Unified account supports getting the past 730 days historical trades data

HTTP Request

GET /v5/execution/list

Request Parameters

ParameterRequiredTypeComments
categorytruestringProduct type
  • UTA2.0, UTA1.0: linear, inverse, spot, option
  • classic account: linear, inverse, spot
symbolfalsestringSymbol name, like BTCUSDT, uppercase only
orderIdfalsestringOrder ID
orderLinkIdfalsestringUser customised order ID. Classic account does not support this param
baseCoinfalsestringBase coin, uppercase only
  • UTA1.0(category=inverse) and classic account are not supported
  • startTimefalseintegerThe start timestamp (ms)
    • startTime and endTime are not passed, return 7 days by default;
    • Only startTime is passed, return range between startTime and startTime+7 days
    • Only endTime is passed, return range between endTime-7 days and endTime
    • If both are passed, the rule is endTime - startTime <= 7 days
    endTimefalseintegerThe end timestamp (ms)
    execTypefalsestringExecution type. Classic spot is not supported
    limitfalseintegerLimit for data size per page. [1, 100]. Default: 50
    cursorfalsestringCursor. Use the nextPageCursor token from the response to retrieve the next page of the result set

    Response Parameters

    ParameterTypeComments
    categorystringProduct type
    listarrayObject
    > symbolstringSymbol name
    > orderIdstringOrder ID
    > orderLinkIdstringUser customized order ID. Classic spot is not supported
    > sidestringSide. Buy,Sell
    > orderPricestringOrder price
    > orderQtystringOrder qty
    > leavesQtystringThe remaining qty not executed. Classic spot is not supported
    > createTypestringOrder create type
  • classic account & UTA1.0(category=inverse): always ""
  • Spot, Option do not have this key
  • > orderTypestringOrder type. Market,Limit
    > stopOrderTypestringStop order type. If the order is not stop order, it either returns UNKNOWN or "". Classic spot is not supported
    > execFeestringExecuted trading fee. You can get spot fee currency instruction here
    > execIdstringExecution ID
    > execPricestringExecution price
    > execQtystringExecution qty
    > execTypestringExecuted type. Classic spot is not supported
    > execValuestringExecuted order value. Classic spot is not supported
    > execTimestringExecuted timestamp(ms)
    > feeCurrencystringSpot trading fee currency Classic spot is not supported
    > isMakerbooleanIs maker order. true: maker, false: taker
    > feeRatestringTrading fee rate. Classic spot is not supported
    > tradeIvstringImplied volatility. Valid for option
    > markIvstringImplied volatility of mark price. Valid for option
    > markPricestringThe mark price of the symbol when executing. Classic spot is not supported
    > indexPricestringThe index price of the symbol when executing. Valid for option only
    > underlyingPricestringThe underlying price of the symbol when executing. Valid for option
    > blockTradeIdstringParadigm block trade ID
    > closedSizestringClosed position size
    > seqlongCross sequence, used to associate each fill and each position update
    • The seq will be the same when conclude multiple transactions at the same time
    • Different symbols may have the same seq, please use seq + symbol to check unique
    • classic account Spot trade does not have this field
    nextPageCursorstringRefer to the cursor request parameter

    Request Example

    GET /v5/execution/list?category=linear&limit=1 HTTP/1.1
    Host: api-testnet.bybit.com
    X-BAPI-SIGN: XXXXX
    X-BAPI-API-KEY: XXXXX
    X-BAPI-TIMESTAMP: 1672283754132
    X-BAPI-RECV-WINDOW: 5000

    Response Example

    {
    "retCode": 0,
    "retMsg": "OK",
    "result": {
    "nextPageCursor": "132766%3A2%2C132766%3A2",
    "category": "linear",
    "list": [
    {
    "symbol": "ETHPERP",
    "orderType": "Market",
    "underlyingPrice": "",
    "orderLinkId": "",
    "side": "Buy",
    "indexPrice": "",
    "orderId": "8c065341-7b52-4ca9-ac2c-37e31ac55c94",
    "stopOrderType": "UNKNOWN",
    "leavesQty": "0",
    "execTime": "1672282722429",
    "feeCurrency": "",
    "isMaker": false,
    "execFee": "0.071409",
    "feeRate": "0.0006",
    "execId": "e0cbe81d-0f18-5866-9415-cf319b5dab3b",
    "tradeIv": "",
    "blockTradeId": "",
    "markPrice": "1183.54",
    "execPrice": "1190.15",
    "markIv": "",
    "orderQty": "0.1",
    "orderPrice": "1236.9",
    "execValue": "119.015",
    "execType": "Trade",
    "execQty": "0.1",
    "closedSize": "",
    "seq": 4688002127
    }
    ]
    },
    "retExtInfo": {},
    "time": 1672283754510
    }