Trade

Position List

HTTP Request

GET /v1/trade/position-list

NOTE

Don't include trailing slash / at the end of the endpoint. Doing so can result in a “not found” error.

Request Parameters

ParameterRequiredTypeComments
pageoptionalintegerpage number of the position
limitoptionalintegerlimit of count of the getting position

INFO

The ack of position list request indicates that the request is successfully accepted.

Response Parameters

ParameterTypeComments
statusCodenumber200
resultarrayObject
listarraycontain the response details
> idintegerid number of the position
> coinstringValues:
  • BTCUSDT, ETHUSDT, SOLUSDT, XRPUSDT 1000PEPEUSDT, WLDUSDT, DOGEUSDT,
  • STPTUSDT, SUIUSDT, ADAUSDT, ARBUSDT, XLMUSDT, HIVEUSDT, ONDOUSDT
> sidestringValues: long, short
> sizestringsize of the position
> averageEnteryPricestringaverage entry price of the position
> leveragestringleverage of the position
> marginstringmargin of the position
> unrealizedPnLstringunrealized pnl of the position
> liquidationPricestringestimated liquidation price of the position
> marginModestringValues: Cross, Isolated
> createdTimestringcreation date of the position
> tradeTypestringValues: Market, Limit
> tpPricestringtake profit price of the position
> slPricestringstop loss price of the position
messagestringOK

Request Example

GET /v1/trade/position-list HTTP/1.1
Host: api.okxai.net
X-OKXAI-SIGN: XXXXX
X-OKXAI-API-KEY: XXXXX
Content-Type: application/json
const response = await fetch('https://api.okxai.net/v1/trade/position-list');

Response Example

{
  "statusCode": 200,
  "result": {
    "list": [
      {
        "id": 28,
        "coin": "BTCUSDT",
        "side": "long",
        "size": "0.52000000",
        "averageEnteryPrice": "77100.80000000",
        "leverage": "100.00",
        "margin": "400.92416000",
        "unrealizedPnl": "-16.03696640",
        "liquidationPrice": "1986.03696640",
        "marginMode": "Cross",
        "createdTime": "2025-04-07 14:05:18",
        "tradeType": "market",
        "tpPrice": null,
        "slPrice": null
      }
    ],
    "pagination": {
      "page": 1,
      "limit": 10,
      "totalRecords": 1,
      "totalPages": 1
    }
  },
  "message": "OK"
}

On this page