List Orders
Returns either open orders or closed orders depending on the open parameter. One endpoint, one URL.
- Open orders:
open=true. Defaultcountis25. - Closed orders:
open=false. Defaultcountis500.
HTTP
| Method | GET |
| Endpoint | /trade/api/v2/orders |
| Rate limit | 10000 requests per 10 seconds |
Request Parameters
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
open | bool | Yes | true for open orders, false for closed. |
count | integer | No | Page size. Default 25 for open, 500 for closed. |
from_time | integer | No | Filter: orders created at/after this timestamp (Unix ms). |
to_time | integer | No | Filter: orders created at/before this timestamp (Unix ms). |
side | string | No | buy or sell (case-insensitive). |
symbols | string | No | Comma-separated list. Examples: BTC/INR, BTC/USDT, btc/inr,eth/inr. |
exchanges | string | No | Comma-separated. See Exchange Identifiers. |
type | string | No | Order type. Defaults to LIMIT. |
status | string | No | Filter by exact status. Used primarily with open=false. |
Closed-order pagination
Closed-orders responses contain the latest 500 entries. For older records, email api@coinswitch.co.
Example
- Python
- Java
- Go
- Node.js
import requests
# Open orders
headers, path = sign_request("GET", "/trade/api/v2/orders", params={
"open": "true",
"exchanges": "coinswitchx,c2c1",
"symbols": "btc/inr,eth/inr",
"side": "sell",
"type": "limit",
"count": 25,
})
print(requests.get(BASE_URL + path, headers=headers).json())
# Closed orders
headers, path = sign_request("GET", "/trade/api/v2/orders", params={
"open": "false",
"exchanges": "coinswitchx,c2c1",
"symbols": "btc/inr,eth/inr",
"status": "EXECUTED",
"count": 100,
})
print(requests.get(BASE_URL + path, headers=headers).json())
HashMap<String, String> open = new HashMap<>();
open.put("open", "true");
open.put("exchanges", "coinswitchx,c2c1");
open.put("symbols", "btc/inr,eth/inr");
System.out.println(client.send("GET", "/trade/api/v2/orders", open, null).body());
HashMap<String, String> closed = new HashMap<>();
closed.put("open", "false");
closed.put("exchanges", "coinswitchx,c2c1");
closed.put("symbols", "btc/inr,eth/inr");
closed.put("status", "EXECUTED");
System.out.println(client.send("GET", "/trade/api/v2/orders", closed, null).body());
headers, p, err := SignRequest("GET", "/trade/api/v2/orders", map[string]string{
"open": "true",
"exchanges": "coinswitchx,c2c1",
"symbols": "btc/inr,eth/inr",
"side": "sell",
"type": "limit",
"count": 25,
})
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', '/trade/api/v2/orders', {
"open": "true",
"exchanges": "coinswitchx,c2c1",
"symbols": "btc/inr,eth/inr",
"side": "sell",
"type": "limit",
"count": 25,
});
const r = await fetch(BASE_URL + path, {
method: 'GET',
headers,
});
console.log(await r.json());
Response
{
"data": {
"orders": [
{
"order_id": "56013d06-7fe6-416f-9086-86902577ba99",
"symbol": "SHIB/INR",
"price": 0.000638,
"average_price": 0.000957,
"orig_qty": 187400,
"executed_qty": 0,
"status": "OPEN",
"side": "SELL",
"exchange": "coinswitchx",
"order_source": "API_TRADING",
"created_time": 1687173658000,
"updated_time": 1687173705000
}
]
}
}
If no orders match the filters, data.orders is an empty array.
Response Parameters
data.orders is an array of order objects. Each entry has the same shape as Create Order.