Get direct customers trade volume
info
- Query traded volume by direct customer UID for a custom time range; spot and derivatives are aggregated; filtering aligns with the rebate interface in the same product (
productType,contractType). trade_volumeandfeein each coin row are in the original coin (not converted). Filled volume only (maker + taker); excludes unfilled, cancelled, and failed orders. Derivatives: notional / face value; spot: traded amount.
API rate limit: 5 req / sec
HTTP Request
GET /private/v1/broker/trade-volume
Request Parameters
| Parameter | Required | Type | Comments |
|---|---|---|---|
| from | false | long | Start time, Unix timestamp in milliseconds (inclusive) |
| to | false | long | End time, Unix timestamp in milliseconds (exclusive) |
| uid | false | string |
|
| cursor | false | string | Cursor for UID pagination; omit on the first request |
| limit | false | integer | Max UIDs per page, in [1, 50], default 20 |
| productType | false | string | Business filter: omit or ALL for spot + derivatives; SPOT; DERIVATIVES (same semantics as the rebate API) |
| contractType | false | string | Contract type filter; only applies when contract trades are included. Omit for all. e.g. LinearPerpetual, InversePerpetual, LinearFutures, InverseFutures |
| coin | false | string | Coin filter: omit to return all coins per UID; set to keep only that coin per UID |
Response Parameters
| Parameter | Type | Comments |
|---|---|---|
| list | array | One element per UID in this page |
| > user_id | string | Direct customer UID |
| > coins | array | Per-coin breakdown |
| > > coin | string | Coin |
| > > trade_volume | string | Filled volume in this coin for the range (see info above) |
| > > fee | string | Cumulative trading fee in this coin for the range; 0 if none |
| next_cursor | string | Cursor for the next UID page; empty when no more UIDs |
Request Example
import time
import hmac
import hashlib
import requests
import urllib.parse
def create_request(apiKey, secret, params):
url = 'https://openapi-testnet.zoomex.com/private/v1/broker/trade-volume'
timestamp = int(time.time() * 1000)
recv_window = 1000000
params['api_key'] = apiKey
params['timestamp'] = timestamp
params['recv_window'] = recv_window
ordered_params = '&'.join([f"{key}={params[key]}" for key in sorted(params.keys())])
signature = hmac.new(secret.encode('utf-8'), ordered_params.encode('utf-8'), hashlib.sha256).hexdigest()
params['sign'] = signature
headers = {
'X-BAPI-API-KEY': apiKey,
'X-BAPI-SIGN': signature,
'X-BAPI-TIMESTAMP': str(timestamp),
'X-BAPI-RECV-WINDOW': str(recv_window)
}
query_string = urllib.parse.urlencode(params)
full_url = f"{url}?{query_string}"
response = requests.get(full_url, headers=headers)
print("response status:", response.status_code)
print("response info:", response.json())
print("response time:", response.elapsed.total_seconds())
apiKey = 'your key'
secret = 'your secret'
params = {
"from": 1704067200000,
"to": 1706745600000,
"productType": "ALL",
"limit": 20,
}
create_request(apiKey, secret, params)
Response Example
{
"ret_code": 0,
"ret_msg": "OK",
"ext_code": "",
"result": {
"list": [
{
"user_id": "101479471",
"coins": [
{
"coin": "USDT",
"trade_volume": "125000.5",
"fee": "12.5"
}
]
}
],
"next_cursor": ""
},
"ext_info": null,
"time_now": 1718353045150
}