跳至主要内容

賬戶餘額

接口說明

  • 功能說明:根據賬戶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\""
}