Stock Screener
Stock Screener
Request class: MarketScannerRequest
Description
Screens a market using basic, cumulative, financial, and tag-based criteria. The response contains the symbols that match all active filters.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| market | enum | Yes | US (US stocks), SG (Singapore stocks), HK (Hong Kong stocks) |
| baseFilterList | list<BaseFilter> | No | Simple indicator filter conditions, including price (OHLC, latest price, etc.), volume, share capital, market value, price change, P/E ratio, turnover rate, and other factors. Filter field meanings: Filter Field Description |
| accumulateFilterList | list<AccumulateFilter> | No | Cumulative indicator filter conditions, including cumulative price change, asset growth rate, net profit growth rate, earnings per share, net profit, operating profit, operating income, ROA (return on assets), operating cash flow, debt-to-asset ratio, etc. Cumulative indicator periods can be: last 5 minutes, last 5 days, 10 days, 20 days, last half year, one year, two years, five years, Q1 report, Q3 report, interim report, etc. Filter field meanings: Filter Field Description |
| financialFilterList | list<FinancialFilter> | No | Financial indicator filter conditions, including gross profit, net profit margin, total debt/shareholders' equity, total debt/total assets, current ratio, return on assets, net profit, operating cash flow, total assets, Hong Kong Stock Connect net buying amount, annualized return, etc. Financial indicators currently only support LTM (Last Twelve Months annual report indicators) type financial report queries. Filter field meanings: Filter Field Description |
| multiTagsRelationFilterList | list<MultiTagsRelationFilter> | No | Multi-tag relational filter conditions, based on industry, concept, historical stock price highs (current day stock price compared to historical prices), 52-week stock price highs (current day stock price compared to the last 52 weeks), whether OTC, whether options are supported, stock type (stock, ETF), whether broken, and other indicators for stock selection. Filter field meanings: Filter Field Description |
| sortFieldData | object | No | Sort configuration with the fields listed below. |
| ∟ fieldName | string | No | Sort field name |
| ∟ fieldType | string | No | Sort attribute category, sort attribute category enum: Field Category |
| ∟ sortDir | string | No | Sort direction, including: no sorting, ascending, descending, sort direction enum: Sort Field |
| page | int | Yes | Current page number (starting from 0) |
| cursorId | String | No | Cursor returned for the previous page. Pass it to retrieve the next page, or pass null for the first page. |
| pageSize | int | Yes | Number of results per page. The maximum is 200. |
Price filters use the market's currency: USD for US stocks, HKD for Hong Kong stocks, and SGD for Singapore stocks.
Filter Field Description
/** Basic Indicator Filter **/
BaseFilter {
/** Basic indicator to evaluate. */
private StockField fieldName;
/** Inclusive lower bound. Omit for negative infinity. */
private Double filterMin;
/** Inclusive upper bound. Omit for positive infinity. */
private Double filterMax;
/** If true, return the indicator without using it as a filter. Defaults to false. */
private boolean isNoFilter = false;
}
/** Cumulative Indicator Filter **/
AccumulateFilter {
/** Cumulative indicator to evaluate. */
private AccumulateField fieldName;
/** Inclusive lower bound. Use 10, not 10%, for a 10% value. */
private Double filterMin;
/** Inclusive upper bound. Omit for positive infinity. */
private Double filterMax;
/** If true, return the indicator without using it as a filter. Defaults to false. */
private boolean isNoFilter = false;
/** Optional cumulative period. */
private AccumulatePeriod period;
}
/** Financial Indicator Filter **/
FinancialFilter {
/** Financial indicator to evaluate. */
private FinancialField fieldName;
/** Inclusive lower bound. Use 10, not 10%, for a 10% value. */
private Double filterMin;
/** Inclusive upper bound. Omit for positive infinity. */
private Double filterMax;
/** If true, return the indicator without using it as a filter. Defaults to false. */
private boolean isNoFilter = false;
/** Financial reporting period. */
private FinancialPeriod quarter;
}
/** Multi-tag Indicator Filter **/
MultiTagsRelationFilter {
/** Tag category. */
private MultiTagField fieldName;
/** Tags to match. */
private List<String> tagList;
/** If true, return the tags without using them as a filter. Defaults to false. */
private boolean isNoFilter = false;
}Field Category
public enum FieldBelongType {
StockField_Type(1), //Basic indicator type
AccumulateField_Type(2), //Cumulative indicator type
FinancialField_Type(3), //Financial indicator type
MultiTagField_Type(5); //Multi-tag filter type
}Sort Field
public enum SortDir {
SortDir_No(0), // No sorting
SortDir_Ascend(1), // Ascending
SortDir_Descend(2); // Descending
}Response
com.tigerbrokers.stock.openapi.client.https.response.quote.MarketScannerResponse
source
The response has the following structure:
public class MarketScannerResponse extends TigerResponse {
@JSONField(name = "data")
private MarketScannerBatchItem marketScannerBatchItem;
}
public class MarketScannerBatchItem extends ApiModel {
/** Requested page index, default is 0 */
private int page;
/** Total number of pages */
private int totalPage;
/** Total count of all data for this condition request */
private int totalCount;
/** Number of items per page */
private int pageSize;
/** Cursor ID for cursor-based pagination queries */
private String cursorId;
/** Returned stock data list */
private List<MarketScannerItem> data;
}
public class MarketScannerItem implements Serializable {
/** Market */
private Market market;
private String symbol;
/** Filtered: simple indicator attribute data */
private List<MarketIndicatorValue> baseDataList;
/** Filtered: cumulative indicator attribute data */
private List<MarketIndicatorValue> accumulateDataList;
/** Filtered: financial indicator attribute data */
private List<MarketIndicatorValue> financialDataList;
/** Filtered: multi-tag level filters */
private List<MarketIndicatorValue> multiTagDataList;
}
public class MarketIndicatorValue implements Serializable {
/** Indicator index **/
private Integer index;
/** Indicator name **/
private String name;
/** Indicator value **/
private Object value;
}Example
//Build basic indicator filter parameter list
List<BaseFilter> baseFilterList = new ArrayList<>();
baseFilterList.add(BaseFilter.builder()
.fieldName(StockField.StockField_MarketValue)
.filterMin(1000000000D)
.filterMax(2000000000D)
.build());
// Multi-tag indicators
List<String> conceptTagList = new ArrayList<>();
// "BK1549" Fast food chains BK1541: Auto stocks BK1545: Mainland banks, BK1512: Tesla concept stocks
conceptTagList.add("BK1549");
conceptTagList.add("BK1541");
conceptTagList.add("BK1545");
conceptTagList.add("BK1512");
List<MultiTagsRelationFilter> multiTagsRelationFilter = new ArrayList<>();
multiTagsRelationFilter.add(MultiTagsRelationFilter.builder()
.fieldName(MultiTagField.MultiTagField_Concept)
.tagList(conceptTagList)
.build());
// Today's historical high 1: yes, 0: no
List<String> todayHistoryHighTagList = new ArrayList<>();
todayHistoryHighTagList.add("0");
multiTagsRelationFilter.add(MultiTagsRelationFilter.builder()
.fieldName(MultiTagField.MultiTagField_Today_HistoryHigh)
.tagList(todayHistoryHighTagList)
.build());
//Build stock screener request class
String cursorId = null;
MarketScannerRequest marketScannerRequest = MarketScannerRequest.newRequest(
Market.HK, baseFilterList, null, null, multiTagsRelationFilter, null, 1, 200, null);
//Submit stock screener request and get response
MarketScannerResponse marketScannerResponse = client.execute(marketScannerRequest);
// For next request
cursorId = ((MarketScannerResponse)marketScannerResponse).getMarketScannerBatchItem().getCursorId();
System.out.println(JSONObject.toJSONString(marketScannerResponse));Example Response
{
"code":0,
"data":{
"items":[
{
"accumulateDataList":[
],
"baseDataList":[
{
"index":17,
"name":"marketValue",
"value":1124284984.6
}
],
"financialDataList":[
],
"market":"HK",
"multiTagDataList":[
{
"index":21,
"value":"HK"
},
{
"index":2,
"name":"concept",
"value":"BK1549"
},
{
"index":14,
"name":"todayHistoryHigh",
"value":"0"
}
],
"symbol":"00538"
},
{
"accumulateDataList":[
],
"baseDataList":[
{
"index":17,
"name":"marketValue",
"value":1567588638
}
],
"financialDataList":[
],
"market":"HK",
"multiTagDataList":[
{
"index":21,
"value":"HK"
},
{
"index":2,
"name":"concept",
"value":"BK1549,BK1602,BK1578"
},
{
"index":14,
"name":"todayHistoryHigh",
"value":"0"
}
],
"symbol":"00052"
}
],
"page":0,
"pageSize":10,
"cursorId": "f987bf0b-e420-40cc-921d-2fd2afd87319",
"totalCount":2,
"totalPage":1
},
"message":"success",
"sign":"BItYmJiFiduYBzIiOfwnVN+oqZV7AqE0/EdZk5fBzF9tST5aaLP88ytHjB1SdQaAVU1SepCtYbPMKoVzzm8HzrDb2SjiXonfFqMTQ7xWrjvmCX4oWmDh7IRx8NHJbuappChidGsz7sRUntwmxGg1CYYs6b2ArMo6HH1Ukq+Ncr8=",
"success":true,
"timestamp":1681896201613
}Example 2
Filter by ETF type. Available ETF type tag values:
Hot Focus: package_us_v1_etf_hot
Bank ETF: package_us_v1_etf_bank
Bond ETF: package_us_v1_etf_bond
Buffer Type: package_us_v1_etf_buffer
Broad-based Index: package_us_v1_etf_index
Leveraged & Inverse: package_us_v1_etf_leverage
Sector: package_us_v1_etf_sector
Single Stock Leveraged: package_us_v1_etf_single_stock
Cap Type: package_us_v1_etf_market_cap
Thematic: package_us_v1_etf_thematic
International Markets: package_us_v1_etf_international
Growth & Value: package_us_v1_etf_growth
Commodities: package_us_v1_etf_commodity
ARK Cathie Wood: package_us_v1_etf_ark
Volatility: package_us_v1_etf_volatility
Currency: package_us_v1_etf_currency
Alternative Investment: package_us_v1_etf_alternativeList<String> etfTagList = new ArrayList<>();
etfTagList.add("package_us_v1_etf_hot");
List<MultiTagsRelationFilter> multiTagsRelationFilter = new ArrayList<>();
multiTagsRelationFilter.add(MultiTagsRelationFilter.builder()
.fieldName(MultiTagField.MultiTagField_ETF_TYPE)
.tagList(etfTagList)
.build());Get Market Scanner Tags
Request class: MarketScannerTagsRequest
Description
Get tag values for multi-tag relation filter fields. Currently only supports getting industry and concept tag collections.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| market | Market | Yes | Common market enum values: US for US stocks, HK for Hong Kong stocks, CN for A-shares. For detailed enum values see: Market Enum |
| multi_tag_field_list | List<MultiTagField> | Yes | Supported field enum values: MultiTagField_Industry, MultiTagField_Concept |
Response
com.tigerbrokers.stock.openapi.client.https.response.quote.MarketScannerTagsResponse
source
Structure as follows:
public class MarketScannerTagsResponse extends TigerResponse {
@JSONField(name = "data")
private List<MarketScannerTagItem> items;
}Response data can be accessed using the MarketScannerTagsResponse.getItems() method, which returns a list of MarketScannerTagItem objects. The com.tigerbrokers.stock.openapi.client.https.domain.quote.item.MarketScannerTagItem properties are as follows:
| Field | Type | Description |
|---|---|---|
| market | string | Market code (US: US stocks, CN: A-shares, HK: Hong Kong stocks) |
| multiTagField | string | Multi-tag field, consistent with the request parameter multi_tag_field_list |
| tagList | List<TagValue> | Collection of tags that can be used to filter the multi-tag field multiTagField |
The specific fields of TagValue can be accessed through object properties, such as tagValue.tag
Example
List<MultiTagField> multiTagFieldList = new ArrayList<>();
// Get industry tag collection
multiTagFieldList.add(MultiTagField.MultiTagField_Industry);
MarketScannerTagsRequest request = MarketScannerTagsRequest.newRequest(
Market.HK, multiTagFieldList);
MarketScannerTagsResponse response = client.execute(request);
if (response.isSuccess()) {
System.out.println(JSONObject.toJSONString(response));
} else {
System.out.println("response error:" + response.getMessage());
}Example Response
{
"code":0,
"data":[
{
"market":"HK",
"multiTagField":"MultiTagField_Industry",
"tagList":[
{
"tag":"BK1175",
"value":"Aluminum"
},
{
"tag":"BK1174",
"value":"Agricultural Machinery"
},
{
"tag":"BK1173",
"value":"Marine Ports & Services"
},
{
"tag":"BK1172",
"value":"Casinos & Gaming"
},
{
"tag":"BK1171",
"value":"Construction Machinery & Heavy Trucks"
},
{
"tag":"BK1170",
"value":"Electronic Components"
},
{
"tag":"BK1179",
"value":"Electronic Equipment & Instruments"
},
{
"tag":"BK1178",
"value":"Coal & Consumable Fuels"
},
{
"tag":"BK1177",
"value":"Hypermarkets & Super Centers"
},
{
"tag":"BK1186",
"value":"Specialized Finance"
},
{
"tag":"BK1185",
"value":"Highways & Railtracks"
},
{
"tag":"BK1184",
"value":"Life & Health Insurance"
},
{
"tag":"BK1183",
"value":"Industrial Machinery"
},
{
"tag":"BK1182",
"value":"Diversified REITs"
},
{
"tag":"BK1181",
"value":"Distributors"
},
{
"tag":"BK1180",
"value":"Brewers"
},
{
"tag":"BK1189",
"value":"Health Care Technology"
},
{
"tag":"BK1188",
"value":"Consumer Finance"
},
{
"tag":"BK1187",
"value":"Security & Alarm Services"
},
{
"tag":"BK1153",
"value":"Reinsurance"
},
{
"tag":"BK1152",
"value":"Wireless Telecommunication Services"
},
{
"tag":"BK1151",
"value":"Air Freight & Logistics"
},
{
"tag":"BK1150",
"value":"Human Resource & Employment Services"
},
{
"tag":"BK1159",
"value":"Oil & Gas Refining & Marketing"
},
{
"tag":"BK1158",
"value":"Diversified Support Services"
},
{
"tag":"BK1157",
"value":"Paper Packaging"
},
{
"tag":"BK1156",
"value":"Asset Management & Custody Banks"
},
{
"tag":"BK1155",
"value":"IT Consulting & Other Services"
},
{
"tag":"BK1154",
"value":"Independent Power Producers & Energy Traders"
},
{
"tag":"BK1164",
"value":"Hotels, Resorts & Cruise Lines"
},
{
"tag":"BK1163",
"value":"Semiconductors"
},
{
"tag":"BK1162",
"value":"Technology Distributors"
},
{
"tag":"BK1161",
"value":"Biotechnology"
},
{
"tag":"BK1160",
"value":"Textiles"
},
{
"tag":"BK1169",
"value":"Semiconductor Equipment"
},
{
"tag":"BK1168",
"value":"Footwear"
},
{
"tag":"BK1167",
"value":"Electronic Manufacturing Services"
},
{
"tag":"BK1166",
"value":"Oil & Gas Storage & Transportation"
},
{
"tag":"BK1165",
"value":"Office Services & Supplies"
},
{
"tag":"BK1131",
"value":"Financial Exchanges & Data"
},
{
"tag":"BK1252",
"value":"Data Processing & Outsourced Services"
},
{
"tag":"BK1130",
"value":"Publishing"
},
{
"tag":"BK1251",
"value":"Industrial REITs"
},
{
"tag":"BK1250",
"value":"Office REITs"
},
{
"tag":"BK1139",
"value":"Tires & Rubber"
},
{
"tag":"BK1138",
"value":"Diversified Capital Markets"
},
{
"tag":"BK1137",
"value":"Advertising"
},
{
"tag":"BK1258",
"value":"Real Estate Operating Companies"
},
{
"tag":"BK1136",
"value":"Multi-line Insurance"
},
{
"tag":"BK1257",
"value":"Trucking"
},
{
"tag":"BK1135",
"value":"Construction Materials"
},
{
"tag":"BK1256",
"value":"Retail REITs"
},
{
"tag":"BK1134",
"value":"Internet Services & Infrastructure"
},
{
"tag":"BK1255",
"value":"Ground Transportation"
},
{
"tag":"BK1133",
"value":"Integrated Telecommunication Services"
},
{
"tag":"BK1254",
"value":"Thrifts & Mortgage Finance"
},
{
"tag":"BK1132",
"value":"Food Retail"
},
{
"tag":"BK1253",
"value":"Transaction & Payment Processing Services"
},
{
"tag":"BK1142",
"value":"Internet & Direct Marketing Retail"
},
{
"tag":"BK1141",
"value":"Life Sciences Tools & Services"
},
{
"tag":"BK1140",
"value":"Environmental & Facilities Services"
},
{
"tag":"BK1149",
"value":"Communications Equipment"
},
{
"tag":"BK1148",
"value":"Construction & Engineering"
},
{
"tag":"BK1147",
"value":"Investment Banking & Brokerage"
},
{
"tag":"BK1146",
"value":"Metal & Glass Containers"
},
{
"tag":"BK1145",
"value":"Broadcasting"
},
{
"tag":"BK1144",
"value":"Automotive Parts & Equipment"
},
{
"tag":"BK1143",
"value":"Research & Consulting Services"
},
{
"tag":"BK1119",
"value":"Automobile Manufacturers"
},
{
"tag":"BK1118",
"value":"Diversified Chemicals"
},
{
"tag":"BK1239",
"value":"Automotive Retail"
},
{
"tag":"BK1230",
"value":"Industrial Conglomerates"
},
{
"tag":"BK1117",
"value":"Systems Software"
},
{
"tag":"BK1238",
"value":"Oil & Gas Exploration & Production"
},
{
"tag":"BK1116",
"value":"Electrical Components & Equipment"
},
{
"tag":"BK1237",
"value":"Packaged Foods & Meats"
},
{
"tag":"BK1115",
"value":"Home Furnishing Retail"
},
{
"tag":"BK1236",
"value":"Railroads"
},
{
"tag":"BK1114",
"value":"Apparel Retail"
},
{
"tag":"BK1235",
"value":"Regional Banks"
},
{
"tag":"BK1113",
"value":"Fertilizers & Agricultural Chemicals"
},
{
"tag":"BK1234",
"value":"Silver"
},
{
"tag":"BK1112",
"value":"Oil & Gas Drilling"
},
{
"tag":"BK1233",
"value":"Restaurants"
},
{
"tag":"BK1111",
"value":"Motorcycle Manufacturers"
},
{
"tag":"BK1232",
"value":"Multi-Utilities"
},
{
"tag":"BK1110",
"value":"Commodity Chemicals"
},
{
"tag":"BK1231",
"value":"Diversified Banks"
},
{
"tag":"BK1129",
"value":"Specialty Chemicals"
},
{
"tag":"BK1120",
"value":"Cable & Satellite"
},
{
"tag":"BK1241",
"value":"Leisure Facilities"
},
{
"tag":"BK1240",
"value":"Real Estate Development"
},
{
"tag":"BK1128",
"value":"Movies & Entertainment"
},
{
"tag":"BK1249",
"value":"General Merchandise Stores"
},
{
"tag":"BK1127",
"value":"Property & Casualty Insurance"
},
{
"tag":"BK1248",
"value":"Hotel & Resort REITs"
},
{
"tag":"BK1247",
"value":"Drug Retail"
},
{
"tag":"BK1125",
"value":"Independent Power Producers & Energy Traders"
},
{
"tag":"BK1246",
"value":"Department Stores"
},
{
"tag":"BK1124",
"value":"Trading Companies & Distributors"
},
{
"tag":"BK1245",
"value":"Industrial REITs"
},
{
"tag":"BK1123",
"value":"Airlines"
},
{
"tag":"BK1122",
"value":"Department Stores"
},
{
"tag":"BK1243",
"value":"Industrial Gases"
},
{
"tag":"BK1121",
"value":"Food Distributors"
},
{
"tag":"BK1242",
"value":"Tobacco"
},
{
"tag":"BK1219",
"value":"Health Care Services"
},
{
"tag":"BK1218",
"value":"Thrifts & Mortgage Finance"
},
{
"tag":"BK1217",
"value":"Office REITs"
},
{
"tag":"BK1216",
"value":"Diversified Real Estate Activities"
},
{
"tag":"BK1215",
"value":"Specialized Consumer Services"
},
{
"tag":"BK1214",
"value":"Household Appliances"
},
{
"tag":"BK1213",
"value":"Leisure Products"
},
{
"tag":"BK1212",
"value":"Agricultural Products"
},
{
"tag":"BK1211",
"value":"Aerospace & Defense"
},
{
"tag":"BK1210",
"value":"Forest Products"
},
{
"tag":"BK1109",
"value":"Application Software"
},
{
"tag":"BK1108",
"value":"Alternative Carriers"
},
{
"tag":"BK1229",
"value":"Real Estate Operating Companies"
},
{
"tag":"BK1107",
"value":"Homebuilding"
},
{
"tag":"BK1228",
"value":"Education Services"
},
{
"tag":"BK1106",
"value":"Commercial Printing"
},
{
"tag":"BK1227",
"value":"Textiles, Apparel & Luxury Goods"
},
{
"tag":"BK1105",
"value":"Building Products"
},
{
"tag":"BK1226",
"value":"Integrated Oil & Gas"
},
{
"tag":"BK1104",
"value":"Interactive Home Entertainment"
},
{
"tag":"BK1225",
"value":"Steel"
},
{
"tag":"BK1103",
"value":"Marine"
},
{
"tag":"BK1224",
"value":"Specialty Stores"
},
{
"tag":"BK1102",
"value":"Home Improvement Retail"
},
{
"tag":"BK1223",
"value":"Paper Products"
},
{
"tag":"BK1101",
"value":"Home Improvement Retail"
},
{
"tag":"BK1222",
"value":"Health Care Supplies"
},
{
"tag":"BK1100",
"value":"Health Care Equipment & Supplies"
},
{
"tag":"BK1221",
"value":"Gas Utilities"
},
{
"tag":"BK1220",
"value":"Ground Transportation"
},
{
"tag":"BK1209",
"value":"Health Care Facilities"
},
{
"tag":"BK1208",
"value":"Diversified Financial Services"
},
{
"tag":"BK1207",
"value":"Personal Products"
},
{
"tag":"BK1206",
"value":"Copper"
},
{
"tag":"BK1205",
"value":"Heavy Electrical Equipment"
},
{
"tag":"BK1204",
"value":"Hotel & Resort REITs"
},
{
"tag":"BK1203",
"value":"Household Durables"
},
{
"tag":"BK1202",
"value":"Oil & Gas Equipment & Services"
},
{
"tag":"BK1201",
"value":"Home Improvement Retail"
},
{
"tag":"BK1200",
"value":"Soft Drinks"
},
{
"tag":"BK1098",
"value":"Retail REITs"
},
{
"tag":"BK1097",
"value":"Real Estate Services"
},
{
"tag":"BK1096",
"value":"Consumer Electronics"
},
{
"tag":"BK1095",
"value":"Interactive Media & Services"
},
{
"tag":"BK1094",
"value":"Computer & Electronics Retail"
},
{
"tag":"BK1099",
"value":"Electric Utilities"
},
{
"tag":"BK1197",
"value":"Health Care Distributors"
},
{
"tag":"BK1196",
"value":"Airport Services"
},
{
"tag":"BK1195",
"value":"Insurance Brokers"
},
{
"tag":"BK1194",
"value":"Water Utilities"
},
{
"tag":"BK1193",
"value":"Technology Hardware, Storage & Peripherals"
},
{
"tag":"BK1192",
"value":"Distillers & Vintners"
},
{
"tag":"BK1191",
"value":"Pharmaceuticals"
},
{
"tag":"BK1190",
"value":"Diversified Metals & Mining"
},
{
"tag":"BK1199",
"value":"Diversified Financial Services"
},
{
"tag":"BK1198",
"value":"Gold"
}
]
}
],
"message":"success",
"sign":"HsjJnD0p7sr9Te7HUdVKme48f6plwUEOUvuSVQM8uq9NKyn+xhF2VRTHz5Qc+5e33h5gcHXzRCEyLLLX9byknKgbDMzrFldkGgjaIot4JS06C1hcvhSuzHHBTuL31C4bqwBjhDrH4n3zhUqTajDr1R8V12UxDqgGFSB3ojhzqYA=",
"success":true,
"timestamp":1683169980464
}Updated 8 days ago
