Skip to main content

Get Position History

Type: GET
Description: /future/trade/v1/position/list-history


Rate Limit
200/s/apikey


Request Parameters

NameTypeRequiredDefaultDescriptionRange
idintegerFALSE1Page number
directionstringFALSENEXTNEXT; PREVIOUS
limitintegerFALSE10Page size
symbolstringFALSEN/ATrading pair
startTimelongFALSEN/AStart time
endTimelongFALSEN/AEnd time
positionTypeintegerFALSEN/APosition mode1 Cross, 2 Isolated (empty = all)
isFullCloseintegerFALSEN/AClose type0 Partial, 1 Full (empty = all)

Request Example

curl -G "https://fapi.xt.com/future/trade/v1/position/list-history" \
-H "validate-appkey: $APPKEY" \ # Required
-H "validate-timestamp: $TIMESTAMP" \ # Required
-H "validate-singature: $SIGNATURE" \ # Required
-H "Content-Type: application/x-www-form-urlencoded" \ # Required
-d "symbol=btc_usdt" \
-d "id=1" \
-d "limit=10" \
-d "startTime=1762074200000" \
-d "endTime=1762074242467" \

Response Example

{
"error": {
"code": "",
"msg": ""
},
"msgInfo": "",
"result": {
"hasNext": false, // Whether there is a next page
"hasPrev": false, // Whether there is a previous page
"items": [ // Data list
{
"id": "1987654321098765432", // string, position history ID (Long to string)
"positionSide": "LONG", // string, "LONG" long / "SHORT" short
"contractType": "PERPETUAL", // string, "PERPETUAL" perpetual / "PREDICT" prediction
"symbol": "BTCUSDT", // string, trading pair
"positionType": 2, // int, 1=cross 2=isolated
"closeProfit": "127.83", // string, realized profit/loss
"closePositionSize": "0.050", // string, closed position size
"closeOpenPrice": "63250.80", // string, average open price of closed part
"closePrice": "65808.60", // string, average closing price
"maxPositionSize": "0.080", // string, max size during position life
"openTime": 1735608000000, // number, open timestamp (ms)
"closeTime": 1735699200000, // number, close timestamp (ms)
"startLeverage": 25, // int, leverage at opening
"endLeverage": 25, // int, leverage at closing
"working": false, // boolean, is position still open
"force": false, // boolean, forced liquidation
"forceMarkPrice": null, // string, mark price at liquidation
"totalFee": "18.92", // string, total fee during position
"totalFundFee": "3.41", // string, funding fee total
"welfareAccount": false // boolean, welfare/bonus account
}
]
},
"returnCode": 0
}

Error Codes

Error codeDescription
invalid_directiondirection incorrect
invalid_limitlimit parameter incorrect
invalid_symbolTrading pair does not exist