Query Specific Open Order
Description
Query the status of a specific open order.
HTTP Request
GET /fapi/v1/openOrder (HMAC SHA256)
Weight
1
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | STRING | YES | Trading pair |
| orderId | LONG | NO | System order ID |
| origClientOrderId | STRING | NO | User-defined order ID |
| timestamp | LONG | YES | Timestamp |
Response Example
{
"clientOrderId": "testOrderOpen1",
"cumQty": "0",
"cumQuote": "0",
"executedQty": "0",
"orderId": 2254222045,
"avgPrice": "0.00000",
"origQty": "10",
"price": "60000",
"reduceOnly": false,
"side": "BUY",
"positionSide": "BOTH",
"status": "NEW",
"stopPrice": "0",
"closePosition": false,
"symbol": "BTCUSDT",
"timeInForce": "GTC",
"type": "LIMIT",
"time": 1623910239123,
"updateTime": 1623910239123
}
Either orderId or origClientOrderId must be sent.
Code Examples
cURL
API_KEY="your_api_key"
API_SECRET="your_api_secret"
TIMESTAMP=$(date +%s%3N)
QUERY_STRING="symbol=BTCUSDT&orderId=2254222045×tamp=${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/openOrder?${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})
# Query a specific open order by orderId
resp = signed_get("/fapi/v1/openOrder", params={
"symbol": "BTCUSDT",
"orderId": "2254222045"
})
print(resp.json())