Skip to main content

Assets

Webull’s Assets API enables developers to retrieve asset information over HTTP. For details, please refer to the API Reference.

Before calling the Assets API, you need to have an App Key and App Secret.

  • For individual users, please see: here.
  • For institutional users, please see: here.
Note

Due to security and regulatory requirements in Hong Kong, in addition to authentication via App Key and Secret signature, OpenAPI also requires Token authentication. For details on Token creation and verification, please refer to Token Creation and Verification.

1. Base URLs

  • Production Environment: https://api.webull.hk/
  • Sandbox Environment: https://api.sandbox.webull.hk

2. Code Example

from webull.core.client import ApiClient
from webull.trade.trade_client import TradeClient

optional_api_endpoint = "<webull_api_host>" # PRD env host: api.webull.hk. Test env host: api.sanbox.webull.hk
your_app_key = "<your_app_key>"
your_app_secret = "<your_app_secret>"
region_id = "hk"
account_id = "<your_account_id>" # Use account_list interface to get account info
api_client = ApiClient(your_app_key, your_app_secret, region_id)
api_client.add_endpoint(region_id, optional_api_endpoint)


if __name__ == '__main__':
trade_client = TradeClient(api_client)

res = trade_client.account_v2.get_account_balance("account_id")
if res.status_code == 200:
print('get account balance info:', res.json())

res = trade_client.account_v2.get_account_position("account_id")
if res.status_code == 200:
print('get account positions info:', res.json())