Skip to content

Commit 823c740

Browse files
feat:add market data api
1 parent 1ef80ba commit 823c740

49 files changed

Lines changed: 5589 additions & 5 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎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.13</version>
24+
<version>1.1.14</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.13</version>
22+
<version>1.1.14</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: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
import com.webull.openapi.core.common.dict.Category;
44
import com.webull.openapi.core.common.dict.ContractType;
5+
import com.webull.openapi.core.common.dict.FiftyTwoWeekRankType;
6+
import com.webull.openapi.core.common.dict.FinancialReportType;
7+
import com.webull.openapi.core.common.dict.IndustryComparisonSortBy;
8+
import com.webull.openapi.core.common.dict.MarketSectorAggType;
9+
import com.webull.openapi.core.common.dict.MarketSectorPeriod;
10+
import com.webull.openapi.core.common.dict.ScreenerOrderBy;
11+
import com.webull.openapi.core.common.dict.SortDirection;
512
import com.webull.openapi.core.common.dict.Timespan;
613
import com.webull.openapi.core.http.HttpApiConfig;
714
import com.webull.openapi.core.logger.Logger;
@@ -158,6 +165,110 @@ public static void main(String[] args) {
158165
OptionTick OptionTicks = dataClient.getOptionTicks("AAPL260522C00300000", Category.US_OPTION.name(), 30);
159166
logger.info("Option Ticks: {}", OptionTicks);
160167

168+
// Get capital flow data (default 5 days)
169+
List<CapitalFlow> capitalFlow = dataClient.getCapitalFlow("AAPL", Category.US_STOCK.name(), null);
170+
logger.info("Capital Flow (default 5 days): {}", capitalFlow);
171+
172+
// Get capital flow data with specific count
173+
List<CapitalFlow> capitalFlow3 = dataClient.getCapitalFlow("AAPL", Category.US_STOCK.name(), 3);
174+
logger.info("Capital Flow (3 days): {}", capitalFlow3);
175+
176+
// Get industry comparison (default sort by EPS_TTM)
177+
IndustryComparison industryComparison = dataClient.getIndustryComparison("AAPL", Category.US_STOCK.name(), null);
178+
logger.info("Industry Comparison (default EPS_TTM): {}", industryComparison);
179+
180+
// Get industry comparison sorted by PE_TTM
181+
IndustryComparison industryComparisonPe = dataClient.getIndustryComparison("AAPL", Category.US_STOCK.name(), IndustryComparisonSortBy.PE_TTM.name());
182+
logger.info("Industry Comparison (PE_TTM): {}", industryComparisonPe);
183+
184+
// Get earnings calendar
185+
List<EarningsCalendar> earningsCalendar = dataClient.getEarningsCalendar("AAPL", Category.US_STOCK.name());
186+
logger.info("Earnings Calendar: {}", earningsCalendar);
187+
188+
// Get dividend calendar
189+
List<DividendCalendar> dividendCalendar = dataClient.getDividendCalendar("AAPL", Category.US_STOCK.name());
190+
logger.info("Dividend Calendar: {}", dividendCalendar);
191+
192+
// Get forecast EPS
193+
List<ForecastEps> forecastEps = dataClient.getForecastEps("AAPL", Category.US_STOCK.name());
194+
logger.info("Forecast EPS: {}", forecastEps);
195+
196+
// Get SEC filings
197+
SecFilings secFilings = dataClient.getSecFilings("AAPL", Category.US_STOCK.name());
198+
logger.info("SEC Filings: {}", secFilings);
199+
200+
// Get fund splits
201+
List<FundSplit> fundSplits = dataClient.getFundSplits("QQQ", Category.US_STOCK.name());
202+
logger.info("Fund Splits: {}", fundSplits);
203+
204+
// Get fund rating
205+
List<FundRating> fundRating = dataClient.getFundRating("QQQ", Category.US_STOCK.name());
206+
logger.info("Fund Rating: {}", fundRating);
207+
208+
// Get fund performance
209+
FundPerformance fundPerformance = dataClient.getFundPerformance("QQQ", Category.US_STOCK.name());
210+
logger.info("Fund Performance: {}", fundPerformance);
211+
212+
// Get fund net value (default 5 records)
213+
List<FundNetValue> fundNetValue = dataClient.getFundNetValue("QQQ", Category.US_STOCK.name(), null, null);
214+
logger.info("Fund Net Value: {}", fundNetValue);
215+
216+
// Get fund holdings
217+
List<FundHolding> fundHoldings = dataClient.getFundHoldings("QQQ", Category.US_STOCK.name());
218+
logger.info("Fund Holdings: {}", fundHoldings);
219+
220+
// Get fund files
221+
List<FundFile> fundFiles = dataClient.getFundFiles("QQQ", Category.US_STOCK.name());
222+
logger.info("Fund Files: {}", fundFiles);
223+
224+
// Get fund dividends
225+
List<FundDividend> fundDividends = dataClient.getFundDividends("QQQ", Category.US_STOCK.name(), 1, 10);
226+
logger.info("Fund Dividends: {}", fundDividends);
227+
228+
// Get fund brief
229+
FundBrief fundBrief = dataClient.getFundBrief("QQQ", Category.US_STOCK.name());
230+
logger.info("Fund Brief: {}", fundBrief);
231+
232+
// Get fund allocation
233+
List<FundAllocation> fundAllocation = dataClient.getFundAllocation("QQQ", Category.US_STOCK.name());
234+
logger.info("Fund Allocation: {}", fundAllocation);
235+
236+
// Get financial indicators (quarterly, default 5)
237+
FinancialIndicators indicators = dataClient.getFinancialsIndicators("AAPL", Category.US_STOCK.name(), FinancialReportType.QUARTERLY.name(), 5);
238+
logger.info("Financial Indicators: {}", indicators);
239+
240+
// Get income statement (quarterly, default 5)
241+
List<FinancialIncome> incomeStatements = dataClient.getFinancialsIncome("AAPL", Category.US_STOCK.name(), FinancialReportType.QUARTERLY.name(), 5);
242+
logger.info("Income Statements: {}", incomeStatements);
243+
244+
// Get cash flow statement (quarterly, default 5)
245+
List<FinancialCashflow> cashflows = dataClient.getFinancialsCashflow("AAPL", Category.US_STOCK.name(), FinancialReportType.QUARTERLY.name(), 5);
246+
logger.info("Cash Flow Statements: {}", cashflows);
247+
248+
// Get balance sheet (quarterly, default 5)
249+
List<FinancialBalanceSheet> balanceSheets = dataClient.getFinancialsBalanceSheet("AAPL", Category.US_STOCK.name(), FinancialReportType.QUARTERLY.name(), 5);
250+
logger.info("Balance Sheets: {}", balanceSheets);
251+
252+
// Get financial alert
253+
FinancialAlert financialAlert = dataClient.getFinancialsAlert("AAPL", Category.US_STOCK.name());
254+
logger.info("Financial Alert: {}", financialAlert);
255+
256+
// Get market sectors
257+
List<MarketSector> marketSectors = dataClient.getMarketSectors(Category.US_STOCK.name(), MarketSectorAggType.MARKET_VALUE.name(), MarketSectorPeriod.D1.name(), 1, 10, SortDirection.DESC.name());
258+
logger.info("Market Sectors: {}", marketSectors);
259+
260+
// Get market sector detail
261+
MarketSectorDetail sectorDetail = dataClient.getMarketSectorsDetail("6391", Category.US_STOCK.name(), MarketSectorPeriod.D1.name(), 1, 10, ScreenerOrderBy.CHANGE_RATIO.name(), SortDirection.DESC.name());
262+
logger.info("Market Sector Detail: {}", sectorDetail);
263+
264+
// Get high dividend stocks
265+
HighDividendResponse highDividend = dataClient.getHighDividend(Category.US_STOCK.name(), ScreenerOrderBy.YIELD.name(), 1, 10, SortDirection.DESC.name());
266+
logger.info("High Dividend Stocks: {}", highDividend);
267+
268+
// Get 52-week new high stocks
269+
FiftyTwoWeekResponse newHighs = dataClient.get52Whl(FiftyTwoWeekRankType.NEW_HIGH.name(), Category.US_STOCK.name(), ScreenerOrderBy.CHANGE_RATIO_52W.name(), 1, 10, SortDirection.DESC.name());
270+
logger.info("52-Week New Highs: {}", newHighs);
271+
161272

162273
// // get end of day market
163274
// List<EodBars> eodBars = IDataClient.getEodBars(instrumentIds, "2023-01-01", 10);

‎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.13</version>
10+
<version>1.1.14</version>
1111
</parent>
1212

1313
<artifactId>webull-openapi-java-sdk</artifactId>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright 2022 Webull
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.webull.openapi.core.common.dict;
17+
18+
/**
19+
* Rank type for 52-week high/low screener API.
20+
*/
21+
public enum FiftyTwoWeekRankType {
22+
23+
NEW_HIGH,
24+
NEAR_HIGH,
25+
NEW_LOW,
26+
NEAR_LOW
27+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright 2022 Webull
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.webull.openapi.core.common.dict;
17+
18+
/**
19+
* Financial report period type.
20+
*/
21+
public enum FinancialReportType {
22+
23+
ANNUAL,
24+
QUARTERLY
25+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright 2022 Webull
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.webull.openapi.core.common.dict;
17+
18+
/**
19+
* Sort field for industry comparison API.
20+
*/
21+
public enum IndustryComparisonSortBy {
22+
23+
EPS_TTM,
24+
NAPS,
25+
DPS_TTM,
26+
ROE,
27+
DEBT_TO_ASSETS,
28+
NET_MARGIN,
29+
DIV_YIELD_TTM,
30+
PE_TTM,
31+
PB_RATIO
32+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright 2022 Webull
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.webull.openapi.core.common.dict;
17+
18+
/**
19+
* Aggregation type for market sectors API.
20+
*/
21+
public enum MarketSectorAggType {
22+
23+
MARKET_VALUE,
24+
VOLUME
25+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright 2022 Webull
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.webull.openapi.core.common.dict;
17+
18+
/**
19+
* Period for market sectors API.
20+
*/
21+
public enum MarketSectorPeriod {
22+
23+
D1,
24+
D5,
25+
M01,
26+
M03
27+
}

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,20 @@ public enum ScreenerOrderBy {
7373
/**
7474
* Trading volume
7575
*/
76-
VOLUME
76+
VOLUME,
77+
78+
/**
79+
* Dividend yield
80+
*/
81+
YIELD,
82+
83+
/**
84+
* Dividend per share
85+
*/
86+
DIVIDEND,
87+
88+
/**
89+
* 52-week price change ratio
90+
*/
91+
CHANGE_RATIO_52W
7792
}

0 commit comments

Comments
 (0)