Securities


Get Market State

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

ParameterTypeRequiredDescription
marketMarketYesCommon 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
langLanguageNoLanguage 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 response has the following structure:

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:

FieldTypeDescription
marketstringMarket code (US: US stocks, HK: Hong Kong stocks, CN: A-shares)
marketStatusstringMarket 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.
statusstringMarket 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, OVERNIGHT_TRADING: Overnight trading, EARLY_CLOSED: Early close, MARKET_CLOSED: Market closed)
openTimestringMost 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 time zone. For other markets, corresponding market time zone 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());
}

Example Response

{
  "code": 0,
  "message": "success",
  "timestamp": 1525938835697,
  "data": [
    {
      "market": "US",
      "marketStatus": "Closed Independence Day",
      "status": "CLOSING",
      "openTime": "07-04 09:30:00 EDT"
    }
  ]
}

Rate Limit

The base rate limit is 10 requests/min.


Get Market Trading Calendar

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

ParameterTypeRequiredDescription
marketstringYesUS for US stocks, HK for Hong Kong stocks, CN for A-shares
begin_datestringNoCalendar start date (inclusive). yyyy-MM-dd format, e.g. '2022-06-01'
end_datestringNoCalendar end date (exclusive). yyyy-MM-dd format

begin_date and end_date parameter handling is as follows:

begin_date passedend_date passedDescription
YesYesbegin_date and end_date are the supplied values
YesNoend_date is 365 days after begin_date
NoYesbegin_date is 365 days before end_date
NoNobegin_date is today and end_date is 30 days later

Response

com.tigerbrokers.stock.openapi.client.https.response.quote.QuoteTradeCalendarResponse
source

The response has the following structure:

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:

FieldTypeDescription
datestringTrading date
typestringTrading day type: TRADING for normal trading day with full-day trading; EARLY_CLOSE for early close
openTimeStringMarket open time in HH:mm:ss format
closeTimeStringMarket close time in HH:mm:ss format

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());
}

Example Response

{
  "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 All Symbols

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

ParameterTypeRequiredDescription
marketMarketNoMarket, set through newRequest(Market) or market(Market)
package_namePackageNameNoQuote package, set through newRequest(PackageName) or packageName(PackageName)
sec_typeSecTypeNoSecurity type, set through secType(SecType)
include_otcbooleanNoWhether to include OTC securities, default: false
langstringNoLanguage support: zh_CN, zh_TW, en_US; default: en_US

market and package_name are individually optional, but at least one of them must be provided.

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());
}

Example Response

{
  "code": 0,
  "message": "success",
  "timestamp": 1525938835697,
  "data": ["A", "A.W", "AA", "AA-B", "AAAP", "AABA", "AAC", "AADR", "AAIT", "AAL", "AALCP", "AAMC", "AAME"]
}

Rate Limit

The base rate limit is 10 requests/min.


Get Symbols and Names

Request class: QuoteSymbolNameRequest

Description

Get all security symbols and corresponding names for a specified market.

Parameters

ParameterTypeRequiredDescription
marketstringYesUS for US stocks, HK for Hong Kong stocks, CN for A-shares
include_otcbooleanNoWhether to include OTC securities, default: false
langstringNoLanguage 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:

FieldTypeDescription
namestringStock name
symbolstringStock 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());
}

Example Response

{
  "code": 0,
  "message": "success",
  "timestamp": 1525938835697,
  "data": [{"name":"CKH Holdings","symbol":"00001"},{"name":"CLP","symbol":"00002"}]
}

Rate Limit

The base rate limit is 10 requests/min.


Get Real-time Quotes

Request class: QuoteRealTimeQuoteRequest

Description

Get real-time stock quotes. You must purchase market data access for the corresponding market before using this endpoint. Each request supports up to 50 stocks.

Parameters

ParameterTypeRequiredDescription
symbolsarrayYesList of stock symbols (maximum 50 per request)
includeHourTradingBooleanNoWhether to include US pre-market and after-hours data, default: false
sec_typeSecTypeNoSecurity type, set through withSecType(SecType)
langstringNoLanguage 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:

