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).
| Method | GET |
| Path | /v5/order/realtime |
| Auth | Authenticated. |
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
category | string | Yes | linear. |
symbol | string | No | Filter by symbol. |
orderId | string | No | Filter by server-issued order ID. |
orderLinkId | string | No | Filter by your custom order ID. |
cursor | string | No | Pagination cursor — value of nextPageCursor from the previous page. |
Request
- Python
- Java
- Go
- Node.js
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())
HttpResponse<String> resp = client.send(
"GET", "/v5/order/realtime", Map.of("category", "linear", "symbol", "BTCUSDT", "orderLinkId", "my-order-1"), null);
System.out.println(resp.body());
headers, p, err := SignRequest("GET", "/v5/order/realtime", map[string]string{"category": "linear", "symbol": "BTCUSDT", "orderLinkId": "my-order-1"})
if err != nil { panic(err) }
req, _ := http.NewRequest("GET", BaseURL+p, nil)
for k, v := range headers { req.Header.Set(k, v) }
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(string(out))
const {signRequest, BASE_URL} = require('./reference-client');
const {headers, path} = signRequest('GET', '/v5/order/realtime', {"category": "linear", "symbol": "BTCUSDT", "orderLinkId": "my-order-1"});
const r = await fetch(BASE_URL + path, {
method: 'GET',
headers,
});
console.log(await 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
| Field | Type | Description |
|---|---|---|
orderStatus | string | See Order Status. |
qty | string | Original order quantity. |
leavesQty | string | Quantity still resting on the book. |
cumExecQty | string | Quantity filled so far. |
cumExecValue | string | Filled notional in USDT. |
cumExecFee | string | Total fees paid so far. |
avgPrice | string | Volume-weighted average fill price. Empty until first fill. |
lastPriceOnCreated | string | Last traded price at the moment the order was placed — useful for slippage analysis. |
rejectReason | string | EC_NoError for successful orders. Otherwise indicates why the order was rejected. |
Order Status
| Value | Meaning |
|---|---|
New | Order placed, no fills yet. |
PartiallyFilled | Some quantity has filled; remainder is resting. |
Filled | Order fully filled (terminal). |
Cancelled | Order cancelled (terminal). |
Rejected | Order rejected at placement (terminal). |