Skip to main content

User Liquidation Orders

Description

Get the user's historical liquidation orders.

HTTP Request

GET /fapi/v1/forceOrders (HMAC SHA256)

Weight

limitWeight
with symbol20
without symbol50

Request Parameters

NameTypeRequiredDescription
symbolSTRINGNOTrading pair
startTimeLONGNOStart time
endTimeLONGNOEnd time
limitINTNODefault 100; Max 1000
timestampLONGYESTimestamp

Response Example

[
{
"symbol": "BTCUSDT",
"orderId": 2254222045,
"clientOrderId": "forceOrder1",
"price": "56000",
"origQty": "1",
"executedQty": "1",
"cumQuote": "56000",
"status": "FILLED",
"timeInForce": "GTC",
"type": "LIQUIDATION",
"side": "SELL",
"stopPrice": "0",
"time": 1623910239123
}
]

Returns data for the most recent 3 months only. If no symbol is sent, all liquidation orders will be returned.

Code Examples

cURL

API_KEY="your_api_key"
API_SECRET="your_api_secret"
TIMESTAMP=$(date +%s%3N)
QUERY_STRING="symbol=BTCUSDT&limit=100&timestamp=${TIMESTAMP}"
SIGNATURE=$(echo -n "${QUERY_STRING}" | openssl dgst -sha256 -hmac "${API_SECRET}" | awk '{print $2}')

curl -s -H "X-MBX-APIKEY: ${API_KEY}" \
"https://api-sepolia.ztdx.io/fapi/v1/forceOrders?${QUERY_STRING}&signature=${SIGNATURE}"

Python

import time, hmac, hashlib, requests

API_KEY = "your_api_key"
API_SECRET = "your_api_secret"
BASE_URL = "https://api.ztdx.io"

def sign(params: str) -> str:
return hmac.new(API_SECRET.encode(), params.encode(), hashlib.sha256).hexdigest()

def signed_get(path, params={}):
params["timestamp"] = int(time.time() * 1000)
qs = "&".join(f"{k}={v}" for k, v in params.items())
params["signature"] = sign(qs)
return requests.get(f"{BASE_URL}{path}", params=params, headers={"X-MBX-APIKEY": API_KEY})

# Get user's liquidation orders for BTCUSDT
resp = signed_get("/fapi/v1/forceOrders", params={
"symbol": "BTCUSDT",
"limit": "100"
})
print(resp.json())