Skip to main content

Get Trade History

Query users' execution records, sorted by execTime 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. 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.

HTTP Request

GET /v5/execution/list

Request Parameters

ParameterRequiredTypeComments
categorytruestringProduct type linear, inverse, spot, option
symbolfalsestringSymbol name, like BTCUSDT, uppercase only
orderIdfalsestringOrder ID
orderLinkIdfalsestringUser customised order ID
baseCoinfalsestringBase coin, uppercase only
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
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
> sidestringSide. Buy,Sell
> orderPricestringOrder price
> orderQtystringOrder qty
> leavesQtystringThe remaining qty not executed
> createTypestringOrder create type
  • 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 ""
    > execFeestringExecuted trading fee. You can get spot fee currency instruction here
    > execFeeV2stringSpot leg transaction fee, only works for execType=FutureSpread
    > execIdstringExecution ID
    > execPricestringExecution price
    > execQtystringExecution qty
    > execTypestringExecuted type
    > execValuestringExecuted order value
    > execTimestringExecuted timestamp (ms)
    > feeCurrencystringTrading fee currency
    > isMakerbooleanIs maker order. true: maker, false: taker
    > feeRatestringTrading fee rate
    > tradeIvstringImplied volatility. Valid for option
    > markIvstringImplied volatility of mark price. Valid for option
    > markPricestringThe mark price of the symbol when executing
    > 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
    > extraFeesstringTrading fee rate information. Currently, this data is returned only for kyc=Indian user or spot orders placed on the Indonesian site or spot fiat currency orders placed on the EU site. In other cases, an empty string is returned. Enum: feeType, subFeeType
    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: xxxxxxxxxxxxxxxxxx
    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": "",
    "extraFees": "",
    "seq": 4688002127
    }
    ]
    },
    "retExtInfo": {},
    "time": 1672283754510
    }