Trade History
info
- If
startTime
is not specified, you can only query for records in the last 7 days. - If you want to query for records older than 7 days,
startTime
is required. - It supports to query records up to 180 days.
info
If the orderId
is null, fromTicketId
is passed, and toTicketId
is null, then the result is sorted by ticketId
in ascend. Otherwise, the result is sorted by ticketId
in descend.
HTTP Request
GET /spot/v3/private/my-trades
Request Parameters
Parameter | Required | Type | Comments |
---|---|---|---|
symbol | false | string | Name of the trading pair |
orderId | false | string | Order ID |
limit | false | string | Default value is 50, max 50 |
startTime | false | integer | Start timestamp (ms) |
endTime | false | integer | End time timestamp (ms) |
fromTradeId | false | string | Query greater than the trade ID |
toTradeId | false | string | Query smaller than the trade ID |
Response Parameters
Parameter | Type | Comments |
---|---|---|
symbol | string | Name of the trading pair |
id | string | Irrelevant for API usage. This field reflects the "Transaction ID" from the Trade History section of the website |
orderId | string | Order ID |
tradeId | string | The ID for the trade |
orderPrice | string | Last traded price |
orderQty | string | Order quantity |
execFee | string | Trading fee (for a single fill) |
feeTokenId | string | Fee Token ID |
creatTime | string | Order created time in the match engine |
isBuyer | string | 0 :Buyer, 1 :Seller |
isMaker | string | 0 :Maker, 1 :Taker |
matchOrderId | string | Order ID of the opponent trader |
makerRebate | string | Maker rebate |
executionTime | string | Order execution time |
blockTradeId | string | Paradigm block trade ID |
Request Example
curl --location --request GET 'https://api-testnet.bybit.com/spot/v3/private/my-trades?symbol=BTCUSDT' \
--header 'X-BAPI-SIGN: XXXXX' \
--header 'X-BAPI-API-KEY: {api key}' \
--header 'X-BAPI-TIMESTAMP: 1659084253772' \
--header 'X-BAPI-RECV-WINDOW: 5000'
Response Example
{
"retCode": 0,
"retMsg": "OK",
"result": {
"list": [
{
"symbol": "BTCUSDT",
"id": "1210346127973428992",
"orderId": "1210073515485572864",
"tradeId": "2100000000001769786",
"orderPrice": "20500",
"orderQty": "0.02",
"execFee": "0.00002",
"feeTokenId": "BTC",
"creatTime": "1659020488738",
"isBuyer": "0",
"isMaker": "0",
"matchOrderId": "1210346015893229312",
"makerRebate": "0",
"executionTime": "1659020502026"
"blockTradeId": ""
},
{
"symbol": "BTCUSDT",
"id": "1208702504949264128",
"orderId": "1208702504731160320",
"tradeId": "2100000000001753197",
"orderPrice": "20240",
"orderQty": "0.009881",
"execFee": "0.000009881",
"feeTokenId": "BTC",
"creatTime": "1658824566874",
"isBuyer": "0",
"isMaker": "1",
"matchOrderId": "1208677465155702529",
"makerRebate": "0",
"executionTime": "1658824566893"
"blockTradeId": ""
}
]
},
"retExtMap": {},
"retExtInfo": {},
"time": 1659084254366
}