Securities
Get Market Status
Corresponding Request Class: QuoteMarketRequest
Description
Get the trading status of a specified market (such as open, pre-market trading, after-hours trading, etc.), and get the most recent opening time of that market.
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, ALL for all markets. For enum values, see: Market Enum |
| lang | Language | No | Language enum values: zh_CN, zh_TW, en_US. Default: en_US. For enum values, see: Language Enum |
Response
com.tigerbrokers.stock.openapi.client.https.response.quote.QuoteMarketResponse
source
The structure is as follows:
public class QuoteMarketResponse extends TigerResponse {
@JSONField(name = "data")
private List<MarketItem> marketItems;
}Response data can be accessed using the QuoteMarketResponse.getMarketItems() method, which returns a list of marketItem objects. The com.tigerbrokers.stock.openapi.client.https.domain.quote.item.MarketItem properties are as follows:
| Field | Type | Description |
|---|---|---|
| market | string | Market code (US: US stocks, HK: Hong Kong stocks, CN: Shanghai and Shenzhen stocks) |
| marketStatus | string | Market status description, non-fixed value, includes holiday information, such as: "Not Yet Opened", "Closed", "Trading", "Closed Independence Day". Differentiated by lang parameter for Chinese/English text. This field can be used for market status reminder display. |
| status | string | Market status (NOT_YET_OPEN: Not yet open, PRE_HOUR_TRADING: Pre-market trading, TRADING: Trading, MIDDLE_CLOSE: Midday break, POST_HOUR_TRADING: After-hours trading, CLOSING: Closed, EARLY_CLOSED: Early close, MARKET_CLOSED: Market closed) |
| openTime | string | Most recent opening/trading time MM-dd HH:mm:ss format, e.g.: when market=US, openTime="07-04 09:30:00 EDT", where EDT is Eastern Time. When market is CN or HK, openTime="01-13 09:30:00", openTime doesn't return timezone. For other markets, corresponding market timezone is returned. |
Specific fields of MarketItem can be accessed through object get methods, such as getMarket(), or converted to string format through the toString() method.
Example
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
ClientConfig.DEFAULT_CONFIG);
QuoteMarketResponse response = client.execute(QuoteMarketRequest.newRequest(Market.US));
if (response.isSuccess()) {
System.out.println(Arrays.toString(response.getMarketItems().toArray()));
} else {
System.out.println("response error:" + response.getMessage());
}Response Example
{
"code": 0,
"message": "success",
"timestamp": 1525938835697,
"data": [
{
"market": "US",
"marketStatus": "Closed Independence Day",
"status": "CLOSING",
"openTime": "07-04 09:30:00 EDT"
}
]
}Get Market Trading Calendar
Corresponding Request Class: QuoteTradeCalendarRequest
Description
Provides market trading calendar from 2015 to the end of the current year (excluding weekends and legal holidays for that market, but not excluding temporary market closures). If the selected time exceeds the available range, start and end times will be automatically adjusted to within the available data range.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| market | string | Yes | US for US stocks, HK for Hong Kong stocks, CN for A-shares |
| begin_date | string | No | Calendar start date (inclusive). yyyy-MM-dd format, e.g. '2022-06-01' |
| end_date | string | No | Calendar end date (exclusive). yyyy-MM-dd format |
begin_time and end_time parameter handling is as follows:
| begin_time passed | end_time passed | Description |
|---|---|---|
| Yes | Yes | begin_time and end_time are the passed values respectively |
| Yes | No | end_time is 365 days after begin_time |
| No | Yes | begin_time is 365 days before end_time |
| No | No | begin_time is current date, end_time is 30 days after begin_time |
Response
com.tigerbrokers.stock.openapi.client.https.response.quote.QuoteTradeCalendarResponse
source
The structure is as follows:
public class QuoteTradeCalendarResponse extends TigerResponse {
@JSONField(name = "data")
private List<TradeCalendar> items;
}Response data can be accessed using the QuoteTradeCalendarResponse.getItems() method, which returns a list of TradeCalendar objects. The com.tigerbrokers.stock.openapi.client.https.domain.quote.item.TradeCalendar properties are as follows:
| Field | Type | Description |
|---|---|---|
| date | string | Trading date |
| type | string | Trading day type: TRADING for normal trading day with full-day trading; EARLY_CLOSE for early close |
Example
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
ClientConfig.DEFAULT_CONFIG);
QuoteTradeCalendarRequest request = QuoteTradeCalendarRequest.newRequest(
Market.US, "2022-06-01", "2022-06-30");
QuoteTradeCalendarResponse response = client.execute(request);
if (response.isSuccess()) {
System.out.println(Arrays.toString(response.getItems().toArray()));
} else {
System.out.println("response error:" + response.getMessage());
}Response Example
{
"code": 0,
"message": "success",
"timestamp": 1655968809209,
"data": [
{
"date": "2022-06-01",
"type": "TRADING"
},
{
"date": "2022-06-02",
"type": "TRADING"
},
{
"date": "2022-06-03",
"type": "TRADING"
},
{
"date": "2022-06-06",
"type": "TRADING"
},
{
"date": "2022-06-07",
"type": "TRADING"
},
{
"date": "2022-06-08",
"type": "TRADING"
}
]
}Get Stock Symbol List
Corresponding Request Class: QuoteSymbolRequest
Description
Get a list of all security symbols for a specified market, including delisted or temporarily non-tradable securities, as well as index codes.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| market | string | Yes | US for US stocks, HK for Hong Kong stocks, CN for A-shares |
| include_otc | boolean | No | Whether to include OTC securities, default: false |
| lang | string | No | Language support: zh_CN, zh_TW, en_US; default: en_US |
Response
com.tigerbrokers.stock.openapi.client.https.response.quote.QuoteSymbolResponse
source
The specific structure is as follows:
public class QuoteSymbolResponse extends TigerResponse {
@JSONField(name = "data")
private List<String> symbols;
}Response data can be accessed through the QuoteSymbolResponse.getSymbols() method, which returns a List containing the returned stock symbol data.
Example
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
ClientConfig.DEFAULT_CONFIG);
QuoteSymbolResponse response = client.execute(QuoteSymbolRequest.newRequest(Market.US).includeOTC(false));
if (response.isSuccess()) {
System.out.println(Arrays.toString(response.getSymbols().toArray()));
} else {
System.out.println("response error:" + response.getMessage());
}Response Example
{
"code": 0,
"message": "success",
"timestamp": 1525938835697,
"data": ["A", "A.W", "AA", "AA-B", "AAAP", "AABA", "AAC", "AADR", "AAIT", "AAL", "AALCP", "AAMC", "AAME"]
}Get Stock Symbol and Name List
Corresponding Request Class: QuoteSymbolNameRequest
Description
Get all security symbols and corresponding names for a specified market.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| market | string | Yes | US for US stocks, HK for Hong Kong stocks, CN for A-shares |
| include_otc | boolean | No | Whether to include OTC securities, default: false |
| lang | string | No | Language support: zh_CN, zh_TW, en_US; default: en_US |
Response
com.tigerbrokers.stock.openapi.client.https.response.quote.QuoteSymbolNameResponse
source
The specific structure is as follows:
public class QuoteSymbolNameResponse extends TigerResponse {
@JSONField(name = "data")
private List<SymbolNameItem> symbolNameItems;
}Response data can be accessed through the QuoteSymbolNameResponse.getSymbolNameItems() method, which returns a List containing SymbolNameItem objects. The com.tigerbrokers.stock.openapi.client.https.domain.quote.item.symbolNameItems properties are as follows:
| Field | Type | Description |
|---|---|---|
| name | string | Stock name |
| symbol | string | Stock symbol |
Specific fields of SymbolNameItem can be accessed through object get methods, such as getName(), or converted to string format through the toString() method.
Example
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
ClientConfig.DEFAULT_CONFIG);
QuoteSymbolNameResponse response = client.execute(QuoteSymbolNameRequest.newRequest(Market.US).includeOTC(false));
if (response.isSuccess()) {
System.out.println(Arrays.toString(response.getSymbolNameItems().toArray()));
} else {
System.out.println("response error:" + response.getMessage());
}Response Example
{
"code": 0,
"message": "success",
"timestamp": 1525938835697,
"data": [{"name":"CKH Holdings","symbol":"00001"},{"name":"CLP","symbol":"00002"}]
}Get Real-time Quotes
Corresponding Request Class: QuoteRealTimeQuoteRequest
Description
Get real-time stock quotes. Corresponding market data permissions must be purchased before using this interface. Each request supports up to 50 stocks.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbols | array | Yes | List of stock symbols (maximum 50 per request) |
| includeHourTrading | Boolean | No | Whether to include US pre-market and after-hours data, default: false |
| lang | string | No | Language support: zh_CN, zh_TW, en_US; default: en_US |
Response
com.tigerbrokers.stock.openapi.client.https.response.quote.QuoteRealTimeQuoteResponsesource
Response data can be accessed through the QuoteRealTimeQuoteResponse.getRealTimeQuoteItems() method, which returns RealTimeQuoteItem objects. The com.tigerbrokers.stock.openapi.client.https.domain.quote.item.RealTimeQuoteItem properties are as follows:
| Field | Type | Description |
|---|---|---|
| symbol | string | Stock symbol |
| open | double | Opening price |
| high | double | High price |
| low | double | Low price |
| close | double | Closing price |
| preClose | double | Previous trading day's closing price |
| latestPrice | double | Latest price |
| latestTime | long | Latest trading time |
| askPrice | double | Ask price |
| askSize | long | Ask size |
| bidPrice | double | Bid price |
| bidSize | long | Bid size |
| volume | long | Volume |
| status | string | Trading status |
| hourTrading | object | US pre-market and after-hours data (only available when includeHourTrading is true and during pre-market/after-hours periods) |
The hourTrading object contains the following fields:
| Field | Type | Description |
|---|---|---|
| tag | string | Pre-market ("Pre-Mkt") or after-hours ("Post-Mkt") indicator |
| latestPrice | double | Latest price |
| preClose | double | Previous close |
| latestTime | string | Latest trading time (Eastern Time) |
| volume | long | Volume |
| timestamp | long | Latest trading timestamp |
Specific fields can be accessed through object get methods, such as getTag().
Status (trading status) values:
- "UNKNOWN": Unknown
- "NORMAL": Normal
- "HALTED": Suspended
- "DELIST": Delisted
- "NEW": New stock
- "ALTER": Changed
- "CIRCUIT_BREAKER": Circuit breaker
- "ST": Special treatment
Example
QuoteRealTimeQuoteResponse response = client.execute(QuoteRealTimeQuoteRequest.newRequest(List.of("AAPL"), true));
if (response.isSuccess()) {
System.out.println(Arrays.toString(response.getRealTimeQuoteItems().toArray()));
} else {
System.out.println("response error:" + response.getMessage());
}Response Example
{
"code":0,
"data":[
{
"askPrice":174.8,
"latestPrice":175.08,
"symbol":"AAPL",
"bidSize":200,
"bidPrice":174.71,
"volume":116803357,
"high":175.96,
"preClose":171.18,
"low":170.7,
"hourTrading":{
"volume":3418089,
"latestPrice":174.72,
"preClose":175.08,
"latestTime":"18:50 EST",
"tag":"Post-Mkt",
"timestamp":1639007439976
},
"latestTime":1638997200000,
"close":175.08,
"askSize":200,
"open":172.125,
"status":"NORMAL"
}
],
"success":true,
"sign":"BxcUz9YfmWcnSsmQKLcnFnVpHAT5bDdX69YntqaVIVdVqMlhSaaaW8ur3yaWP6GB6NAec2ds6s1ZB/4X40kg8lHb6u6y2V0hvHE2Q3uDNgkoukmDcAetdwRo/MAiqtQRACFGAd/AOlyhDsJyuzTf7T14zDMl5cfOfbwe2+RDjgg=",
"message":"success",
"timestamp":1639007449806
}Get Depth Quote Data
Corresponding Request Class: QuoteDepthRequest
Description
Get the bid/ask N-level order data for specified securities, including order price, quantity, and order count. Each request supports up to 50 securities.
CAUTION
Hong Kong stocks: The closing auction period on trading days is 16:00-16:10, with actual closing time randomly between 16:08 and 16:10. The last depth quote data for the day is usually updated one to two minutes after 16:10.
US stocks: Depth quotes include pre-market and after-hours trading information. No additional parameters are needed; real-time requests can obtain this data.
Request Frequency
For frequency limits, please refer to: Request Rate Limits
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbols | array | Yes | List of stock symbols (maximum 50 per request) |
| market | string | Yes | US for US stocks, HK for Hong Kong stocks, CN for A-shares, ALL for all markets (refer to Market enum class) |
Response
com.tigerbrokers.stock.openapi.client.https.response.quote.QuoteDepthResponse
source
The specific structure is as follows:
public class QuoteDepthResponse extends TigerResponse {
@JSONField(name = "data")
private List<QuoteDepthItem> quoteDepthItems;
}Response data can be accessed through the QuoteDepthResponse.getQuoteDepthItems() method, which returns a List containing QuoteDepthItem objects. The com.tigerbrokers.stock.openapi.client.https.domain.quote.item.QuoteDepthItem properties are as follows:
| Field | Type | Description |
|---|---|---|
| symbol | string | Stock symbol |
| asks | list | Ask levels |
| bids | list | Bid levels |
The detailed fields for bid/ask levels are as follows:
| Field | Type | Description |
|---|---|---|
| price | double | Order price |
| volume | long | Order volume |
| count | int | Number of orders (only available for Hong Kong stock market, not available for US stock market) |
Example
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
ClientConfig.DEFAULT_CONFIG);
List<String> symbols = new ArrayList<>();
symbols.add("DD");
QuoteDepthResponse response = client.execute(QuoteDepthRequest.newRequest(symbols, Market.US.name()));
if (response.isSuccess()) {
for (QuoteDepthItem item : response.getQuoteDepthItems()) {
System.out.println(item.getSymbol());
System.out.println(Arrays.toString(item.getAsks().toArray()));
System.out.println(Arrays.toString(item.getBids().toArray()));
}
} else {
System.out.println("response error:" + response.getMessage());
}Response Example
{
"code": 0,
"message": "success",
"timestamp": 1653064415298,
"data": [
{
"symbol": "DD",
"asks": [
{
"price": 62.88,
"count": 0,
"volume": 50
},
{
"price": 62.88,
"count": 0,
"volume": 27
},
{
"price": 62.89,
"count": 0,
"volume": 50
},
{
"price": 62.89,
"count": 0,
"volume": 200
}
//...
],
"bids": [
{
"price": 62.86,
"count": 0,
"volume": 50
},
{
"price": 62.86,
"count": 0,
"volume": 200
},
{
"price": 62.86,
"count": 0,
"volume": 2
},
{
"price": 62.86,
"count": 0,
"volume": 6
}
//...
]
}
]
}Get Tick-by-Tick Trade Data
Corresponding Request Class: QuoteTradeTickRequest
Description
Get tick-by-tick trade data. This interface supports both querying full tick records of the current trading day after market close and getting the latest real-time tick data during market hours.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbols | array | Yes | List of stock symbols, supports China Connect stocks, Hong Kong stocks, and US stocks |
| trade_session | String | No | TradeSession enum object, Pre-market: PreMarket, Regular: Regular, After-hours: AfterHours. Default is Regular |
| beginIndex | long | Yes | Starting index, daily index starts from 0. If both beginIndex and endIndex are set to -1, returns the latest tick data. For subsequent queries, use the endIndex from the previous query as beginIndex for continuous querying. Returns data as a half-open interval, e.g., beginIndex=1, endIndex=100 returns records 1 to 99, next query should set beginIndex=100, endIndex=200 |
| endIndex | long | Yes | Ending index. The difference between ending index and starting index cannot exceed 2000, when greater than 2000, it defaults to returning 200 records starting from the starting index. When the limit parameter is less than the difference between start and end indices, only returns limit number of tick data starting from the start index |
| limit | integer | No | Number of ticks returned per request. If the interval between start and end indices doesn't exceed 2000, returns actual number of records, otherwise defaults to 200 |
| lang | string | No | Language support: en_US, zh_CN, zh_TW, default: en_US |
Usage Instructions for beginIndex and endIndex Parameters
| Query Method | beginIndex | endIndex | Description |
|---|---|---|---|
| Query Latest Ticks | -1 | -1 | Returns latest limit number of tick records by default. limit defaults to 200 |
| Query Daily Ticks by Range | Specific value | Specific value | Example: beginIndex=10, endIndex=100 returns 90 records from 10 to 99. If limit is set to 20, returns 20 records from 10 to 29. |
Return
com.tigerbrokers.stock.openapi.client.https.response.quote.QuoteTradeTickResponsesource
Structure:
public class QuoteTradeTickResponse extends TigerResponse {
@JSONField(name = "data")
private List<TradeTickItem> tradeTickItems;
}Return data can be accessed via QuoteTradeTickResponse.getTradeTickItems() method, returning TradeTickItem objects, where com.tigerbrokers.stock.openapi.client.https.domain.quote.item.TradeTickItem properties are:
| Field | Type | Description |
|---|---|---|
| beginIndex | long | Actual start index of returned data |
| endIndex | long | Actual end index of returned data |
| symbol | string | Requested stock symbol |
| items | List<TickPoint> | List containing tick trade data, individual tick trade data stored in TickPoint objects |
TickPoint object fields:
| Field | Type | Description |
|---|---|---|
| time | long | Trade timestamp |
| price | double | Trade price |
| volume | long | Trade volume |
| type | string | "+" indicates active buy, "-" indicates active sell, "*" indicates neutral |
Specific fields can be accessed through object's get methods, such as getTime(), or converted to string through object's toString() method
Example
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
ClientConfig.DEFAULT_CONFIG);
List<String> symbols = new ArrayList<>();
symbols.add("AAPL");
QuoteTradeTickRequest request = QuoteTradeTickRequest.newRequest(symbols, 0, 30, 10);
request.setTradeSession(TradeSession.Regular);
QuoteTradeTickResponse response = client.execute(request);
if (response.isSuccess()) {
System.out.println(JSONObject.toJSONString(response));
} else {
System.out.println("response error:" + response.getMessage());
}Return Example
{
"code": 0,
"data": [
{
"beginIndex": 0,
"endIndex": 10,
"items": [
{
"price": 169.59,
"time": 1712323800003,
"type": "*",
"volume": 32
},
{
"price": 169.59,
"time": 1712323800003,
"type": "*",
"volume": 8
},
{
"price": 169.59,
"time": 1712323800003,
"type": "*",
"volume": 148
},
{
"price": 169.59,
"time": 1712323800003,
"type": "*",
"volume": 1010
},
{
"price": 169.59,
"time": 1712323800005,
"type": "*",
"volume": 600
},
{
"price": 169.59,
"time": 1712323800007,
"type": "*",
"volume": 32
},
{
"price": 169.59,
"time": 1712323800008,
"type": "*",
"volume": 33
},
{
"price": 169.59,
"time": 1712323800011,
"type": "*",
"volume": 12
},
{
"price": 169.59,
"time": 1712323800011,
"type": "*",
"volume": 186
},
{
"price": 169.59,
"time": 1712323800012,
"type": "*",
"volume": 40
}
],
"symbol": "AAPL"
}
],
"message": "success",
"sign": "XEEDI1HLzWT8rkZp4boFge4OehCeXOVuXJ6U4Lgve1vUz898Ne8Q4CF/f/OIUVcHfC7XbrjqYmHJBwDdQEdfucRdsKH7g0SimlMAnyimNnya4lKIaQ6CRbfE5faEe2sdopjnwZggFkycnCeB0JhiTK72xR5uTC0gGlcaaPY36o4=",
"success": true,
"timestamp": 1712557783317
}Get K-Line Data
Corresponding Request Class: QuoteKlineRequest
Description
Supports getting Hong Kong and US stock K-line data, including: daily, weekly, monthly, yearly, as well as minute, 5-minute, 15-minute, 30-minute, 60-minute and other levels. Each request returns a maximum of 1200 records. It's recommended to use loop calls to obtain historical data for longer time ranges to ensure interface performance and stability. The interface supports querying by date range or specified date.
- Minute-level K-lines (1/5/15/30/60 minutes): Supports historical data from the past 10 years
- Daily K-lines and above (daily/weekly/monthly/yearly): Provides complete historical data
- US stock pre-market and after-hours only support 60-minute and below K-line data after April 2024
Note that there may be limits on the number of K-lines that can be requested. For details, please see Historical Quote Limits & Subscription Limits
Parameters
Parameter | Type | Description |
|---|---|---|
symbols | array | List of stock symbols, limit: 50, where A-share limit: 30 |
period | string | K-line type, value range (day: daily K, week: weekly K, month: monthly K, year: yearly K, 1min: 1 minute, 3min: 3 minutes, 5min: 5 minutes, 15min: 15 minutes, 30min: 30 minutes, 60min: 60 minutes, 120min: 2 hours, 240min: 4 hours) |
trade_session | string | TradeSession enum object, Pre-market: PreMarket, Regular: Regular, After-hours: AfterHours, Overnight: OverNight. Default is Regular, pre-market and after-hours only support 1-minute K-lines |
right | string | Rights adjustment option, br: forward adjusted (default), nr: not adjusted |
begin_time | long | Start time for range query, parameter restrictions: 1-minute and 5-minute K-lines only support data from the past 1 month, 15/30/60 minute K-lines support data from the past 1 year, for earlier minute-level K-lines, please use specified date query. Parameter default: -1, unit: milliseconds (ms), closed-open interval, query results will include start time data, for weekly/monthly/yearly K-line queries, will return data including the current period (e.g., if start time is Wednesday, will return K-line from Monday of this week) |
end_time | long | End time for range query, parameter restrictions: 1-minute and 5-minute K-lines only support data from the past 1 month, 15/30/60 minute K-lines support data from the past 1 year, for earlier minute-level K-lines, please use specified date query. Parameter default: -1, unit: milliseconds (ms) |
date | string | Date, use this parameter (format: yyyyMMdd) to get minute-level K-line data for a specified date.
|
limit | integer | Number of K-lines returned per request, default is 300 if not passed, limit cannot exceed 1200, if limit is set greater than 1200, only 1200 records will be returned |
lang | string | Language support: en_US, zh_CN, zh_TW, default: en_US |
withFundamental | bool | Whether to return the ratio and turnover rate |
pageToken | string | Pagination query token (only supports single symbol, queries with specified begin_time), when using pageToken for pagination, other query conditions cannot be changed |
Return
com.tigerbrokers.stock.openapi.client.https.response.quote.QuoteKlineResponsesource
Return data can be accessed via QuoteKlineResponse.getKlineItems() method, returning a list of KlineItem objects, where com.tigerbrokers.stock.openapi.client.https.domain.quote.item.KlineItem properties are:
| Field | Type | Description |
|---|---|---|
| symbol | string | Stock symbol |
| period | string | K-line period |
| nextPageToken | string | Token to query next page (only valid for single symbol, when begin_time is not -1), returns null if no more data |
| items | array | Array of K-line objects KlinePoint, see fields description below |
K-line data KlinePoint properties:
| K-line Field | Type | Description |
|---|---|---|
| close | double | Close price |
| high | double | High price |
| low | double | Low price |
| open | double | Open price |
| time | long | Time |
| volume | long | Volume |
| amount | double | Amount |
| turnoverRate | double | Turnover rate. Not returned by default |
| ttmPe | double | Trailing Twelve Months PE. Not returned by default |
| lyrPe | double | Last Year Ratio PE. Not returned by default |
Specific fields can be accessed through object's get methods, such as getSymbol()
Example
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
ClientConfig.DEFAULT_CONFIG);
List<String> symbols = new ArrayList<>();
symbols.add("AAPL");
QuoteKlineResponse response = client.execute(QuoteKlineRequest.newRequest(symbols, KType.day, "2023-05-16", "2023-05-19")
.withLimit(1000)
.withRight(RightOption.br));
if (response.isSuccess()) {
System.out.println(JSONObject.toJSONString(response));
} else {
System.out.println("response error:" + response.getMessage());
}Return Example
{
"code":0,
"data":[
{
"items":[
{
"amount":7140962535.379684,
"close":172.07,
"high":173.1383,
"low":171.7991,
"open":171.99,
"time":1684209600000,
"volume":42110293
},
{
"amount":9878512463.233082,
"close":172.69,
"high":172.925,
"low":170.4201,
"open":171.71,
"time":1684296000000,
"volume":57951604
},
{
"amount":9839606365.96335,
"close":175.05,
"high":175.24,
"low":172.58,
"open":173,
"time":1684382400000,
"volume":65496657
}
],
"period":"day",
"symbol":"AAPL"
}
],
"message":"success",
"sign":"vayBuY47WEr6fJeKKlylYqtpNHlWLbguhO9EbUQNR8Y0MdN51ju2BnPuGnNMyBZkiwBL+rG0KuUW0vbQYXGGmiIV3gfxAJA2NwXaLvOK2iQiSOzc6fAuBzyGe1etDtcvnn5apBFB5opLKVqb+lpLEhsPLzcv8rPV6I1ZCLMeQhU=",
"success":true,
"timestamp":1684831488647
}PageToken Example
List<String> symbols = new ArrayList<>();
symbols.add("AAPL");
QuoteKlineRequest request = QuoteKlineRequest.newRequest(symbols, KType.min1,
"2022-04-25 00:00:00",
"2022-04-28 00:00:00", TimeZoneId.NewYork);
request.withLimit(200);
request.withRight(RightOption.br);
int count = 1;
while (true) {
QuoteKlineResponse response = client.execute(request);
System.out.println(
"search time:" + count + ", success:" + response.isSuccess() + ", msg:" + response.getMessage());
if (!response.isSuccess()) {
break;
}
System.out.println(response.getKlineItems());
if (response.getKlineItems().size() == 0) {
break;
}
KlineItem klineItem = response.getKlineItems().get(0);
if (klineItem.getNextPageToken() == null) {
break;
}
count++;
// 10 times per minute
try {
TimeUnit.SECONDS.sleep(6);
} catch (InterruptedException e) {
e.printStackTrace();
}
// set pagination token then query the next page
request.withPageToken(klineItem.getNextPageToken());
}PageToken Utility Class
Default 1000 per page, pagination query for 10000 records merged and returned on client side. You can refer to the utility class's several overloaded methods. The utility method collects up to 10000 records at once; also note the data size setting per page, each pagination request to server counts as one request, affecting API call frequency. You can implement it yourself referring to the example, pay attention to pagination boundaries to avoid infinite loops.
List<KlinePoint> list =
PageTokenUtil.getKlineByPage("AAPL", KType.min1,
"2022-04-25 00:00:00",
"2022-04-28 00:00:00", TimeZoneId.NewYork,
RightOption.br, 10, 30, PageTokenUtil.DEFAULT_TIME_INTERVAL);
for (KlinePoint item : list) {
System.out.println("content:" + item);
}Get Timeline Data
Corresponding Request Class: QuoteTimelineRequest
Description
Get timeline data for the most recent trading day. Timeline data is similar to minute K-lines, generating one record per minute. Only supports querying data for the latest trading day.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbols | array | Yes | List of stock symbols |
| period | string | Yes | Timeline period, includes: day and day5 |
| trade_session | String | No | TradeSession enum object, Pre-market: PreMarket, Regular: Regular, After-hours: AfterHours. Default is Regular |
| begin_time | long | No | Start time (millisecond timestamp), default returns current day data |
| lang | string | No | Language support: zh_CN, zh_TW, en_US, default: en_US |
Return
com.tigerbrokers.stock.openapi.client.https.response.quote.QuoteTimelineResponsesource
Specific structure:
Return data can be accessed via QuoteTimelineResponse.getTimelineItems() method, returning a List containing TimelineItem objects, where com.tigerbrokers.stock.openapi.client.https.domain.quote.item.TimelineItem properties are:
| Field | Type | Description |
|---|---|---|
| symbol | string | Stock symbol |
| period | string | Period day or 5day |
| preClose | double | Previous close price |
| intraday | object | Intraday timeline array, see fields description below |
| preMarket | object | (US stocks only) Pre-market timeline array and start/end time, see fields description below |
| afterHours | object | (US stocks only) After-hours timeline array and start/end time, see fields description below |
Specific fields of TimelineItem can be accessed through object's get methods, such as getSymbol()
Timeline data intraday fields:
| Timeline Field | Description |
|---|---|
| volume | Volume |
| avgPrice | Average price |
| price | Latest price |
| time | Current timeline time |
Example
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
ClientConfig.DEFAULT_CONFIG);
QuoteTimelineResponse response = client.execute(QuoteTimelineRequest.newRequest(List.of("AAPL"), 1544129760000L));
if (response.isSuccess()) {
System.out.println(Arrays.toString(response.getTimelineItems().toArray()));
} else {
System.out.println("response error:" + response.getMessage());
}Return Example
{
"code": 0,
"data": [
{
"symbol": "AAPL",
"preMarket": {
"endTime": 1544106600000,
"beginTime": 1544086800000,
"items": [
]
},
"period": "day",
"preClose": 176.69000244140625,
"afterHours": {
"endTime": 1544144400000,
"beginTime": 1544130000000,
"items": [
{
"volume": 872772,
"avgPrice": 174.71916,
"price": 174.69,
"time": 1544130000000
},
{
"volume": 3792,
"avgPrice": 174.71893,
"price": 174.66,
"time": 1544130060000
}
]
},
"intraday": [
{
"items": [
{
"volume": 201594,
"avgPrice": 172.0327,
"price": 174.34,
"time": 1544129760000
},
{
"volume": 139040,
"avgPrice": 172.03645,
"price": 174.4156,
"time": 1544129820000
},
{
"volume": 178427,
"avgPrice": 172.0413,
"price": 174.44,
"time": 1544129880000
},
{
"volume": 2969567,
"avgPrice": 172.21619,
"price": 174.72,
"time": 1544129940000
}
]
}
]
}
],
"timestamp": 1544185099595,
"message": "success"
}Get Historical Timeline Data
Corresponding Request Class: QuoteHistoryTimelineRequest
Description
Get historical timeline data for a specified date.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbols | array | Yes | List of stock symbols |
| date | string | Yes | Date yyyyMMdd, e.g., 20220420 |
| right | RightOption | No | Forward adjusted: br, Not adjusted: nr; default: nr |
Return
com.tigerbrokers.stock.openapi.client.https.response.quote.QuoteHistoryTimelineResponsesource
Specific structure:
Return data can be accessed via QuoteHistoryTimelineResponse.getTimelineItems() method, returning a List containing HistoryTimelineItem objects, where com.tigerbrokers.stock.openapi.client.https.domain.quote.item.HistoryTimelineItem properties are:
| Field | Type | Description |
|---|---|---|
| symbol | string | Stock symbol |
| items | TimelinePoint | Intraday timeline array, see fields description below |
Specific fields of TimelineItem can be accessed through object's get methods, such as getSymbol()
Timeline data items field TimelinePoint:
| Timeline Field | Description |
|---|---|
| volume | Volume |
| avgPrice | Average price |
| price | Latest price |
| time | Current timeline time |
Example
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
ClientConfig.DEFAULT_CONFIG);
List<String> symbols = new ArrayList<>();
symbols.add("AAPL");
QuoteHistoryTimelineRequest request = QuoteHistoryTimelineRequest.newRequest(symbols, "20220420");
request.withRight(RightOption.br);
QuoteHistoryTimelineResponse response = client.execute(request);
if (response.isSuccess()) {
System.out.println(Arrays.toString(response.getTimelineItems().toArray()));
} else {
System.out.println("response error:" + response.getMessage());
}Return Example
{
"code":0,
"message":"success",
"timestamp":1651737871819,
"data":[
{
"symbol":"AAPL",
"items":[
{
"time":1650461400000,
"volume":1414143,
"price":168.75,
"avgPrice":168.66885
},
{
"time":1650461460000,
"volume":392862,
"price":168.25,
"avgPrice":168.65086
},
// ....
{
"time":1650484680000,
"volume":443549,
"price":167.24,
"avgPrice":167.47902
},
{
"time":1650484740000,
"volume":6457118,
"price":167.23,
"avgPrice":167.45808
}
]
}
]
}Get Stock Delayed Quotes
Corresponding Request Class: QuoteDelayRequest
Description
This interface is a free delayed quote interface that does not require purchasing market data permissions. It can be used directly after opening a developer account. Currently only supports getting US stock delayed quotes, which are delayed by approximately 15 minutes compared to real-time quotes.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbols | array | Yes | Stock symbols (limit 50 per request), currently only supports US stock delayed quotes. e.g. ['AAPL', 'MSFT'] |
Example
List<String> symbols = new ArrayList<>();
symbols.add("AAPL");
symbols.add("TSLA");
QuoteDelayRequest delayRequest = QuoteDelayRequest.newRequest(symbols);
QuoteDelayResponse response = client.execute(delayRequest);Response
com.tigerbrokers.stock.openapi.client.https.response.quote.QuoteDelayResponse source
Specific structure as follows:
public class QuoteDelayResponse extends TigerResponse {
@JSONField(name = "data")
private List<QuoteDelayItem> quoteDelayItems;
}Response data can be accessed through TigerResponse.getQuoteDelayItems() method, returning a List containing QuoteDelayItem objects, where com.tigerbrokers.stock.openapi.client.https.domain.quote.item.quoteDelayItem properties are as follows:
| Field | Type | Description |
|---|---|---|
| close | double | Closing price |
| high | double | Highest price |
| low | double | Lowest price |
| open | double | Opening price |
| preClose | double | Previous close |
| time | long | Time |
| volume | long | Volume |
Specific fields of QuoteDelayItem can be accessed through the object's get methods, such as getClose()
Response Example
[
{
"close": 156.81,
"halted": 0,
"high": 160.45,
"low": 156.36,
"open": 159.565,
"preClose": 161.94,
"symbol": "AAPL",
"time": 1637949600000,
"volume": 76959752
},
{
"close": 1081.92,
"halted": 0,
"high": 1108.7827,
"low": 1081,
"open": 1099.47,
"preClose": 1116,
"symbol": "TSLA",
"time": 1637949600000,
"volume": 11680890
}
]Get Stock Trading Information
Corresponding Request Class: QuoteStockTradeRequest
Description
Get information required for stock trading, including lot size, quote precision, and minimum price increment.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbols | array | Yes | List of stock symbols, limit: 50 |
Response
com.tigerbrokers.stock.openapi.client.https.response.quote.QuoteStockTradeResponsesource
Structure as follows:
public class QuoteStockTradeResponse extends TigerResponse {
@JSONField(name = "data")
private List<QuoteStockTradeItem> stockTradeItems;
public List<QuoteStockTradeItem> getStockTradeItems() {
return stockTradeItems;
}
}Response data can be accessed through QuoteStockTradeResponse.getStockTradeItems() method, returning QuoteStockTradeItem objects, where com.tigerbrokers.stock.openapi.client.https.domain.quote.item.QuoteStockTradeItem properties are as follows:
| Name | Type | Description |
|---|---|---|
| symbol | String | Stock symbol |
| lotSize | Integer | Lot size |
| spreadScale | Integer | Quote precision |
| minTick | Double | Minimum price increment |
Specific fields can be accessed through the object's get methods, such as getSymbol(), or converted to string through the object's toString() method
Example
List<String> symbols = new ArrayList<>();
symbols.add("00700");
symbols.add("00810");
QuoteStockTradeResponse response = client.execute(QuoteStockTradeRequest.newRequest(symbols));
if (response.isSuccess()) {
System.out.println(Arrays.toString(response.getStockTradeItems().toArray()));
} else {
System.out.println("response error:" + response.getMessage());
}Response Example
{
"code": 0,
"data": [{
"lotSize": 100,
"minTick": 0.2,
"spreadScale": 0,
"symbol": "00700"
}, {
"lotSize": 6000,
"minTick": 0.001,
"spreadScale": 0,
"symbol": "00810"
}],
"message": "success",
"timestamp": 1546853907390
}Get Stock Capital Flow Data
Corresponding Request Class: QuoteCapitalFlowRequest
Description
Get stock capital net inflow data, including real-time minute data for the most recent trading day, and net inflow data for different periods. For different time granularities, supports getting data in units of day, week, month, quarter, half-year, and year, with a maximum limit of 1200 records, default is 200 records.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Stock symbol |
| period | string | Yes | Data type, value range (intraday: real-time, day: daily, week: weekly, month: monthly, year: yearly, quarter: quarterly, 6month: half-yearly) |
| market | string | Yes | US for US stocks, HK for Hong Kong stocks, CN for A-shares (real-time capital flow does not support A-shares) |
| begin_time | long | No | Start time, default: -1, unit: milliseconds (ms), closed-open interval, query results will include start time data, when querying weekly/monthly/yearly K-line, will return data including the current period (e.g.: if start time is Wednesday, will return data from this Monday) |
| end_time | long | No | End time, default: -1, unit: milliseconds (ms) |
| limit | integer | No | Number of records returned per request, default is 200 if not provided, limit cannot exceed 1200, if limit is set greater than 1200, only 1200 records will be returned |
| lang | string | No | Language support: zh_CN, zh_TW, en_US, default: en_US |
Response
com.tigerbrokers.stock.openapi.client.https.response.quote.QuoteCapitalFlowResponsesource
Response data can be accessed through QuoteCapitalFlowResponse.getCapitalFlowItem() method, returning CapitalFlowItem objects, where com.tigerbrokers.stock.openapi.client.https.domain.quote.item.CapitalFlowItem properties are as follows:
| Field | Type | Description |
|---|---|---|
| symbol | string | Stock symbol |
| period | string | Period |
| items | array | Capital net inflow array, fields described below |
Where the specific time point data items properties are as follows:
| Field | Type | Description |
|---|---|---|
| netInflow | double | Net inflow amount, negative number indicates outflow |
| time | string | Time string in the target market's timezone, real-time data format: "11-25 12:48:00 EST", non-real-time data format: "2022-11-22" |
| timestamp | long | Time |
Example
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
ClientConfig.DEFAULT_CONFIG);
// Real-time data
QuoteCapitalFlowRequest request = QuoteCapitalFlowRequest.newRequest(
"AAPL", Market.US, CapitalPeriod.intraday);
QuoteCapitalFlowResponse response = client.execute(request);
if (response.isSuccess()) {
System.out.println(JSONObject.toJSON(response.getCapitalFlowItem()));
} else {
System.out.println("response error:" + response.getMessage());
}
// Last 10 days capital net inflow data
QuoteCapitalFlowRequest request = QuoteCapitalFlowRequest.newRequest(
"00700", Market.HK, CapitalPeriod.day);
request.setLimit(10);
QuoteCapitalFlowResponse response = client.execute(request);
if (response.isSuccess()) {
System.out.println(JSONObject.toJSON(response.getCapitalFlowItem()));
} else {
System.out.println("response error:" + response.getMessage());
}Response Example
// Real-time data
{
"symbol": "AAPL",
"items": [
{
"netInflow": -109057032.2042,
"time": "11-25 09:30:00 EST",
"timestamp": 1669386600000
},
{
"netInflow": -116890065.471,
"time": "11-25 09:31:00 EST",
"timestamp": 1669386660000
}
]
}
// Last 10 days capital net inflow data
{
"symbol": "00700",
"period": "day",
"items": [
{
"netInflow": 687742300,
"time": "2022-11-14",
"timestamp": 1668355200000
},
{
"netInflow": 1926444000,
"time": "2022-11-15",
"timestamp": 1668441600000
},
{
"netInflow": 1033900840,
"time": "2022-11-16",
"timestamp": 1668528000000
},
{
"netInflow": 1667729580,
"time": "2022-11-17",
"timestamp": 1668614400000
},
{
"netInflow": 284728680,
"time": "2022-11-18",
"timestamp": 1668700800000
},
{
"netInflow": 661046060,
"time": "2022-11-21",
"timestamp": 1668960000000
},
{
"netInflow": -86129700,
"time": "2022-11-22",
"timestamp": 1669046400000
},
{
"netInflow": 350223200,
"time": "2022-11-23",
"timestamp": 1669132800000
},
{
"netInflow": -161005460,
"time": "2022-11-24",
"timestamp": 1669219200000
},
{
"netInflow": 17355680,
"time": "2022-11-25",
"timestamp": 1669305600000
}
]
}Get Stock Capital Distribution
Corresponding Request Class: QuoteCapitalDistributionRequest
Description
Get stock capital distribution.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Stock symbol |
| market | string | Yes | US for US stocks, HK for Hong Kong stocks, CN for A-shares |
| lang | string | No | Language support: zh_CN, zh_TW, en_US; default: en_US |
Response
com.tigerbrokers.stock.openapi.client.https.response.quote.QuoteCapitalDistributionResponsesource
Response data can be accessed through QuoteCapitalDistributionResponse.getCapitalDistributionItem() method, returning CapitalDistributionItem objects, where com.tigerbrokers.stock.openapi.client.https.domain.quote.item.CapitalDistributionItem properties are as follows:
| Field | Type | Description |
|---|---|---|
| symbol | string | Stock symbol |
| netInflow | double | Net inflow amount (total inflow - total outflow), negative number indicates outflow |
| inAll | double | Total inflow amount (large + medium + small orders) |
| inBig | double | Large order inflow |
| inMid | double | Medium order inflow |
| inSmall | double | Small order inflow |
| outAll | double | Total outflow amount (large + medium + small orders) |
| outBig | double | Large order outflow |
| outMid | double | Medium order outflow |
| outSmall | double | Small order outflow |
Example
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
ClientConfig.DEFAULT_CONFIG);
QuoteCapitalDistributionRequest request = QuoteCapitalDistributionRequest.newRequest(
"00700", Market.HK);
QuoteCapitalDistributionResponse response = client.execute(request);
if (response.isSuccess()) {
System.out.println(JSONObject.toJSON(response.getCapitalDistributionItem()));
} else {
System.out.println("response error:" + response.getMessage());
}Response Example
{
"inBig": 721190520,
"netInflow": 481406280,
"symbol": "00700",
"outBig": 464624440,
"outAll": 3639820460,
"inAll": 4121226740,
"inMid": 604918520,
"inSmall": 2795117700,
"outMid": 572017220,
"outSmall": 2603178800
}Get Hong Kong Stock Broker Seats
Corresponding Request Class: QuoteStockBrokerRequest
Description
Get Hong Kong stock broker buy/sell seats.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Stock symbol |
| limit | integer | No | Number of buy/sell seats returned per request, default is 40 if not provided, limit cannot exceed 60, if limit is set greater than 60, only 60 records will be returned |
| lang | string | No | Language support: en_US, zh_CN, zh_TW, default: en_US |
Response
com.tigerbrokers.stock.openapi.client.https.response.quote.QuoteStockBrokerResponsesource
Response data can be accessed through QuoteStockBrokerResponse.getStockBrokerItem() method, returning StockBrokerItem objects, where com.tigerbrokers.stock.openapi.client.https.domain.quote.item.StockBrokerItem properties are as follows:
| Field | Type | Description |
|---|---|---|
| symbol | string | Stock symbol |
| bidBroker | array | Buy side different price level arrays, fields refer to LevelBroker description |
| askBroker | array | Sell side different price level arrays, fields refer to LevelBroker description |
Where LevelBroker properties are as follows:
| Field | Type | Description |
|---|---|---|
| level | integer | Price level |
| price | double | Price |
| brokerCount | integer | Number of seats |
| broker | array | Broker buy/sell seat list |
Example
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
ClientConfig.DEFAULT_CONFIG);
QuoteStockBrokerRequest request = QuoteStockBrokerRequest.newRequest("00700", 10, Language.zh_CN);
QuoteStockBrokerResponse response = client.execute(request);
if (response.isSuccess()) {
System.out.println(JSONObject.toJSON(response.getStockBrokerItem()));
} else {
System.out.println("response error:" + response.getMessage());
}Response Example
{
"bidBroker":[
{
"level":1,
"price":287.8,
"brokerCount":7,
"broker":[
{
"name":"CHINA INVESTMENT",
"id":"6997"
},
{
"name":"CHINA INVESTMENT",
"id":"6998"
},
{
"name":"BOC",
"id":"8134"
},
{
"name":"CHINA INVESTMENT",
"id":"6998"
},
{
"name":"CHINA CHUANGYING",
"id":"5999"
},
{
"name":"CHINA INVESTMENT",
"id":"6996"
},
{
"name":"J.P. Morgan",
"id":"5342"
}
]
},
{
"level":2,
"price":287.6,
"brokerCount":3,
"broker":[
{
"name":"CHINA INVESTMENT",
"id":"6998"
},
{
"name":"CHINA INVESTMENT",
"id":"6999"
},
{
"name":"CHINA CHUANGYING",
"id":"5998"
}
]
}
],
"symbol":"00700",
"askBroker":[
{
"level":1,
"price":288,
"brokerCount":10,
"broker":[
{
"name":"FUTU Securities",
"id":"8461"
},
{
"name":"CHINA CHUANGYING",
"id":"5998"
},
{
"name":"ICBC ASIA",
"id":"8117"
},
{
"name":"CHINA CHUANGYING",
"id":"5998"
},
{
"name":"CHINA INVESTMENT",
"id":"6999"
},
{
"name":"HSBC",
"id":"8577"
},
{
"name":"CHINA INVESTMENT",
"id":"6996"
},
{
"name":"CHINA INVESTMENT",
"id":"6999"
},
{
"name":"FUTU Securities",
"id":"8462"
},
{
"name":"HSBC",
"id":"8575"
}
]
}
]
}Get Hong Kong Stock Broker Holdings Market Value
Corresponding Request Class: QuoteBrokerHoldRequest
Description
Get Hong Kong stock broker holdings market value.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| market | Market | Yes | Common market enum values: only supports HK for Hong Kong stocks. For enum values see: Market Enum |
| limit | Integer | No | Records per page, default is 50 if not provided, limit cannot exceed 500, if limit is set greater than 500, only 500 records will be returned |
| page | Integer | No | Page number, starting from 0, default 0 |
| orderBy | String | No | Sort field, default marketValue, optional values marketValue/sharesHold/buyAmount/buyAmount5/buyAmount20/buyAmount60 |
| direction | String | No | Sort direction, DESC descending / ASC ascending, default DESC |
| lang | Language | No | Language support: en_US, zh_CN, zh_TW, default: en_US |
Response
com.tigerbrokers.stock.openapi.client.https.response.quote.QuoteBrokerHoldResponse
Response data can be accessed through QuoteBrokerHoldResponse.getBrokerHoldPageItem() method, returning BrokerHoldPageItem objects, where com.tigerbrokers.stock.openapi.client.https.domain.quote.item.BrokerHoldItem properties are as follows:
| Field | Type | Description |
|---|---|---|
| ortId | String | Broker ID |
| orgName | String | Broker name |
| date | String | Latest trading day |
| sharesHold | Long | Holdings quantity |
| marketValue | Double | Holdings market value |
| buyAmount | Long | 1-day net buying |
| buyAmount5 | Long | 5-day net buying |
| buyAmount20 | Long | 20-day net buying |
| buyAmount60 | Long | 60-day net buying |
| market | String | Market |
Example
import com.tigerbrokers.stock.openapi.client.struct.enums.Market;
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
ClientConfig.DEFAULT_CONFIG);
QuoteBrokerHoldResponse response = client.execute(QuoteBrokerHoldRequest.newRequest(Market.HK, 50, 0, "buyAmount", "DESC"));
if (response.isSuccess()) {
System.out.println(JSONObject.toJSON(response.getBrokerHoldPageItem()));
} else {
System.out.println("response error:" + response.getMessage());
}Response Example
{
"items": [
{
"buyAmount": -664008615,
"buyAmount20": -7689110984,
"buyAmount5": -3624382900,
"buyAmount60": -32074599790,
"date": "2025-04-14",
"market": "HK",
"marketValue": 9.194317557765623E12,
"orgId": "C00019",
"orgName": "HONGKONG SHANGHAI BANKING",
"sharesHold": 696720677628
},
{
"buyAmount": -141033766,
"buyAmount20": 10883985046,
"buyAmount5": 4542732770,
"buyAmount60": 17917177125,
"date": "2025-04-14",
"market": "HK",
"marketValue": 2.604522670544478E12,
"orgId": "A00003",
"orgName": "(SH)-HK Stock Connect",
"sharesHold": 294896574932
},
{
"buyAmount": 92657497,
"buyAmount20": -120870931,
"buyAmount5": -209014086,
"buyAmount60": -5366617605,
"date": "2025-04-14",
"market": "HK",
"marketValue": 1.9825098585195176E12,
"orgId": "C00010",
"orgName": "CITIBANK N.A.",
"sharesHold": 206374851472
},
{
"buyAmount": 220232675,
"buyAmount20": 5542004542,
"buyAmount5": 2942019847,
"buyAmount60": 4379764988,
"date": "2025-04-14",
"market": "HK",
"marketValue": 1.7997280891850354E12,
"orgId": "A00004",
"orgName": "(SZ)-HK Stock Connect",
"sharesHold": 199832572853
},
{
"buyAmount": 48566660,
"buyAmount20": -3485972222,
"buyAmount5": 1044767966,
"buyAmount60": -1685601977,
"date": "2025-04-14",
"market": "HK",
"marketValue": 1.0904056485834637E12,
"orgId": "B01161",
"orgName": "UBS",
"sharesHold": 156347776229
}
],
"page": 0,
"totalCount": 672,
"totalPage": 135
}Get Hot Trading Rankings
Corresponding Request Class: QuoteTradeRankRequest
Description
Get stock hot trading rankings, data is updated approximately every 20 seconds.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| market | Market | Yes | Market, optional values: Market.US for US stocks, Market.HK for Hong Kong stocks, Market.SG for Singapore stocks |
| lang | string | No | Language, optional values: en_US, zh_CN, zh_TW, default: en_US |
Response
US stocks return 30 records, Hong Kong and Singapore stocks return 10 records.
com.tigerbrokers.stock.openapi.client.https.response.quote.QuoteTradeRankResponsesource
Response data can be accessed through QuoteTradeRankResponse.getTradeRankItem() method, returning TradeRankItem objects, where com.tigerbrokers.stock.openapi.client.https.domain.quote.item.TradeRankItem properties are as follows:
| Field | Type | Description |
|---|---|---|
| symbol | string | Stock symbol |
| name | string | Stock name |
| market | string | Market |
| changeRate | double | Intraday change rate, if currently not in intraday trading session, then it's the previous trading day's intraday change rate |
| sellOrderRate | double | Sell order ratio, cumulative buy/sell ratio for the day, e.g., during intraday stage: pre-market + intraday cumulative buy/sell ratio, during after-hours stage includes pre-market + intraday + after-hours |
| buyOrderRate | double | Buy order ratio, calculation method same as above |
| hourTrading | object | Pre-market and after-hours trading information |
| hourTrading.tradingStatus | integer | Pre-market and after-hours trading status |
| hourTrading.tradeSession | string | Pre-market and after-hours trading session |
| hourTrading.changeRate | double | Latest pre-market or after-hours change rate |
Example
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
ClientConfig.DEFAULT_CONFIG);
QuoteTradeRankRequest request = QuoteTradeRankRequest.newRequest(Market.US, Language.en_US);
QuoteTradeRankResponse response = client.execute(request);
if (response.isSuccess()) {
System.out.println(JSONObject.toJSON(response.getTradeRankItem()));
} else {
System.out.println("response error:" + response.getMessage());
}Response Example
[
{
"buyOrderRate": 0.606061,
"changeRate": -0.030871,
"hourTrading": {
"changeRate": -0.009057,
"tradingStatus": 1
},
"market": "US",
"name": "NVIDIA",
"secType": "STK",
"sellOrderRate": 0.393939,
"symbol": "NVDA"
},
{
"buyOrderRate": 0.409091,
"changeRate": -0.021522,
"hourTrading": {
"changeRate": -0.004568,
"tradingStatus": 1
},
"market": "US",
"name": "Tesla Motors",
"secType": "STK",
"sellOrderRate": 0.590909,
"symbol": "TSLA"
},
{
"buyOrderRate": 0.157895,
"changeRate": -0.040058,
"hourTrading": {
"changeRate": 0.150228,
"tradingStatus": 1
},
"market": "US",
"name": "Li Auto",
"secType": "STK",
"sellOrderRate": 0.842105,
"symbol": "LI"
},
{
"buyOrderRate": 0.333333,
"changeRate": -0.10233,
"hourTrading": {
"changeRate": 0.033246,
"tradingStatus": 1
},
"market": "US",
"name": "Alibaba",
"secType": "STK",
"sellOrderRate": 0.666667,
"symbol": "BABA"
},
{
"buyOrderRate": 0.333333,
"changeRate": -0.079543,
"hourTrading": {
"changeRate": -0.03759,
"tradingStatus": 1
},
"market": "US",
"name": "SUPER MICRO COMPUTER INC",
"secType": "STK",
"sellOrderRate": 0.666667,
"symbol": "SMCI"
}
]Updated about 7 hours ago
