Skip to main content

Quick Start

Requirements

SDK Description

Package Dependency Description

Packages that must be installed regardless of which product's development kit is used.

  • webullpay-python-sdk-core

Packages that must be installed to use market subscription products.

  • webullpay-python-sdk-quotes-core

Packages that must be installed when subscribing to products using trade events.

  • webullpay-python-sdk-trade-events-core

Packages that need to be installed by default for the complete use of quotes SDK.

  • webullpay-python-sdk-core
  • webullpay-python-sdk-quotes-core
  • webullpay-python-sdk-mdata

Packages that need to be installed by default for the complete use of the trading SDK.

  • webullpay-python-sdk-core
  • webullpay-python-sdk-trade-events-core
  • webullpay-python-sdk-trade

SDK Installation

Install via pip

pip3 install --upgrade webullpay-python-sdk-core
pip3 install --upgrade webullpay-python-sdk-quotes-core
pip3 install --upgrade webullpay-python-sdk-mdata
pip3 install --upgrade webullpay-python-sdk-trade-events-core
pip3 install --upgrade webullpay-python-sdk-trade

API Host

tip

The Http API address is used for normal Http requests.

The trading alerts is used for real-time pushes such as order status changes.

The push address for the market news is used for receiving the pushes for real-time market news.

Production Environment

HTTP API: u1spay-openapi.webullpayapi.com
Trading news push: u1spay-openapi-event.webullpayapi.com
Market news API: u1spay-openapi-quotes.webullpaytechapi.com

Examples of API Calls

caution

The following interfaces are listed, and the default connection address is the production environment.

Http Interface List

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

your_app_key = "<your_app_key>"
your_app_secret = "<your_app_secret>"
api_client = ApiClient(your_app_key, your_app_secret, Region.US.value)
api = API(api_client)
if __name__ == '__main__':
res = api.account.get_app_subscriptions()
account_id = None
if res.status_code == 200:
print('app subscriptions:', res.json())
result = res.json()
account_id = result[0]['account_id']
print("account id:", account_id)

if account_id is None:
print("account id is null")