FieldTypeDescription
symbolstringStock symbol
opendoubleOpening price
highdoubleHigh price
lowdoubleLow price
closedoubleClosing price
preClosedoublePrevious trading day's closing price
latestPricedoubleLatest price
latestTimelongLatest trading time
askPricedoubleAsk price
askSizelongAsk size
bidPricedoubleBid price
bidSizelongBid size
volumelongVolume
statusstringTrading status
changedoublePrice change
changeRatedoublePrice change rate
amplitudedoublePrice amplitude
hourTradingobjectUS 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:

FieldTypeDescription
tagstringPre-market ("Pre-Mkt") or after-hours ("Post-Mkt") indicator
latestPricedoubleLatest price
preClosedoublePrevious close
latestTimestringPre-market / after-hours data time (Eastern Time)
volumelongVolume
changedoublePrice change
changeRatedoublePrice change rate
amplitudedoublePrice amplitude
timestamplongPre-market / after-hours data 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

// Stock quotes only (pre-market and after-hours excluded by default).
QuoteRealTimeQuoteResponse response = client.execute(QuoteRealTimeQuoteRequest.newRequest(List.of("AAPL")));
// To include pre-market and after-hours quotes, pass true as the second argument.
// 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());
}

Example Response

{
  "code" : 0,
  "message" : "success",
  "timestamp" : 1769062464074,
  "realTimeQuoteItems" : [ {
    "lang" : null,
    "symbol" : "AAPL",
    "open" : 248.7,
    "high" : 251.56,
    "low" : 245.18,
    "close" : 247.65,
    "preClose" : 246.7,
    "latestPrice" : 247.65,
    "latestTime" : 1769029200000,
    "askPrice" : 0.0,
    "askSize" : 0,
    "bidPrice" : 0.0,
    "bidSize" : 0,
    "volume" : 54641725,
    "status" : "NORMAL",
    "change" : 0.95,
    "changeRate" : 0.003850830968788071,
    "amplitude" : 0.025861,
    "hourTrading" : {
      "tag" : "Post-Mkt",
      "latestPrice" : 248.7,
      "preClose" : 247.65,
      "latestTime" : "19:59 EST",
      "volume" : 4273405,
      "change" : 1.05,
      "changeRate" : 0.00424,
      "amplitude" : 0.007511,
      "timestamp" : 1769043588222
    },
    "account" : null
  } ],
  "success" : true
}

Rate Limit

The base rate limit is 120 requests/min.



Get Market Depth

Request class: QuoteDepthRequest

Description

Get the bid/ask N-level order data for US and Hong Kong securities, including order price, quantity, and order count. You must purchase market data access for the corresponding market before using this endpoint. Each request supports up to 50 securities.

⚠️

NOTE

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 order book update for the day usually arrives one to two minutes after 16:10.

US stocks: Market depth includes pre-market and after-hours trading information. No additional parameters are needed; real-time requests can obtain this data.

Parameters

ParameterTypeRequiredDescription
symbolsarrayYesList of stock symbols (maximum 50 per request)
marketstringYesUS for US stocks or HK for Hong Kong stocks
trade_sessionTradeSessionNoTrading session: PreMarket, Regular, AfterHours, OverNight, or All

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:

FieldTypeDescription
symbolstringStock symbol
askslistAsk levels
bidslistBid levels

The detailed fields for bid/ask levels are as follows:

FieldTypeDescription
pricedoubleOrder price
volumelongOrder volume
countintNumber 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());
}

Example Response

{
  "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
        }
      ]
    }
  ]
}

Rate Limit

The base rate limit is 60 requests/min.



Get Trade Ticks

Request class: QuoteTradeTickRequest

Description

Get trade ticks. You must purchase market data access for the corresponding market before using this endpoint. This endpoint supports both querying all trade ticks for the current trading day after market close and getting the latest trade ticks during market hours.

Parameters

ParameterTypeRequiredDescription
symbolsarrayYesList of stock symbols, up to 50 symbols, supports China Connect stocks, Hong Kong stocks, and US stocks
trade_sessionTradeSessionNoTrading session: PreMarket, Regular, AfterHours, OverNight, or All; default: Regular
beginIndexLongNoStart index; daily indices start at 0. Omit it with endIndex to query recent ticks. For continuation, use the previous response's endIndex as the next beginIndex. The range is half-open: 1 to 100 returns indices 1 through 99
endIndexLongNoEnd index. When supplied with beginIndex, it must not be less than beginIndex
limitIntegerNoMaximum records returned. If omitted or non-positive, the cap is 2,000 when the supplied range is no larger than 2,000; otherwise the default is 200. Values of 2,000 or greater are capped at 2,000. Range results are also bounded by limit
langstringNoLanguage support: en_US, zh_CN, zh_TW, default: en_US

