Skip to content

Commit 9f57d50

Browse files
committed
feat:Update pagination for some query APIs
1 parent 6ba9970 commit 9f57d50

19 files changed

Lines changed: 831 additions & 91 deletions

File tree

‎pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<groupId>com.webull.openapi</groupId>
2222
<artifactId>webull-openapi-java-sdk-parent</artifactId>
2323
<packaging>pom</packaging>
24-
<version>1.1.21</version>
24+
<version>2.0.0</version>
2525

2626
<name>webull-openapi-java-sdk-parent</name>
2727
<url>https://github.com/webull-inc/webull-openapi-java-sdk/</url>

‎webull-openapi-java-sdk-samples/pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<groupId>com.webull.openapi</groupId>
2121
<artifactId>webull-openapi-java-sdk-parent</artifactId>
22-
<version>1.1.21</version>
22+
<version>2.0.0</version>
2323
</parent>
2424
<modelVersion>4.0.0</modelVersion>
2525

‎webull-openapi-java-sdk-samples/src/main/java/com/webull/openapi/samples/data/DataClient.java‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.webull.openapi.samples.data;
22

3+
import com.webull.openapi.core.common.dict.ActiveRankType;
34
import com.webull.openapi.core.common.dict.Category;
45
import com.webull.openapi.core.common.dict.ContractType;
56
import com.webull.openapi.core.common.dict.FiftyTwoWeekRankType;
@@ -8,6 +9,7 @@
89
import com.webull.openapi.core.common.dict.MarketSectorAggType;
910
import com.webull.openapi.core.common.dict.MarketSectorPeriod;
1011
import com.webull.openapi.core.common.dict.ScreenerOrderBy;
12+
import com.webull.openapi.core.common.dict.ScreenerRankType;
1113
import com.webull.openapi.core.common.dict.SortDirection;
1214
import com.webull.openapi.core.common.dict.Timespan;
1315
import com.webull.openapi.core.http.HttpApiConfig;
@@ -270,6 +272,24 @@ public static void main(String[] args) {
270272
FiftyTwoWeekResponse newHighs = dataClient.get52Whl(FiftyTwoWeekRankType.NEW_HIGH.name(), Category.US_STOCK.name(), ScreenerOrderBy.CHANGE_RATIO_52W.name(), 1, 10, SortDirection.DESC.name());
271273
logger.info("52-Week New Highs: {}", newHighs);
272274

275+
// ==================== Screener ranking APIs (not paginated, returns top 200) ====================
276+
277+
// Get top gainers/losers ranking
278+
List<ScreenerStock> gainersLosersRank = dataClient.getGainersLosers(ScreenerRankType.DAY_1.name(), Category.US_STOCK.name(), ScreenerOrderBy.CHANGE_RATIO.name(), SortDirection.DESC.name());
279+
logger.info("Gainers/Losers ranking (top 200): {}", gainersLosersRank);
280+
281+
// Get most active stocks ranking
282+
List<ScreenerStock> mostActiveRank = dataClient.getMostActive(Category.US_STOCK.name(), ActiveRankType.VOLUME.name(), ScreenerOrderBy.VOLUME.name(), SortDirection.DESC.name());
283+
logger.info("Most Active ranking (top 200): {}", mostActiveRank);
284+
285+
// Get high dividend stocks ranking
286+
List<HighDividendStock> highDividendRank = dataClient.getHighDividend(Category.US_STOCK.name(), ScreenerOrderBy.YIELD.name(), SortDirection.DESC.name());
287+
logger.info("High Dividend ranking (top 200): {}", highDividendRank);
288+
289+
// Get 52-week high/low ranking
290+
List<FiftyTwoWeekStock> fiftyTwoWeekRank = dataClient.get52Whl(FiftyTwoWeekRankType.NEW_HIGH.name(), Category.US_STOCK.name(), ScreenerOrderBy.CHANGE_RATIO_52W.name(), SortDirection.DESC.name());
291+
logger.info("52-Week High/Low ranking (top 200): {}", fiftyTwoWeekRank);
292+
273293
// Get option contracts
274294
OptionContractQueryParam optionParam = new OptionContractQueryParam();
275295
optionParam.setCategory(Category.US_OPTION.name());

‎webull-openapi-java-sdk/pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>com.webull.openapi</groupId>
99
<artifactId>webull-openapi-java-sdk-parent</artifactId>
10-
<version>1.1.21</version>
10+
<version>2.0.0</version>
1111
</parent>
1212

1313
<artifactId>webull-openapi-java-sdk</artifactId>

‎webull-openapi-java-sdk/src/main/java/com/webull/openapi/core/common/Versions.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ private Versions() {
2323
public static final String V1 = "v1";
2424

2525
public static final String V2 = "v2";
26+
27+
public static final String V3 = "v3";
2628
}

‎webull-openapi-java-sdk/src/main/java/com/webull/openapi/core/config/ProjectReaderHelper.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ private ProjectReaderHelper() {
2424

2525
private static final String APPLICATION_VERSION = "application.version";
2626

27-
private static final String DEFAULT_APPLICATION_VERSION = "1.1.19";
27+
private static final String DEFAULT_APPLICATION_VERSION = "2.0.0";
2828

2929
private static final String APPLICATION_NAME = "application.name";
3030

‎webull-openapi-java-sdk/src/main/java/com/webull/openapi/core/http/initializer/config/ConfigService.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public ConfigService(HttpApiClient apiClient) {
4141
*/
4242
public ApiConfig getConfig() {
4343

44-
HttpRequest request = new HttpRequest("/openapi/config", Versions.V2, HttpMethod.GET);
44+
HttpRequest request = new HttpRequest("/openapi/config", Versions.V3, HttpMethod.GET);
4545
return apiClient.request(request).responseType(ApiConfig.class).doAction();
4646

4747
}

‎webull-openapi-java-sdk/src/main/java/com/webull/openapi/core/http/initializer/token/TokenService.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public TokenService(HttpApiClient apiClient) {
5555
*/
5656
public AccessToken createToken(String token) {
5757

58-
HttpRequest request = new HttpRequest("/openapi/auth/token/create", Versions.V2, HttpMethod.POST);
58+
HttpRequest request = new HttpRequest("/auth/tokens/create", Versions.V3, HttpMethod.POST);
5959

6060
Map<String, Object> params = new HashMap<>();
6161
if(StringUtils.isNotBlank(token)){
@@ -74,7 +74,7 @@ public AccessToken createToken(String token) {
7474
public AccessToken checkToken(String token) {
7575

7676
Assert.notBlank(TOKEN_ARG, token);
77-
HttpRequest request = new HttpRequest("/openapi/auth/token/check", Versions.V2, HttpMethod.POST);
77+
HttpRequest request = new HttpRequest("/auth/tokens/check", Versions.V3, HttpMethod.POST);
7878
Map<String, Object> params = new HashMap<>();
7979
params.put(TOKEN_ARG, token);
8080
request.setBody(params);
@@ -90,7 +90,7 @@ public AccessToken checkToken(String token) {
9090
public AccessToken refreshToken(String token) {
9191

9292
Assert.notBlank(TOKEN_ARG, token);
93-
HttpRequest request = new HttpRequest("/openapi/auth/token/refresh", Versions.V2, HttpMethod.POST);
93+
HttpRequest request = new HttpRequest("/auth/tokens/refresh", Versions.V3, HttpMethod.POST);
9494
Map<String, Object> params = new HashMap<>();
9595
params.put(TOKEN_ARG, token);
9696
request.setBody(params);

0 commit comments

Comments
 (0)