Skip to main content

Account Balance

Interface Description

  • Function description: Query account assets according to account id.

  • URL: /account/balance

  • Method: GET

  • Rate limit: The calling frequency of each App ID is limited to 10 times in 30 seconds.

Request Parameters

ParameterTypeRequired fieldsDescriptionExample value
account_idStringYesAccount IDco393b0ab01

Response Parameter

ParameterTypeDescriptionExample value
account_idStringAccount IDce1y2j80
currencyStringCurrency, USD onlyUSD
total_amountStringThe total assets of the account1247724759.52
available_amountStringAvailable Amount17724759.52
purchasing_amountStringBuying Power100
cash_balanceStringCash balance1158685845.00
total_valueStringTotal asset1247724759.52
total_market_valueStringTotal market value1247724759.52

Request Example

from webullpaysdktrade.api import API
from webullpaysdkcore.client import ApiClient
from webullpaysdkcore.common.region import Region

your_app_key = "<your_app_key>"
your_app_secret = "<your_app_secret>"
account_id = "account_id"

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

Response Example

{
"account_id": "co393b0ab01",
"currency": "USD",
"total_amount": "1103.47",
"cash_balance": "1113.47",
"purchasing_amount": "1113.47",
"available_amount": "1103.47",
"total_market_value": "1392.08",
"total_value": "2505.55"
}

Exception Example

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