Usage Instructions for beginIndex and endIndex Parameters

Query MethodbeginIndexendIndexDescription
Query Latest TicksOmitted or -1Omitted or -1Returns the latest limit ticks; limit defaults to 200 when omitted
Query Daily Ticks by RangeSpecific valueSpecific valueExample: beginIndex=10, endIndex=100 returns 90 records from 10 to 99. If limit is set to 20, returns 20 records from 10 to 29.

When only one bound is provided, the other is sent as -1. The SDK and current service contract do not define a fixed older/newer direction for that one-sided form; provide both bounds for an explicit range.

Response

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:

FieldTypeDescription
beginIndexlongActual start index of returned data
endIndexlongActual end index of returned data
symbolstringRequested stock symbol
itemsList<TickPoint>List containing tick trade data, individual tick trade data stored in TickPoint objects

TickPoint object fields:

FieldTypeDescription
timelongTrade timestamp
pricedoubleTrade price
volumelongTrade volume
typestring"+" 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, 0L, 30L, 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());
}

Example Response

{
    "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
}

Rate Limit

The base rate limit is 120 requests/min.



Get Candlestick Bars

Request class: QuoteKlineRequest

Description

Supports Hong Kong and US stock candlestick bars (K-line data), including daily, weekly, monthly, yearly, 1-minute, 5-minute, 15-minute, 30-minute, and 60-minute intervals. Each request returns up to 1,200 records. For a longer range, request consecutive date ranges. The endpoint supports queries by date range or specified date.

  • Minute-level candlestick bars (1/5/15/30/60 minutes): Supports historical data from the past 10 years
  • Daily candlestick bars and above (daily/weekly/monthly/yearly): Provides complete historical data
  • US stock pre-market and after-hours only support 60-minute and below candlestick bars (K-line data) after April 2024
  • When begin_time and end_time are used for the current day, the complete data is available about two and a half hours after market close

Note that there may be limits on the number of candlestick bars that can be requested. For details, please see Historical Quote Limits & Subscription Limits

Parameters

ParameterTypeDescription
symbolsarrayList of stock symbols, limit: 50, where A-share limit: 30
periodstringK-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_sessionstringTradeSession enum object, Pre-market: PreMarket, Regular: Regular, After-hours: AfterHours, Overnight: OverNight. Default is Regular, pre-market and after-hours only support 1-minute candlestick bars
rightstringRights adjustment option, br: forward adjusted (default), nr: not adjusted
begin_timelongStart time for range query, parameter restrictions: 1-minute and 5-minute candlestick bars only support data from the past 1 month, 15/30/60 minute candlestick bars support data from the past 1 year, for earlier minute-level candlestick bars, 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_timelongEnd time for range query, parameter restrictions: 1-minute and 5-minute candlestick bars only support data from the past 1 month, 15/30/60 minute candlestick bars support data from the past 1 year, for earlier minute-level candlestick bars, please use specified date query. Parameter default: -1, unit: milliseconds (ms)
datestringDate, use this parameter (format: yyyyMMdd) to get minute-level candlestick bars (K-line data) for a specified date.
  1. Supports querying minute-level candlestick bars (K-line data) from the past 10 years

  2. period parameter supports 1min, 5min, 15min, 30min, 60min

  3. symbols parameter can only pass a single stock symbol

  4. Pagination and time filtering parameters like limit, pageToken, begin_time, end_time will automatically become invalid, no need to pass

  5. Same-day queries follow your purchased market data access; after the next market open, the previous day is available as full-market data

limitintegerNumber of candlestick bars 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
langstringLanguage support: en_US, zh_CN, zh_TW, default: en_US
withFundamentalboolWhether to return P/E ratios and turnover rate; defaults to false
pageTokenstringPagination query token (only supports single symbol, queries with specified begin_time), when using pageToken for pagination, other query conditions cannot be changed

Response

com.tigerbrokers.stock.openapi.client.https.response.quote.QuoteKlineResponsesource

Access the response through QuoteKlineResponse.getKlineItems(), which returns a list of KlineItem objects with the following fields:

