跳到主要内容

批量查询子账户现货余额

类型: GET

描述: /v4/broker/balances

域名: https://sapi.xt.com(现货域名)

使用经纪商母账户的 API Key 签名调用,批量查询经纪商名下子账户的现货资产。subAccountIds 点查与 cursor/limit 遍历二选一。

参数​

名称类型是否必填默认值描述取值范围
subAccountIdsstring否-子账户 id,逗号分隔;与 cursor 二选一最多 100 个
cursorlong否-游标:上一页最后一个子账户 id,按 id 升序遍历全部子账户-
limitint否50每页条数1-100
currenciesstring否-币种,逗号分隔;不传返回有余额的币种;传不存在的币种报参数错误最多 20 个
summaryOnlyboolean否false为 true 时仅返回折算总额,不返回币种明细true / false

请求示例​

curl -X GET 'https://sapi.xt.com/v4/broker/balances?limit=50&summaryOnly=true' \
-H 'validate-algorithms: HmacSHA256' \
-H 'validate-appkey: {accessKey}' \
-H 'validate-recvwindow: 5000' \
-H 'validate-timestamp: {timestamp}' \
-H 'validate-signature: {signature}'

响应示例​

Response
{
"rc": 0,
"mc": "SUCCESS",
"result": {
"items": [
{
"subAccountId": 10645823292041,
"totalUsdtAmount": "0.0000",
"totalBtcAmount": "0.00000000",
"assets": []
}
],
"hasNext": true,
"nextCursor": 10645823357632,
"timestamp": 1792149633665
}
}

响应参数​

名称类型描述
items[].subAccountIdlong子账户 id
items[].totalUsdtAmountstring折算 USDT 总额
items[].totalBtcAmountstring折算 BTC 总额
items[].assetsarray分币种资产明细;summaryOnly=true 时为空
hasNextboolean是否还有下一页
nextCursorlong下一页游标;无下一页时为 null
timestamplong响应时间戳(毫秒)