Skip to content

Commit 8533581

Browse files
author
方佳
committed
Merge branch 'main_merge_260605' into 'main'
feat: Add support for Webull BR and MX See merge request webull/webull-openapi-python-sdk!32
2 parents f025a52 + 97cc4b3 commit 8533581

11 files changed

Lines changed: 65 additions & 19 deletions

File tree

‎README.md‎

Lines changed: 6 additions & 2 deletions
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, Webull JP, Webull SG, Webull TH, Webull AU, Webull MY, or Webull UK customers.
3+
Note: This is the new version of the Webull SDK, currently applicable only to Webull Hong Kong, Webull US, Webull JP, Webull SG, Webull TH, Webull AU, Webull MY, Webull UK, Webull BR, or Webull MX 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

@@ -28,6 +28,8 @@ Subscription to real-time information: Subscribe to order status changes, market
2828
| Webull AU | https://www.webull.com.au/open-api-management |
2929
| Webull MY | https://www.webull.com.my/open-api-management |
3030
| Webull UK | https://www.webull-uk.com/open-api-management |
31+
| Webull BR | https://www.webull.com.br/open-api-management |
32+
| Webull MX | https://www.webull.com.mx/open-api-management |
3133
- Requires Python 3.7 through 3.11.
3234

3335
## Interface Protocol
@@ -51,4 +53,6 @@ The bottom layer of Webull OpenAPI provides three protocols, HTTP / GRPC / MQTT,
5153
| Webull TH | https://developer.webull.co.th/apis/docs |
5254
| Webull AU | https://developer.webull.com.au/apis/docs |
5355
| Webull MY | https://developer.webull.com.my/apis/docs |
54-
| Webull UK | https://developer.webull-uk.com/apis/docs |
56+
| Webull UK | https://developer.webull-uk.com/apis/docs |
57+
| Webull BR | https://developer.webull.com.br/apis/docs/ |
58+
| Webull MX | https://developer.webull.com.mx/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.9'
1+
__version__ = '2.0.10'

‎tests/core/endpoint/test_endpoint.py‎

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,16 @@ def test_quotes_endpoint(self):
8484
endpoint_request = ResolveEndpointRequest(_region_id, api_type.QUOTES)
8585
endpoint = resolver.resolve(endpoint_request)
8686
self.assertEqual(endpoint, 'data-api.webull-uk.com')
87+
88+
_region_id = 'br'
89+
endpoint_request = ResolveEndpointRequest(_region_id, api_type.QUOTES)
90+
endpoint = resolver.resolve(endpoint_request)
91+
self.assertEqual(endpoint, 'data-api.webull.com')
92+
93+
_region_id = 'mx'
94+
endpoint_request = ResolveEndpointRequest(_region_id, api_type.QUOTES)
95+
endpoint = resolver.resolve(endpoint_request)
96+
self.assertEqual(endpoint, 'data-api.webull.com')
8797
def test_api_endpoint(self):
8898
"""
8999
Set by Request, and it only takes effect for the current Request. The sample code is as follows.
@@ -128,6 +138,16 @@ def test_api_endpoint(self):
128138
endpoint_request = ResolveEndpointRequest(_region_id)
129139
endpoint = resolver.resolve(endpoint_request)
130140
self.assertEqual(endpoint, 'api.webull-uk.com')
141+
142+
_region_id = 'br'
143+
endpoint_request = ResolveEndpointRequest(_region_id)
144+
endpoint = resolver.resolve(endpoint_request)
145+
self.assertEqual(endpoint, 'api.webull.com')
146+
147+
_region_id = 'mx'
148+
endpoint_request = ResolveEndpointRequest(_region_id)
149+
endpoint = resolver.resolve(endpoint_request)
150+
self.assertEqual(endpoint, 'api.webull.com')
131151
def test_event_endpoint(self):
132152
resolver = DefaultEndpointResolver(self)
133153
_region_id = 'us'
@@ -168,4 +188,14 @@ def test_event_endpoint(self):
168188
_region_id = 'uk'
169189
endpoint_request = ResolveEndpointRequest(_region_id, api_type.EVENTS)
170190
endpoint = resolver.resolve(endpoint_request)
171-
self.assertEqual(endpoint, 'events-api.webull-uk.com')
191+
self.assertEqual(endpoint, 'events-api.webull-uk.com')
192+
193+
_region_id = 'br'
194+
endpoint_request = ResolveEndpointRequest(_region_id, api_type.EVENTS)
195+
endpoint = resolver.resolve(endpoint_request)
196+
self.assertEqual(endpoint, 'events-api.webull.com')
197+
198+
_region_id = 'mx'
199+
endpoint_request = ResolveEndpointRequest(_region_id, api_type.EVENTS)
200+
endpoint = resolver.resolve(endpoint_request)
201+
self.assertEqual(endpoint, 'events-api.webull.com')

‎webull/__init__.py‎

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

‎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.9'
1+
__version__ = '2.0.10'
22

33
import logging
44

‎webull/core/common/region.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ class Region(Enum):
1010
AU = 'au'
1111
MY = 'my'
1212
UK = 'uk'
13+
BR = 'br'
14+
MX = 'mx'

‎webull/core/data/endpoints.json‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"default_region": "us",
3-
"regions": ["us", "hk", "jp", "sg", "th", "au", "my", "uk"],
3+
"regions": ["us", "hk", "jp", "sg", "th", "au", "my", "uk", "br", "mx"],
44
"region_mapping": {
55
"us": {
66
"api": "api.webull.com",
@@ -41,6 +41,16 @@
4141
"api": "api.webull-uk.com",
4242
"quotes-api": "data-api.webull-uk.com",
4343
"events-api": "events-api.webull-uk.com"
44+
},
45+
"br": {
46+
"api": "api.webull.com",
47+
"quotes-api": "data-api.webull.com",
48+
"events-api": "events-api.webull.com"
49+
},
50+
"mx": {
51+
"api": "api.webull.com",
52+
"quotes-api": "data-api.webull.com",
53+
"events-api": "events-api.webull.com"
4454
}
4555
}
4656
}

‎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.9'
3+
__version__ = '2.0.10'

‎webull/trade/__init__.py‎

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

‎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, Webull JP, Webull SG, Webull TH, Webull AU, Webull MY, Webull UK.
28+
This interface is currently supported only for Webull HK, Webull US, Webull JP, Webull SG, Webull TH, Webull AU, Webull MY, Webull UK, Webull BR, Webull MX.
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, Webull JP, Webull SG, Webull TH, Webull AU, Webull MY, Webull UK.
37+
This interface is currently supported only for Webull HK, Webull US, Webull JP, Webull SG, Webull TH, Webull AU, Webull MY, Webull UK, Webull BR, Webull MX.
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, Webull JP, Webull SG, Webull TH, Webull AU, Webull MY, Webull UK.
47+
This interface is currently supported only for Webull HK, Webull US, Webull JP, Webull SG, Webull TH, Webull AU, Webull MY, Webull UK, Webull BR, Webull MX.
4848
Support for other regions will be available in future updates.
4949
"""
5050
account_positions_request = AccountPositionsRequest()

0 commit comments

Comments
 (0)