Skip to content

Commit 54011a9

Browse files
author
方佳
committed
Merge branch 'main_merge_260523_1' into 'main'
feat: Add support for Webull AU and TH See merge request webull/webull-openapi-python-sdk!30
2 parents 3023cb0 + e5bcb1f commit 54011a9

11 files changed

Lines changed: 63 additions & 16 deletions

File tree

‎README.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Webull OpenAPI Python SDK
22

3-
Note: This is the new version of the Webull SDK, currently applicable only to Webull Hong Kong, Webull US, or Webull JP, or Webull SG customers.
3+
Note: This is the new version of the Webull SDK, currently applicable only to Webull Hong Kong, Webull US, or Webull JP, Webull SG, or Webull TH, or Webull AU customers.
44

55
Webull OpenAPI aims to provide quantitative trading investors with convenient, fast and secure services. Webull aims to help every quant traders achieve flexible and changeable trading or market strategies.
66

@@ -24,6 +24,8 @@ Subscription to real-time information: Subscribe to order status changes, market
2424
| Webull US | https://www.webull.com/center#openApiManagement |
2525
| Webull JP | https://www.webull.co.jp/center/openapi/manage |
2626
| Webull SG | https://www.webull.com.sg/open-api-management|
27+
| Webull TH | https://www.webull.co.th/open-api-management |
28+
| Webull AU | https://www.webull.com.au/open-api-management |
2729

2830
- Requires Python 3.7 through 3.11.
2931

@@ -45,3 +47,5 @@ The bottom layer of Webull OpenAPI provides three protocols, HTTP / GRPC / MQTT,
4547
| Webull US | https://developer.webull.com/apis/docs |
4648
| Webull JP | https://developer.webull.co.jp/apis/docs |
4749
| Webull SG | https://developer.webull.com.sg/apis/docs |
50+
| Webull TH | https://developer.webull.co.th/apis/docs |
51+
| Webull AU | https://developer.webull.com.au/apis/docs |

‎samples/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '2.0.7'
1+
__version__ = '2.0.8'

‎tests/core/endpoint/test_endpoint.py‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,16 @@ def test_quotes_endpoint(self):
6565
endpoint = resolver.resolve(endpoint_request)
6666
self.assertEqual(endpoint, 'data-api.webull.com.sg')
6767

68+
_region_id = 'th'
69+
endpoint_request = ResolveEndpointRequest(_region_id, api_type.QUOTES)
70+
endpoint = resolver.resolve(endpoint_request)
71+
self.assertEqual(endpoint, 'data-api.webull.co.th')
72+
73+
_region_id = 'au'
74+
endpoint_request = ResolveEndpointRequest(_region_id, api_type.QUOTES)
75+
endpoint = resolver.resolve(endpoint_request)
76+
self.assertEqual(endpoint, 'data-api.webull.com.au')
77+
6878
def test_api_endpoint(self):
6979
"""
7080
Set by Request, and it only takes effect for the current Request. The sample code is as follows.
@@ -89,6 +99,17 @@ def test_api_endpoint(self):
8999
endpoint_request = ResolveEndpointRequest(_region_id)
90100
endpoint = resolver.resolve(endpoint_request)
91101
self.assertEqual(endpoint, 'api.webull.com.sg')
102+
103+
_region_id = 'th'
104+
endpoint_request = ResolveEndpointRequest(_region_id)
105+
endpoint = resolver.resolve(endpoint_request)
106+
self.assertEqual(endpoint, 'api.webull.co.th')
107+
108+
_region_id = 'au'
109+
endpoint_request = ResolveEndpointRequest(_region_id)
110+
endpoint = resolver.resolve(endpoint_request)
111+
self.assertEqual(endpoint, 'api.webull.com.au')
112+
92113
def test_event_endpoint(self):
93114
resolver = DefaultEndpointResolver(self)
94115
_region_id = 'us'
@@ -110,3 +131,13 @@ def test_event_endpoint(self):
110131
endpoint_request = ResolveEndpointRequest(_region_id, api_type.EVENTS)
111132
endpoint = resolver.resolve(endpoint_request)
112133
self.assertEqual(endpoint, 'events-api.webull.com.sg')
134+
135+
_region_id = 'th'
136+
endpoint_request = ResolveEndpointRequest(_region_id, api_type.EVENTS)
137+
endpoint = resolver.resolve(endpoint_request)
138+
self.assertEqual(endpoint, 'events-api.webull.co.th')
139+
140+
_region_id = 'au'
141+
endpoint_request = ResolveEndpointRequest(_region_id, api_type.EVENTS)
142+
endpoint = resolver.resolve(endpoint_request)
143+
self.assertEqual(endpoint, 'events-api.webull.com.au')

‎webull/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '2.0.7'
1+
__version__ = '2.0.8'

‎webull/core/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '2.0.7'
1+
__version__ = '2.0.8'
22

33
import logging
44

‎webull/core/common/region.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ class Region(Enum):
66
HK = 'hk'
77
JP = 'jp'
88
SG = 'sg'
9+
TH = 'th'
10+
AU = 'au'

‎webull/core/data/endpoints.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@
2121
"api": "api.webull.com.sg",
2222
"quotes-api": "data-api.webull.com.sg",
2323
"events-api": "events-api.webull.com.sg"
24+
},
25+
"th": {
26+
"api": "api.webull.co.th",
27+
"quotes-api": "data-api.webull.co.th",
28+
"events-api": "events-api.webull.co.th"
29+
},
30+
"au": {
31+
"api": "api.webull.com.au",
32+
"quotes-api": "data-api.webull.com.au",
33+
"events-api": "events-api.webull.com.au"
2434
}
2535
}
2636
}

‎webull/data/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# coding=utf-8
22

3-
__version__ = '2.0.7'
3+
__version__ = '2.0.8'

‎webull/trade/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '2.0.7'
1+
__version__ = '2.0.8'

‎webull/trade/trade/v2/account_info_v2.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(self, api_client):
2525

2626
def get_account_list(self):
2727
"""
28-
This interface is currently supported only for Webull HK, Webull US, and Webull JP, and Webull SG.
28+
This interface is currently supported only for Webull HK, Webull US, Webull JP, Webull TH, Webull AU, and Webull SG.
2929
Support for other regions will be available in future updates.
3030
"""
3131
account_list = GetAccountListRequest()
@@ -34,7 +34,7 @@ def get_account_list(self):
3434

3535
def get_account_balance(self, account_id):
3636
"""
37-
This interface is currently supported only for Webull HK, Webull US, and Webull JP, and Webull SG.
37+
This interface is currently supported only for Webull HK, Webull US, Webull JP, Webull TH, Webull AU, and Webull SG.
3838
Support for other regions will be available in future updates.
3939
"""
4040
account_balance_request = AccountBalanceRequest()
@@ -44,7 +44,7 @@ def get_account_balance(self, account_id):
4444

4545
def get_account_position(self, account_id):
4646
"""
47-
This interface is currently supported only for Webull HK, Webull US, and Webull JP, and Webull SG.
47+
This interface is currently supported only for Webull HK, Webull US, Webull JP, Webull TH, Webull AU, and Webull SG.
4848
Support for other regions will be available in future updates.
4949
"""
5050
account_positions_request = AccountPositionsRequest()

0 commit comments

Comments
 (0)