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
Parameter | Required | Type | Comments |
---|---|---|---|
accountType | false | string | Account Type. UNIFIED |
category | false | string | Product type spot ,linear ,option ,inverse spot ,linear ,option |
currency | false | string | Currency, uppercase only |
baseCoin | false | string | BaseCoin, uppercase only. e.g., BTC of BTCPERP |
type | false | string | Types of transaction logs |
startTime | false | integer | The start timestamp (ms)
|
endTime | false | integer | The end timestamp (ms) |
limit | false | integer | Limit for data size per page. [1 , 50 ]. Default: 20 |
cursor | false | string | Cursor. Use the nextPageCursor token from the response to retrieve the next page of the result set |
Response Parameters
Parameter | Type | Comments |
---|---|---|
list | array | Object |
> id | string | Unique id |
> symbol | string | Symbol name |
> category | string | Product type |
> side | string | Side. Buy ,Sell ,None |
> transactionTime | string | Transaction timestamp (ms) |
> type | string | Type |
> qty | string | Quantity |
> size | string | Size. The rest position size after the trade is executed, and it has direction, i.e., short with "-" |
> currency | string | USDC、USDT、BTC、ETH |
> tradePrice | string | Trade price |
> funding | string | Funding fee
|
> fee | string | Trading fee
|
> cashFlow | string | Cash 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 |
> change | string | Change = cashFlow + funding - fee |
> cashBalance | string | Cash balance. This is the wallet balance after a cash change |
> feeRate | string |
|
> bonusChange | string | The change of bonus |
> tradeId | string | Trade ID |
> orderId | string | Order ID |
> orderLinkId | string | User customised order ID |
nextPageCursor | string | Refer to the cursor request parameter |
Request Example
- HTTP
- Python
- Node.js
GET /v5/account/transaction-log?accountType=UNIFIED&category=linear¤cy=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
from pybit.unified_trading import HTTP
session = HTTP(
testnet=True,
api_key="XXXXX",
api_secret="XXXXX",
)
print(session.get_transaction_log(
accountType="UNIFIED",
category="linear",
currency="USDT",
))
const { RestClientV5 } = require('bybit-api');
const client = new RestClientV5({
testnet: true,
key: 'apikey',
secret: 'apisecret',
});
client
.getTransactionLog({
accountType: 'UNIFIED',
category: 'linear',
currency: 'USDT',
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
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
}