跳到主要内容

账户余额

接口说明

  • 功能说明:根据账户id查询账户资产。

  • 适用对象:通过OpenApi开发平台对接webull的客户。

  • 请求URL:/account/balance

  • 请求方式:GET

  • 频次限制:每个AppId调用频次限制为2秒2次。

请求参数

参数类型是否必填描述示例值
account_idString账户id20150320010101001
total_asset_currencyString总资产计价币种,取值参考字典值Currency,若为空则默认为HKDHKD

响应参数

参数类型描述示例值
account_idString账户id13467788
total_asset_currencyString总资产计价币种,取值参考字典值CurrencyHKD
total_assetString账户总资产,币种为total_asset_currency字段值。
total_asset=sum(net_liquidation_value*汇率)
1247724759.5266750000
total_market_valueString总市值,币种为total_asset_currency字段值。
total_market_value=sum(positions_market_value*汇率)
89038914.5212380000
total_cash_balanceString现金总额,币种为total_asset_currency字段值。
total_cash_balance=sum(cash_balance*汇率)
1158685845.0054370000
margin_utilization_rateString融资使用率,百分比。预留参数1.00
account_currency_assets[]Account_Currency_Asset账户资产列表

上述的汇率=Account_Currency_Asset中的currency币种兑换成total_asset_currency币种的汇率。

Account_Currency_Asset

参数类型描述示例值
currencyString币种,取值参考字典值CurrencyHKD
net_liquidation_valueString净资产
net_liquidation_value=positions_market_value+cash_balance+pending_incoming
458809435.440000
positions_market_valueString持仓市值153208546.140000
cash_balanceString现金余额305600889.300000
margin_powerString融资购买力305587431.940000
cash_powerString现金购买力305587431.940000
pending_incomingString在途资金0.000000
cash_frozenString冻结资金13457.360000
available_withdrawalString可提现金额305587431.940000
interests_unpaidString待付利息0.000000

请求示例

from webullsdktrade.api import API
from webullsdkcore.client import ApiClient
from webullsdkcore.common.region import Region

api_client = ApiClient(your_app_key, your_app_secret, Region.HK.value)
api = API(api_client)
response = api.account.get_account_balance(account_id,currency)
if response.status_code == 200:
account_balance = response.json()

响应示例

{
"account_id": "QJHO3P1PR9425Q6UAT7QLJTEKB",
"total_asset_currency": "CNH",
"total_asset": "1247724759.5266750000",
"total_market_value": "89038914.5212380000",
"total_cash_balance": "1158685845.0054370000",
"margin_utilization_rate": "1.00",
"account_currency_assets": [
{
"currency": "CNH",
"net_liquidation_value": "1008356844.580000",
"positions_market_value": "9110016.000000",
"cash_balance": "999246828.580000",
"margin_power": "999246828.580000",
"cash_power": "999246828.580000",
"pending_incoming": "0.000000",
"cash_frozen": "0.000000",
"available_withdrawal": "999246828.580000"
},
{
"currency": "HKD",
"net_liquidation_value": "458809435.440000",
"positions_market_value": "153208546.140000",
"cash_balance": "305600889.300000",
"margin_power": "305587431.940000",
"cash_power": "305587431.940000",
"pending_incoming": "0.000000",
"cash_frozen": "13457.360000",
"available_withdrawal": "305587431.940000"
},
{
"currency": "USD",
"net_liquidation_value": "934.710000",
"positions_market_value": "0.000000",
"cash_balance": "934.710000",
"margin_power": "5.050000",
"cash_power": "5.050000",
"pending_incoming": "0.000000",
"cash_frozen": "929.660000",
"available_withdrawal": "5.050000"
}
]
}

异常示例

{
"error_code": "INVALID_TOKEN",
"message": "401 UNAUTHORIZED \"app_id and account_id not related\""
}