Skip to main content

Get History Position

Get historical closed position records with pagination support.

HTTP Request

GET /api/v1/future/position/history-position

Request Parameters

ParameterTypeRequiredDescription
limitnumberNoNumber of records to return (default: 20, max: 100)
symbolstringNoTrading pair symbol (e.g., BTCUSDT)
idLessThannumberNoGet positions with ID less than this value
startTimenumberNoStart time in milliseconds (Unix timestamp)
endTimenumberNoEnd time in milliseconds (Unix timestamp)

Request Example

curl -X GET "https://open-api.bydoxe.com/api/v1/future/position/history-position?symbol=BTCUSDT&limit=20" \
-H "ACCESS-KEY: your-api-key" \
-H "ACCESS-SIGN: your-signature" \
-H "ACCESS-PASSPHRASE: your-passphrase" \
-H "ACCESS-TIMESTAMP: 1659076670000"

Response Parameters

ParameterTypeDescription
codestringResponse code
msgstringResponse message
requestTimenumberRequest timestamp in milliseconds
dataobjectHistory position data
> listarrayArray of historical position records
>> positionIdnumberPosition ID
>> symbolstringTrading pair symbol
>> marginCoinstringMargin coin (e.g., USDT)
>> holdSidestringPosition direction: "long" or "short"
>> openAvgPricestringAverage opening price
>> closeAvgPricestringAverage closing price
>> marginModestringMargin mode: "isolated" or "cross"
>> openTotalPosstringTotal position size when opened
>> closeTotalPosstringTotal position size when closed
>> pnlstringProfit and loss
>> netProfitstringNet profit (PnL - fees)
>> totalFundingstringTotal funding fees paid/received
>> openFeestringOpening transaction fee
>> closeFeestringClosing transaction fee
>> cTimenumberCreation time in milliseconds (Unix timestamp)
>> uTimenumberLast updated time in milliseconds (Unix timestamp)
> endIdnumberLast position ID in the result set for pagination

Response Example

Success Response

{
"code": "00000",
"msg": "success",
"requestTime": 1732000000000,
"data": {
"list": [
{
"positionId": 123456789,
"symbol": "BTCUSDT",
"marginCoin": "USDT",
"holdSide": "long",
"openAvgPrice": "89000.00",
"closeAvgPrice": "91500.00",
"marginMode": "isolated",
"openTotalPos": "0.50",
"closeTotalPos": "0.50",
"pnl": "1250.00",
"netProfit": "1230.50",
"totalFunding": "-5.00",
"openFee": "8.90",
"closeFee": "9.15",
"cTime": 1731800000000,
"uTime": 1731900000000
},
{
"positionId": 123456788,
"symbol": "ETHUSDT",
"marginCoin": "USDT",
"holdSide": "short",
"openAvgPrice": "3500.00",
"closeAvgPrice": "3400.00",
"marginMode": "cross",
"openTotalPos": "5.00",
"closeTotalPos": "5.00",
"pnl": "500.00",
"netProfit": "485.50",
"totalFunding": "2.50",
"openFee": "8.75",
"closeFee": "8.50",
"cTime": 1731700000000,
"uTime": 1731800000000
}
],
"endId": 123456788
}
}

Error Codes

CodeMessage
40034symbol does not exist