Skip to content

Get position#

GET https://api.pro.anboto.xyz/api/v2/trading/position

shows the asset position != 0 ApiKeyAuth required.

Query params#

exchange enum required
The exchange — BINANCE, HUOBI, GATEIO, KUCOIN, OKX, BYBIT, BITGET, WOO, MEXC, BULLISH, B2C2, COINBASE_PRIME, COINBASE_INTL, HYPERLIQUID, … (15 values)
subaccount string
Sub-account

Headers#

Header
X-API-KEY string required
X-TIMESTAMP int64 ms required
X-SIGN string required
X-RECV-WINDOW int, default 5000

Responses#

200 The list of asset positions != 0
401 Unauthorized, Invalid Signature
429 Rate limit exceeded, retry later

Response fields#

[].collateral number
The collateral amount for the position
[].contracts number
The number of contracts
[].entryPrice number
The average entry price
[].leverage number
The position leverage
[].liquidationPrice number
The liquidation price
[].marginMode enum
The margin mode of the position — CROSS, ISOLATED
[].markPrice number
The current mark price
[].notional number
The notional value of the position
[].side enum
The position side — LONG, SHORT, BOTH
[].symbol string
The trading symbol
[].timestamp integer
Unix timestamp in milliseconds
[].unrealizedPnl number
The unrealized profit and loss
curl -X GET "$BASE/api/v2/trading/position?exchange=BINANCE" \
  -H "X-API-KEY: $API_KEY" -H "X-TIMESTAMP: $ts" \
  -H "X-SIGN: $sign"
params = {"exchange": ..., "subaccount": ...}
r = requests.get(f"{BASE}/api/v2/trading/position",
    params=params
    headers=signed_headers_query(params))
print(r.json())
let resp = client
    .get(format!("{BASE}/api/v2/trading/position?exchange=BINANCE"))
    .headers(signed_headers_query(&params))
    .send()?;
println!("{}", resp.text()?);
req, _ := http.NewRequest("GET", BASE+"/api/v2/trading/position?exchange=BINANCE", nil)
for k, v := range signedHeadersQuery(req.URL.Query()) {
    req.Header.Set(k, v)
}
resp, err := http.DefaultClient.Do(req)
if err != nil {
    log.Fatal(err)
}
defer resp.Body.Close()
io.Copy(os.Stdout, resp.Body)
HttpResponse<String> resp = client.send(
    signedGet("/api/v2/trading/position?exchange=BINANCE"),
    HttpResponse.BodyHandlers.ofString());
const res = await fetch(`${BASE}/api/v2/trading/position?exchange=BINANCE`, {
  method: "GET",
  headers: signedHeadersQuery(params),
});
const data = await res.json();
val request = signedGet("/api/v2/trading/position?exchange=BINANCE")
val response = client.send(request, HttpResponse.BodyHandlers.ofString())
println(response.body())
cpr::Response r = cpr::Get(
    cpr::Url{BASE + "/api/v2/trading/position?exchange=BINANCE"},
    signedHeadersQuery(params));
std::cout << r.text << std::endl;
const res = await fetch(`${BASE}/api/v2/trading/position?exchange=BINANCE`, {
  method: "GET",
  headers: signedHeadersQuery(params),
});
console.log(await res.json());

Response 200

[
  {
    "collateral": 0.0,
    "contracts": 0.0,
    "entryPrice": 0.0,
    "leverage": 0.0,
    "liquidationPrice": 0.0,
    "marginMode": "CROSS",
    "markPrice": 0.0,
    "notional": 0.0,
    "side": "LONG",
    "symbol": "string",
    "timestamp": 0,
    "unrealizedPnl": 0.0
  }
]