Skip to main content

Get Transaction Log

Query transaction logs in Unified account, it supports up to 2 years data

HTTP Request

GET /v5/account/transaction-log

Request Parameters

ParameterRequiredTypeComments
accountTypefalsestringAccount Type. UNIFIED
categoryfalsestringProduct type. spot,linear,option
currencyfalsestringCurrency
baseCoinfalsestringBaseCoin. e.g., BTC of BTCPERP
typefalsestringTypes of transaction logs
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)
limitfalseintegerLimit for data size per page. [1, 50]. Default: 20
cursorfalsestringCursor. Use the nextPageCursor token from the response to retrieve the next page of the result set

Response Parameters

ParameterTypeComments
listarrayObject
> idstringUnique id
> symbolstringSymbol name
> categorystringProduct type
> sidestringSide. Buy,Sell,None
> transactionTimestringTransaction timestamp (ms)
> typestringType
> qtystringQuantity
  • Spot: the negative means the qty of this currency is decreased, the positive means the qty of this currency is increased
  • Perps & Futures: it is the quantity for each trade entry and it does not have direction
  • > sizestringSize. The rest position size after the trade is executed, and it has direction, i.e., short with "-"
    > currencystringUSDC、USDT、BTC、ETH
    > tradePricestringTrade price
    > fundingstringFunding fee
    • Positive value means receiving funding fee
    • Negative value means deducting funding fee
    • For USDC Perp, as funding settlement and session settlement are occurred at the same time, so they are in the same log. Please refer to funding to understand funding fee, and cashFlow to understand 8-hour P&L
    > feestringTrading fee
    • Positive fee value means expense
    • Negative fee value means rebates
    > cashFlowstringCash flow, e.g., (1) close the position, and unRPL converts to RPL, (2) 8-hour session settlement for USDC Perp and Futures, (3) transfer in or transfer out. This does not include trading fee, funding fee
    > changestringChange = cashFlow + funding - fee
    > cashBalancestringCash balance. This is the wallet balance after a cash change
    > feeRatestring
    • When type=TRADE, then it is trading fee rate
    • When type=SETTLEMENT, it means funding fee rate. For side=Buy, feeRate=market fee rate; For side=Sell, feeRate= - market fee rate
    > bonusChangestringThe change of bonus
    > tradeIdstringTrade ID
    > orderIdstringOrder ID
    > orderLinkIdstringUser customised order ID
    nextPageCursorstringRefer to the cursor request parameter

    Request Example

    GET /v5/account/transaction-log?accountType=UNIFIED&category=linear&currency=USDT HTTP/1.1
    Host: api-testnet.bybit.com
    X-BAPI-SIGN: XXXXX
    X-BAPI-API-KEY: XXXXX
    X-BAPI-TIMESTAMP: 1672132480085
    X-BAPI-RECV-WINDOW: 5000

    Response Example

    {
    "retCode": 0,
    "retMsg": "OK",
    "result": {
    "nextPageCursor": "21963%3A1%2C14954%3A1",
    "list": [
    {
    "id": "592324_XRPUSDT_161440249321",
    "symbol": "XRPUSDT",
    "side": "Buy",
    "funding": "-0.003676",
    "orderLinkId": "",
    "orderId": "1672128000-8-592324-1-2",
    "fee": "0.00000000",
    "change": "-0.003676",
    "cashFlow": "0",
    "transactionTime": "1672128000000",
    "type": "SETTLEMENT",
    "feeRate": "0.0001",
    "bonusChange": "",
    "size": "100",
    "qty": "100",
    "cashBalance": "5086.55825002",
    "currency": "USDT",
    "category": "linear",
    "tradePrice": "0.3676",
    "tradeId": "534c0003-4bf7-486f-aa02-78cee36825e4"
    },
    {
    "id": "592324_XRPUSDT_161440249321",
    "symbol": "XRPUSDT",
    "side": "Buy",
    "funding": "",
    "orderLinkId": "linear-order",
    "orderId": "592b7e41-78fd-42e2-9aa3-91e1835ef3e1",
    "fee": "0.01908720",
    "change": "-0.0190872",
    "cashFlow": "0",
    "transactionTime": "1672121182224",
    "type": "TRADE",
    "feeRate": "0.0006",
    "bonusChange": "-0.1430544",
    "size": "100",
    "qty": "88",
    "cashBalance": "5086.56192602",
    "currency": "USDT",
    "category": "linear",
    "tradePrice": "0.3615",
    "tradeId": "5184f079-88ec-54c7-8774-5173cafd2b4e"
    },
    {
    "id": "592324_XRPUSDT_161407743011",
    "symbol": "XRPUSDT",
    "side": "Buy",
    "funding": "",
    "orderLinkId": "linear-order",
    "orderId": "592b7e41-78fd-42e2-9aa3-91e1835ef3e1",
    "fee": "0.00260280",
    "change": "-0.0026028",
    "cashFlow": "0",
    "transactionTime": "1672121182224",
    "type": "TRADE",
    "feeRate": "0.0006",
    "bonusChange": "",
    "size": "12",
    "qty": "12",
    "cashBalance": "5086.58101322",
    "currency": "USDT",
    "category": "linear",
    "tradePrice": "0.3615",
    "tradeId": "8569c10f-5061-5891-81c4-a54929847eb3"
    }
    ]
    },
    "retExtInfo": {},
    "time": 1672132481405
    }