FieldTypeDescription
symbolstringStock symbol
periodstringBar period
nextPageTokenstringToken to query next page (only valid for single symbol, when begin_time is not -1), returns null if no more data
itemsarrayCandlestick bars represented by KlinePoint objects. See the fields below.

KlinePoint bar fields:

Bar FieldTypeDescription
closedoubleClose price
highdoubleHigh price
lowdoubleLow price
opendoubleOpen price
timelongTime
volumelongInteger volume for stocks
volumeDecimalDoubleDecimal volume for cryptocurrency only; null for stock responses
amountdoubleAmount
turnoverRatedoubleTurnover rate. Not returned by default
ttmPedoubleTrailing Twelve Months PE. Not returned by default
lyrPedoubleLast Year Ratio PE. Not returned by default

Access individual fields through getter 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());
}

Example Response

{
    "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++;
      // Base limit: 60 requests/min. See /docs/ratelimit.
      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);
  }

Rate Limit

The base rate limit is 60 requests/min.


Get Intraday Data for the Latest Trading Day

Request class: QuoteTimelineRequest

Description

Get timeline data for the most recent trading day. You must purchase market data access for the corresponding market before using this endpoint. Timeline data is similar to minute candlestick bars, generating one record per minute. This endpoint supports only the latest trading day.

Parameters

ParameterTypeRequiredDescription
symbolsarrayYesList of stock symbols, up to 50 symbols
periodTimeLineTypeNoTimeline period: day or day5; default: day
trade_sessionTradeSessionNoTrading session: PreMarket, Regular, AfterHours, OverNight, or All; default: Regular
begin_timeLongNoStart time in milliseconds; returns current-day data by default
sec_typeSecTypeNoSecurity type, set through withSecType(SecType)
langstringNoLanguage support: zh_CN, zh_TW, en_US, default: en_US

Response

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:

FieldTypeDescription
symbolstringStock symbol
periodstringPeriod day or 5day
preClosedoublePrevious close price
intradayobjectIntraday timeline array, see fields description below
preMarketobject(US stocks only) Pre-market timeline array and start/end time, see fields description below
afterHoursobject(US stocks only) After-hours timeline array and start/end time, see fields description below
overnightobject(US stocks only) Overnight 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()

intraday, preMarket, afterHours, and overnight are TimelineRange objects:

FieldTypeDescription
itemsList<TimelinePoint>Timeline points
beginTimeLongRange start, in milliseconds
endTimeLongRange end, in milliseconds

Timeline point fields in items:

Timeline FieldDescription
volumeInteger volume for stocks
volumeDecimalDecimal volume for current cryptocurrency timelines only; null for stock responses
avgPriceAverage price
priceLatest price
timeCurrent 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());
}

Example Response

{
  "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"
}

Rate Limit

The base rate limit is 120 requests/min.


Get Historical Intraday Data

Request class: QuoteHistoryTimelineRequest

Description

Get historical timeline data for a specified date.

Parameters

ParameterTypeRequiredDescription
symbolsarrayYesList of stock symbols, up to 50 symbols
datestringYesDate yyyyMMdd, e.g., 20220420
rightRightOptionNoForward-adjusted: br; unadjusted: nr. When unset, the SDK omits this field
trade_sessionTradeSessionNoTrading session: PreMarket, Regular, AfterHours, OverNight, or All

Response

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:

FieldTypeDescription
symbolstringStock symbol
itemsList<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 FieldDescription
volumeInteger volume for historical timelines
volumeDecimalDecimal volume for cryptocurrency only; null for historical timeline responses
avgPriceAverage price
priceLatest price
timeCurrent 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());
}

Example Response

{
    "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
                }
            ]
        }
    ]
}

Rate Limit

The base rate limit is 60 requests/min.


Get Delayed Stock Quotes

Request class: QuoteDelayRequest

Description

This free endpoint does not require market data access and is available after opening a developer account. It currently supports only US stock quotes, delayed by approximately 15 minutes from real-time quotes.

Parameters

ParameterTypeRequiredDescription
symbolsarrayYesStock 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 QuoteDelayResponse.getQuoteDelayItems() method, returning a List containing QuoteDelayItem objects, where com.tigerbrokers.stock.openapi.client.https.domain.quote.item.QuoteDelayItem properties are as follows:

