Quick Start
Requirements
- Generate the app key and app secret on the Webull Pay official website.
- Requirements for Programming language version:
- Python
- Java
Requires Python 3.8 - 3.12
JDK 8 or above needs to be installed.
SDK Description
Package Dependency Description
- Python
- Java
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
Libraries that must be added for the complete use of quotes SDK.
webullpay-java-sdk-quotes
Libraries that must be added when subscribing to products using trade events.
webullpay-java-sdk-trade-events
Libraries that need to be added by default for the complete use of the trading SDK.
webullpay-java-sdk-trade-events
webullpay-java-sdk-trade
SDK Installation
- Python
- Java
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
Maven configuration
<dependencies>
<dependency>
<groupId>com.webullpay.openapi</groupId>
<artifactId>webullpay-java-sdk-quotes</artifactId>
<version>0.1.0</version>
</dependency>
<dependency>
<groupId>com.webullpay.openapi</groupId>
<artifactId>webullpay-java-sdk-trade-events</artifactId>
<version>0.1.0</version>
</dependency>
<dependency>
<groupId>com.webullpay.openapi</groupId>
<artifactId>webullpay-java-sdk-trade</artifactId>
<version>0.1.0</version>
</dependency>
</dependencies>
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
- Python
- Java
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")
import com.webullpay.openapi.common.Region;
import com.webullpay.openapi.http.HttpApiConfig;
import com.webullpay.openapi.trade.api.TradeApiService;
import com.webullpay.openapi.trade.api.http.TradeHttpApiService;
import com.webullpay.openapi.trade.api.response.Account;
import com.webullpay.openapi.logger.Logger;
import com.webullpay.openapi.logger.LoggerFactory;
import com.webullpay.openapi.utils.CollectionUtils;
import com.webullpay.openapi.utils.StringUtils;
import java.util.List;
public class TradeAccountId {
private static final Logger logger = LoggerFactory.getLogger(TradeAccountId.class);
public static void main(String[] args) {
HttpApiConfig apiConfig = HttpApiConfig.builder()
.appKey("<your_app_key>")
.appSecret("<your_app_secret>")
.regionId(Region.us.name())
.build();
TradeApiService apiService = new TradeHttpApiService(apiConfig);
List<Account> accounts = apiService.getAccountList("");
if (CollectionUtils.isNotEmpty(accounts)) {
String accountId = accounts.get(0).getAccountId();
if (StringUtils.isNotBlank(accountId)) {
logger.info("Account id: {}", accountId);
return;
}
}
logger.info("Account id is empty.");
}
}