Get History Position
Get historical closed position records with pagination support.
HTTP Request
GET /api/v1/future/position/history-position
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| limit | number | No | Number of records to return (default: 20, max: 100) |
| symbol | string | No | Trading pair symbol (e.g., BTCUSDT) |
| idLessThan | number | No | Get positions with ID less than this value |
| startTime | number | No | Start time in milliseconds (Unix timestamp) |
| endTime | number | No | End 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
| Parameter | Type | Description |
|---|---|---|
| code | string | Response code |
| msg | string | Response message |
| requestTime | number | Request timestamp in milliseconds |
| data | object | History position data |
| > list | array | Array of historical position records |
| >> positionId | number | Position ID |
| >> symbol | string | Trading pair symbol |
| >> marginCoin | string | Margin coin (e.g., USDT) |
| >> holdSide | string | Position direction: "long" or "short" |
| >> openAvgPrice | string | Average opening price |
| >> closeAvgPrice | string | Average closing price |
| >> marginMode | string | Margin mode: "isolated" or "cross" |
| >> openTotalPos | string | Total position size when opened |
| >> closeTotalPos | string | Total position size when closed |
| >> pnl | string | Profit and loss |
| >> netProfit | string | Net profit (PnL - fees) |
| >> totalFunding | string | Total funding fees paid/received |
| >> openFee | string | Opening transaction fee |
| >> closeFee | string | Closing transaction fee |
| >> cTime | number | Creation time in milliseconds (Unix timestamp) |
| >> uTime | number | Last updated time in milliseconds (Unix timestamp) |
| > endId | number | Last 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
| Code | Message |
|---|---|
| 40034 | symbol does not exist |