Skip to main content

Get Orders (Realtime)

Returns currently open orders, plus orders closed within the last few hours. For older orders, use a separate history endpoint (contact api@coinswitch.co).

MethodGET
Path/v5/order/realtime
AuthAuthenticated.

Query parameters

ParameterTypeRequiredDescription
categorystringYeslinear.
symbolstringNoFilter by symbol.
orderIdstringNoFilter by server-issued order ID.
orderLinkIdstringNoFilter by your custom order ID.
cursorstringNoPagination cursor — value of nextPageCursor from the previous page.

Request

from reference_client import sign_request, BASE_URL
import requests

headers, path = sign_request(
"GET",
"/v5/order/realtime",
{"category": "linear", "symbol": "BTCUSDT", "orderLinkId": "my-order-1"},
)
r = requests.get(BASE_URL + path, headers=headers)
print(r.json())

Response

{
"retCode": 0,
"retMsg": "OK",
"result": {
"category": "linear",
"list": [
{
"symbol": "BTCUSDT",
"orderId": "252b350d-ca18-4aca-9411-fcef79c122ec",
"orderLinkId": "my-order-1",
"orderType": "Limit",
"orderStatus": "New",
"side": "Buy",
"qty": "0.001",
"price": "50000",
"timeInForce": "GTC",
"leavesQty": "0.001",
"cumExecQty": "0",
"cumExecValue": "0",
"cumExecFee": "0",
"avgPrice": "",
"lastPriceOnCreated": "109761.4",
"positionIdx": 1,
"createdTime": "1756460699966",
"updatedTime": "1756460699969",
"rejectReason": "EC_NoError"
}
]
}
}

Response parameters

FieldTypeDescription
orderStatusstringSee Order Status.
qtystringOriginal order quantity.
leavesQtystringQuantity still resting on the book.
cumExecQtystringQuantity filled so far.
cumExecValuestringFilled notional in USDT.
cumExecFeestringTotal fees paid so far.
avgPricestringVolume-weighted average fill price. Empty until first fill.
lastPriceOnCreatedstringLast traded price at the moment the order was placed — useful for slippage analysis.
rejectReasonstringEC_NoError for successful orders. Otherwise indicates why the order was rejected.

Order Status

ValueMeaning
NewOrder placed, no fills yet.
PartiallyFilledSome quantity has filled; remainder is resting.
FilledOrder fully filled (terminal).
CancelledOrder cancelled (terminal).
RejectedOrder rejected at placement (terminal).