FieldTypeDescription
closedoubleClosing price
symbolStringStock symbol
highdoubleHighest price
lowdoubleLowest price
opendoubleOpening price
preClosedoublePrevious close
haltedDoubleSecurity status value: 0 Normal, 3 Suspended, 4 Delisted, 7 New Stock, 8 Changed
timelongTime
volumelongVolume

Specific fields of QuoteDelayItem can be accessed through the object's get methods, such as getClose()

Example Response

[
  {
    "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
  }
]

Rate Limit

The base rate limit is 10 requests/min.


Get Stock Trading Information

Request class: QuoteStockTradeRequest

Description

Get information required for stock trading, including lot size, quote precision, and minimum price increment.

Parameters

ParameterTypeRequiredDescription
symbolsarrayYesList 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:

NameTypeDescription
symbolStringStock symbol
lotSizeIntegerLot size
spreadScaleIntegerQuote precision
minTickDoubleMinimum 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());
}

Example Response

{
  "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
}

Rate Limit

The base rate limit is 60 requests/min.


Get Stock Capital Flow Data

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

ParameterTypeRequiredDescription
symbolstringYesStock symbol
periodstringYesData type, value range (intraday: real-time, day: daily, week: weekly, month: monthly, year: yearly, quarter: quarterly, 6month: half-yearly)
marketstringYesUS for US stocks, HK for Hong Kong stocks, CN for A-shares (real-time capital flow does not support A-shares)
begin_timelongNoStart 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_timelongNoEnd time, default: -1, unit: milliseconds (ms)
limitintegerNoNumber 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
langstringNoLanguage 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:

FieldTypeDescription
symbolstringStock symbol
periodstringPeriod
itemsarrayCapital net inflow array, fields described below

Where the specific time point data items properties are as follows:

FieldTypeDescription
netInflowdoubleNet inflow amount, negative number indicates outflow
timestringTime string in the target market's time zone, real-time data format: "11-25 12:48:00 EST", non-real-time data format: "2022-11-22"
timestamplongTime

Example

TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
      ClientConfig.DEFAULT_CONFIG);
// Real-time data
QuoteCapitalFlowRequest intradayRequest = QuoteCapitalFlowRequest.newRequest(
  "AAPL", Market.US, CapitalPeriod.intraday);
QuoteCapitalFlowResponse intradayResponse = client.execute(intradayRequest);
if (intradayResponse.isSuccess()) {
  System.out.println(JSONObject.toJSON(intradayResponse.getCapitalFlowItem()));
} else {
  System.out.println("response error:" + intradayResponse.getMessage());
}

// Last 10 days capital net inflow data
QuoteCapitalFlowRequest dailyRequest = QuoteCapitalFlowRequest.newRequest(
  "00700", Market.HK, CapitalPeriod.day);
dailyRequest.setLimit(10);
QuoteCapitalFlowResponse dailyResponse = client.execute(dailyRequest);
if (dailyResponse.isSuccess()) {
  System.out.println(JSONObject.toJSON(dailyResponse.getCapitalFlowItem()));
} else {
  System.out.println("response error:" + dailyResponse.getMessage());
}

Example Response

// 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
    }
  ]
}

Rate Limit

The base rate limit is 60 requests/min.


Get Stock Capital Distribution

Request class: QuoteCapitalDistributionRequest

Description

Get stock capital distribution.

Parameters

ParameterTypeRequiredDescription
symbolstringYesStock symbol
marketstringYesUS for US stocks, HK for Hong Kong stocks, CN for A-shares
langstringNoLanguage 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:

FieldTypeDescription
symbolstringStock symbol
netInflowdoubleNet inflow amount (total inflow - total outflow), negative number indicates outflow
inAlldoubleTotal inflow amount (large + medium + small orders)
inBigdoubleLarge order inflow
inMiddoubleMedium order inflow
inSmalldoubleSmall order inflow
outAlldoubleTotal outflow amount (large + medium + small orders)
outBigdoubleLarge order outflow
outMiddoubleMedium order outflow
outSmalldoubleSmall 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());
}

Example Response

{
  "inBig": 721190520,
  "netInflow": 481406280,
  "symbol": "00700",
  "outBig": 464624440,
  "outAll": 3639820460,
  "inAll": 4121226740,
  "inMid": 604918520,
  "inSmall": 2795117700,
  "outMid": 572017220,
  "outSmall": 2603178800
}

