General Information on Endpoints
Request Methods
| Method | Usage | Example |
|---|---|---|
GET | Retrieve data (queries) | List orders, get order book |
POST | Create or execute actions | Submit order, login |
PUT | Update resources | Update user profile |
DELETE | Remove resources | Revoke credential |
Response Format
Success Response (Single Object)
{
"data": {
"tradingAccountId": "550e8400-e29b-41d4-a716-446655440000",
"venue": "BINANCE",
"status": "CONNECTED"
},
"success": true,
"errno": 0,
"error": null
}
Success Response (List)
{
"data": [
{ "instrumentId": "BINANCE:BTC/USDT", ... },
{ "instrumentId": "BINANCE:ETH/USDT", ... }
],
"success": true,
"errno": 0,
"error": null,
"pagination": {
"offset": 0,
"limit": 100,
"total": 250
}
}
Pagination
List endpoints support pagination with these query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 100 | Maximum results per request (max: 1000) |
offset | integer | 0 | Number of records to skip |
cursor | string | - | Cursor for cursor-based pagination |
Offset-Based Pagination
# Page 1
response = requests.get(f"{BASE_URL}/api/v3/tradeOrder/list",
params={"limit": 50, "offset": 0},
headers=headers
)
# Page 2
response = requests.get(f"{BASE_URL}/api/v3/tradeOrder/list",
params={"limit": 50, "offset": 50},
headers=headers
)
Cursor-Based Pagination
For large datasets, use cursor-based pagination:
cursor = None
all_orders = []
while True:
params = {"limit": 100}
if cursor:
params["cursor"] = cursor
response = requests.get(f"{BASE_URL}/api/v3/tradeOrder/list",
params=params,
headers=headers
)
data = response.json()
all_orders.extend(data["data"])
cursor = data.get("pagination", {}).get("nextCursor")
if not cursor:
break
Sorting
Some list endpoints support sorting:
| Parameter | Type | Description |
|---|---|---|
sortBy | string | Field to sort by |
sortOrder | string | asc or desc |
response = requests.get(f"{BASE_URL}/api/v3/tradeOrder/list",
params={"sortBy": "createdAt", "sortOrder": "desc"},
headers=headers
)
Filtering
List endpoints accept filter parameters specific to each resource:
# Filter orders by status and time range
response = requests.get(f"{BASE_URL}/api/v3/tradeOrder/list",
params={
"status": "OPEN",
"startTime": 1703000000000,
"endTime": 1703100000000
},
headers=headers
)