Position History
Get the user's closed position history using cursor pagination, with filters for trading pair, position side, margin mode, close type, and time range.
API Information
- Method:
GET - Path:
/fapi/v1/position/history - Authentication: Requires signature authentication (see Common Module · Signature Specification)
Request Parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
| symbol | query | string | No | Trading pair |
| positionSide | query | integer | No | Position side: 1=long, 2=short |
| marginMode | query | integer | No | Margin mode: 1=isolated, 2=cross |
| closeType | query | integer | No | Close type: 1=user close, 2=take profit, 3=stop loss, 4=liquidation, 5=ADL, 6=bankruptcy |
| startTime | query | integer | No | Start close time (milliseconds timestamp) |
| endTime | query | integer | No | End close time (milliseconds timestamp) |
| cursor | query | string | No | Cursor |
| limit | query | integer | No | Page size, default 10, max 100 |
Request Example
GET /fapi/v1/position/history?symbol=BTC_USDT&limit=50
Response Fields
| Field | Type | Description |
|---|---|---|
| code | integer | Status code |
| message | string | Response message |
| data.limit | integer | Page size |
| data.next_cursor | string | Next page cursor |
| data.list | array | Historical position list (see "Historical Position Detail" for fields) |
Response Example
{
"code": 0,
"message": "success",
"data": {
"limit": 10,
"next_cursor": "1711929600000",
"list": [
{
"id": 1,
"position_id": 123,
"user_id": 100001,
"symbol": "BTC_USDT",
"position_side": 1,
"margin_mode": 1,
"leverage": 10,
"open_quantity": 0.1,
"close_quantity": 0.1,
"entry_price": 68500,
"exit_price": 68700,
"open_amount": 6850,
"close_amount": 6870,
"open_fee": 3.425,
"close_fee": 3.435,
"total_funding_fee": -0.5,
"realized_pnl": 20,
"close_type": 1,
"opened_at": 1711929600000,
"closed_at": 1711929700000,
"created_at": 1711929700000
}
]
}
}