Skip to main content

Get All Orders (Including History)

Description

Get all orders for a specific trading pair (including active, canceled, or filled orders).

HTTP Request

GET /fapi/v1/allOrders (HMAC SHA256)

Request Parameters

NameTypeRequiredDescription
symbolSTRINGYESTrading pair
orderIdSTRINGNOAccepted but currently ignored — the response is not filtered by order ID
startTimeLONGNOAccepted but currently ignored — no time filtering is applied
endTimeLONGNOAccepted but currently ignored — no time filtering is applied
limitINTNODefault 500; Max 1000
timestampLONGYESTimestamp

The response always contains the caller's most recent orders on the symbol (newest first, up to limit), with no further server-side filtering. There is no age cutoff — older orders remain queryable.

Response Example

[
{
"orderId": "3fa42833-9508-4061-8d80-b68563dcd521",
"symbol": "BTCUSDT",
"status": "NEW",
"clientOrderId": "abc",
"price": "60000",
"avgPrice": "0",
"origQty": "0.01",
"executedQty": "0",
"cumQuote": "0",
"timeInForce": "GTC",
"type": "LIMIT",
"reduceOnly": false,
"side": "BUY",
"positionSide": "BOTH",
"stopPrice": "0",
"workingType": "CONTRACT_PRICE",
"priceProtect": false,
"origType": "LIMIT",
"updateTime": 1774330265238,
"time": 1774330191022
}
]

Code Examples

cURL

API_KEY="your_api_key"
API_SECRET="your_api_secret"
TIMESTAMP=$(date +%s%3N)
QUERY_STRING="symbol=BTCUSDT&limit=500&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.prex.world/fapi/v1/allOrders?${QUERY_STRING}&signature=${SIGNATURE}"

Python

import time, hmac, hashlib, requests

API_KEY = "your_api_key"
API_SECRET = "your_api_secret"
BASE_URL = "https://api.prex.world"

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 all orders history for BTCUSDT
resp = signed_get("/fapi/v1/allOrders", params={
"symbol": "BTCUSDT",
"limit": "500"
})
print(resp.json())