Skip to main content

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

ParameterRequiredTypeComments
symbolfalsestringName of the trading pair
orderIdfalsestringOrder ID
limitfalsestringDefault value is 50, max 50
startTimefalseintegerStart timestamp (ms)
endTimefalseintegerEnd time timestamp (ms)
fromTradeIdfalsestringQuery greater than the trade ID
toTradeIdfalsestringQuery smaller than the trade ID

Response Parameters

ParameterTypeComments
symbolstringName of the trading pair
idstringIrrelevant for API usage. This field reflects the "Transaction ID" from the Trade History section of the website
orderIdstringOrder ID
tradeIdstringThe ID for the trade
orderPricestringLast traded price
orderQtystringOrder quantity
execFeestringTrading fee (for a single fill)
feeTokenIdstringFee Token ID
creatTimestringOrder created time in the match engine
isBuyerstring0:Buyer, 1:Seller
isMakerstring0:Maker, 1:Taker
matchOrderIdstringOrder ID of the opponent trader
makerRebatestringMaker rebate
executionTimestringOrder execution time
blockTradeIdstringParadigm 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
}