Rate Limit

The base rate limit is 60 requests/min.


Get HK Broker Trading Seats

Request class: QuoteStockBrokerRequest

Description

Get Hong Kong broker buy/sell seats.

Parameters

ParameterTypeRequiredDescription
symbolstringYesStock symbol
limitintegerNoNumber 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
langstringNoLanguage 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:

FieldTypeDescription
symbolstringStock symbol
bidBrokerarrayBuy side different price level arrays, fields refer to LevelBroker description
askBrokerarraySell side different price level arrays, fields refer to LevelBroker description

Where LevelBroker properties are as follows:

FieldTypeDescription
levelintegerPrice level
pricedoublePrice
brokerCountintegerNumber of seats
brokerarrayBroker buy/sell seat list

Each broker element is a Broker object:

FieldTypeDescription
idStringBroker ID
nameStringBroker name

Example

TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
      ClientConfig.DEFAULT_CONFIG);

QuoteStockBrokerRequest request = QuoteStockBrokerRequest.newRequest("00700", 10, Language.en_US);
QuoteStockBrokerResponse response = client.execute(request);
if (response.isSuccess()) {
  System.out.println(JSONObject.toJSON(response.getStockBrokerItem()));
} else {
  System.out.println("response error:" + response.getMessage());
}

Example Response

{
    "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"
                }
            ]
        }
    ]
}

Rate Limit

The base rate limit is 60 requests/min.


Get Market Value of HK Broker Holdings

Request class: QuoteBrokerHoldRequest

Description

Get Hong Kong stock broker holdings market value.

Parameters

ParameterTypeRequiredDescription
marketMarketYesCommon market enum values: only supports HK for Hong Kong stocks. For enum values see: Market Enum
limitIntegerNoRecords 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
pageIntegerNoPage number, starting from 0, default 0
orderByStringNoSort field, default marketValue, optional values marketValue/sharesHold/buyAmount/buyAmount5/buyAmount20/buyAmount60
directionStringNoSort direction, DESC descending / ASC ascending, default DESC
langLanguageNoLanguage 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(), which returns a BrokerHoldPageItem page wrapper:

FieldTypeDescription
pageIntegerCurrent page
totalPageIntegerTotal pages
totalCountIntegerTotal records
itemsList<BrokerHoldItem>Holdings on the current page

Each BrokerHoldItem has the following properties:

FieldTypeDescription
orgIdStringBroker ID
orgNameStringBroker name
dateStringLatest trading day
sharesHoldLongHoldings quantity
marketValueDoubleHoldings market value
buyAmountLong1-day net buying
buyAmount5Long5-day net buying
buyAmount20Long20-day net buying
buyAmount60Long60-day net buying
marketStringMarket

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());
}

Example Response

{
  "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
}

Rate Limit

The base rate limit is 10 requests/min.


Popular Trading Rankings

Request class: QuoteTradeRankRequest

Description

Get stock hot trading rankings, data is updated approximately every 20 seconds.

Parameters

ParameterTypeRequiredDescription
marketMarketYesMarket, optional values: Market.US for US stocks, Market.HK for Hong Kong stocks, Market.SG for Singapore stocks
langstringNoLanguage, 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.getItems() method, returning TradeRankItem objects, where com.tigerbrokers.stock.openapi.client.https.domain.quote.item.TradeRankItem properties are as follows:

FieldTypeDescription
symbolstringStock symbol
namestringStock name
marketstringMarket
secTypestringSecurity type
changeRatedoubleIntraday change rate, if currently not in intraday trading session, then it's the previous trading day's intraday change rate
sellOrderRatedoubleSell 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
buyOrderRatedoubleBuy order ratio, calculation method same as above
hourTradingobjectPre-market and after-hours trading information
hourTrading.tradingStatusintegerPre-market and after-hours trading status
hourTrading.changeRatedoubleLatest pre-market or after-hours change rate

The Java SDK's TradeRankHourTradingItem does not expose a tradeSession field.

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.getItems()));
} else {
  System.out.println("response error:" + response.getMessage());
}

Example Response

[
  {
    "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"
  }
]


Rate Limit

The base rate limit is 10 requests/min.


Did this page help you?