Get Exchange Broker Earning
info
- Use exchange broker master account to query
- The data can support up to past 12 months until T-1
begin
&end
are either entered at the same time or not entered, and latest 7 days data are returned by default
API rate limit: 10 req / sec
HTTP Request
GET /private/v1/broker/earnings-info
Request Parameters
Parameter | Required | Type | Comments |
---|---|---|---|
productType | false | string | Business type. SPOT , DERIVATIVES |
begin | false | string | Start time, format: YYYYMMDD, for example, 20231201, indicating that the search time is from December 1, 2023 00:00:00 UTC (inclusive) |
end | false | string | End time, format: YYYYMMDD, for example, 20231201, indicating that the search time ended on December 2, 2023 at 00:00:00 UTC (not included) |
uid | false | string |
|
limit | false | integer | Page quantity limit [1 , 1000 ] Default: 1000 |
cursor | false | integer | Cursor, used for flipping pages, does not need to be passed on the first call |
Response Parameters
Parameter | Type | Comments |
---|---|---|
coin_detail | array | Object. Rebate data for various businesses |
> product_type | string | Business type. SPOT, DERIVATIVES |
> coin | string | Rebate coin |
> rebate_fee | string | Rebate amount |
user_detail | array | Object. Transaction details for each sub UID and each business type |
> user_id | string | UID |
> product_type | string | Business type. SPOT, DERIVATIVES |
> coin | string | Rebate coin |
> rebate_fee | string | Rebate amount |
> dt | string | date |
next_cursor | integer | Cursor, used for flipping pages |
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/earnings-info'
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 = {
"productType": "DERIVATIVES",
}
create_request(apiKey, secret, params)
Response Example
{
"ret_code": 0,
"ret_msg": "OK",
"ext_code": "",
"result": {
"coin_detail": [
{
"product_type": "DERIVATIVES",
"coin": "USDT",
"rebate_fee": "0.845657"
}
],
"user_detail": [
{
"user_id": "101479471",
"product_type": "DERIVATIVES",
"coin": "USDT",
"rebate_fee": "0.22783662",
"dt": "2024-06-12"
},
{
"user_id": "101479471",
"product_type": "DERIVATIVES",
"coin": "USDT",
"rebate_fee": "0.61782038",
"dt": "2024-06-11"
}
],
"next_cursor": 688
},
"ext_info": null,
"time_now": 1718353045150
}