Stocks

About 14 min

Get Market Status

Description

Get the maket status of a queried market, and get the most recent open time of this market

Argument

ArgumentTypeRequiredDescription
marketstringYesUS-U.S. Stocks,HK-Hongkong Stocks,CN-A-Shares, ALL-all markets
langstringNoLanguage: zh_CN,zh_TW,en_US, By default: en_US

Response

TigerOpenAPI.Quote.Response.MarketStateResponsesourceopen in new window

Structured as follows:

namespace TigerOpenAPI.Quote.Response
{
  public class MarketStateResponse : TigerResponse
  {
    [JsonProperty(PropertyName = "data")]
    public List<MarketState> Data { get; set; }

    public MarketStateResponse()
    {
    }
  }
}

Use MarketStateResponse.Data, acutal data returned is a list of MarketState. TigerOpenAPI.Quote.Response.MarketState has the following attributes:

NameTypeDescription
marketstringname of the Market being queried(US, CN, HK, etc.)
marketStatusstringMarket Status, not a constant. This information includes holidays
statusstringMarket Status, NOT_YET_OPEN,PRE_HOUR_TRADING, TRADING,MIDDLE_CLOSE,POST_HOUR_TRADING, CLOSING,EARLY_CLOSED, MARKET_CLOSED
openTimestringMost recent future open time MM-dd HH:mm:ss

Use properties of MarketState, in this case, response.Data[0].Market, to acess the data. or use JsonConvert.SerializeObject() to convert the data to a string

Example

  static async Task<MarketStateResponse?> GetMarketStateAsync(QuoteClient quoteClient)
  {
    TigerRequest<MarketStateResponse> request = new TigerRequest<MarketStateResponse>()
    {
      ApiMethodName = QuoteApiService.MARKET_STATE,
      ModelValue = new QuoteMarketModel() { Market = Market.HK }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data":[
        {
            "market":"HK",
            "marketStatus":"Closed",
            "status":"CLOSING",
            "openTime":"03-06 09:30:00"
        }
    ],
    "code":0,
    "message":"success",
    "timestamp":1677833217955,
    "sign":"Y9da7t9sJBAJ6yyawjLtsDw2Om7dn3NYANXzhSKBpzZfyjCGlVk50GDKYUnQfmODnMlDfb+0kxn2/ePUsLNDFn3N7mRJ/VPBTrKUrEcrAxBUDZZMltYsJQJoTGTnYLiaQHH1j63Jza4jFsZenH2mR+qllQp5kMf6afnZmtJecNI="
}

Get Trading Calendar

Description

The trading day is obtained by excluding weekends and holidays from the natural day and does not exclude temporary market closures

Argument

ArgumentTypeRequiredDescription
marketMarketYesfilter by market, you can use the enums defined in Market, such as Market.US, Market.HK, Market.CN
begin_datestringNobegin date of calendar,include this day. format yyyy-MM-dd, like '2022-06-01'
end_datestringNoend date of calendar,exclude this day. format yyyy-MM-dd

begin_time and end_time arguments' description:

begin_time is passedend_time is passeddescription
yesyesbegin_time, end_time are the values passed
yesnoend_time is 365 days after begin_time
noyesbegin_time is 365 days before end_time
nonobegin_time is the current date, end_time is 30 days after begin_time

Response

TigerOpenAPI.Quote.Response.TradeCalendarResponsesourceopen in new window

Structured as follows:

namespace TigerOpenAPI.Quote.Response
{
  public class TradeCalendarResponse : TigerResponse
  {
    [JsonProperty(PropertyName = "data")]
    public List<TradeCalendar> Data { get; set; }

    public TradeCalendarResponse()
    {
    }
  }
}

Use TradeCalendarResponse.Data, acutal data returned is a list of TradeCalendar. TigerOpenAPI.Quote.Response.TradeCalendar has the following attributes:

NameTypeDescription
datestringtrade day date
typestringtrade day type. TRADING: whole day trading; EARLY_CLOSE: close market early

Example

  static async Task<TigerListResponse?> GetTradingCalendarAsync(QuoteClient quoteClient)
  {
    TigerRequest<TigerListResponse> request = new TigerRequest<TigerListResponse>()
    {
      ApiMethodName = QuoteApiService.TRADING_CALENDAR,
      ModelValue = new TradeCalendarModel() {
        Market = Market.HK,
        BeginDate = "2023-03-01",
        EndDate = "2023-03-15"
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data":[
        {
            "date":"2023-03-01",
            "type":"TRADING"
        },
        {
            "date":"2023-03-02",
            "type":"TRADING"
        },
        {
            "date":"2023-03-03",
            "type":"TRADING"
        },
        {
            "date":"2023-03-06",
            "type":"TRADING"
        },
        {
            "date":"2023-03-07",
            "type":"TRADING"
        },
        {
            "date":"2023-03-08",
            "type":"TRADING"
        },
        {
            "date":"2023-03-09",
            "type":"TRADING"
        },
        {
            "date":"2023-03-10",
            "type":"TRADING"
        },
        {
            "date":"2023-03-13",
            "type":"TRADING"
        },
        {
            "date":"2023-03-14",
            "type":"TRADING"
        }
    ],
    "code":0,
    "message":"success",
    "timestamp":1677835312347,
    "sign":"trVsnYxqe9Ygp+vaFjQHb8oTgzYbOh6uou8fvgWM+58DUH8lnEDxd0xC6gqsjMMqVOKTiGS/j/+hkKYZ0Cyf7QEiV0ZULYYdAgMub1GWlLQLoNf3ML17Sy1OtNne/QC0tLOH+BfLltOCeNOfnwPECYJ5akmrjrtMy7a1ti6EXCE="
}

Get Symbol List

Description

Get a list of all symbols filtered by market

Argument

ArgumentTypeRequiredDescription
marketstringYesUS, HK, CN
include_otcbooleanNoWhether to include OTC symbols, default: false
langstringNoLanguage: zh_CN,zh_TW,en_US. en_US by default

Response

TigerOpenAPI.Model.TigerListStringResponsesourceopen in new window

Structured as follows

namespace TigerOpenAPI.Model
{
  public class TigerListStringResponse : TigerResponse
  {
    [JsonProperty(PropertyName = "data")]
    public List<string> Data { get; set; }

    public TigerListStringResponse()
    {
    }
  }
}

Use TigerListStringResponse.Data to get the data returned from the server. The result is a list that contains the stock symbols

Example

  static async Task<TigerListStringResponse?> GetAllSymbolsAsync(QuoteClient quoteClient)
  {
    TigerRequest<TigerListStringResponse> request = new TigerRequest<TigerListStringResponse>()
    {
      ApiMethodName = QuoteApiService.ALL_SYMBOLS,
      ModelValue = new QuoteMarketModel() { Market = Market.US, IncludeOTC = false }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Return Example

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

Get Symbols and Names

Description

Get the ticker symbols and names of all securities in the selected market

Argument

ArgumentTypeRequiredDescription
marketstringYesUS, HK, CN
include_otcbooleanNoWhether to include OTC symbols, default: false
langstringNoLanguage: zh_CN,zh_TW,en_US, en_US by default

Response

TigerOpenAPI.Quote.Response.SymbolNameResponsesourceopen in new window

Structured as follows

namespace TigerOpenAPI.Quote.Response
{
  public class SymbolNameResponse : TigerResponse
  {
    [JsonProperty(PropertyName = "data")]
    public List<SymbolNameItem> Data { get; set; }

    public SymbolNameResponse()
    {
    }
  }
}

Use SymbolNameResponse.Data to acess the data. The return of this method is a list of SymbolNameItem objects, where TigerOpenAPI.Quote.Response.SymbolNameItem has the following attributes:

NameTypeDescription
namestringName
symbolstringSymbol

To access the data in SymbolNameItem object, one can use response.Data[0].Name property, or use JsonConvert.SerializeObject() method to convert the data to a string

Example

  static async Task<SymbolNameResponse?> GetAllSymbolNamesAsync(QuoteClient quoteClient)
  {
    TigerRequest<SymbolNameResponse> request = new TigerRequest<SymbolNameResponse>()
    {
      ApiMethodName = QuoteApiService.ALL_SYMBOL_NAMES,
      ModelValue = new QuoteMarketModel() { Market = Market.HK, Lang = Language.en_US, IncludeOTC = false }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

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

Get Delayed Data

Description

Get delayed market data for U.S. stocks. An active market data permission subscription is not required. This data is only available for U.S stocks. The data is delayed by 15 minutes

Argument

ArgumentTypeRequiredDescription
symbolsarrayYesStock ticker symbols, U.S. stock only

Example

  static async Task<TigerListResponse?> GetDelayQuoteAsync(QuoteClient quoteClient)
  {
    TigerRequest<TigerListResponse> request = new TigerRequest<TigerListResponse>()
    {
      ApiMethodName = QuoteApiService.QUOTE_DELAY,
      ModelValue = new QuoteSymbolModel() { Symbols = new List<string> { "AAPL" } }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response

TigerOpenAPI.Quote.Response.QuoteDelayResponsesourceopen in new window

Structured as follows:

namespace TigerOpenAPI.Quote.Response
{
  public class QuoteDelayResponse : TigerResponse
  {
    [JsonProperty(PropertyName = "data")]
    public List<QuoteDelayItem> Data { get; set; }
  }
}

Use QuoteDelayResponse.Data to access the data. This method will return a list of QuoteDelayItem objects, whereTigerOpenAPI.Quote.Response.QuoteDelayIte has the following attributes:

ArgumentTypeDescription
closedoubleclose price
highdoublehigh price
lowdoublelow price
opendoubleopening price
preClosedoubleclose price of the last trading day
timelongtime
volumelongvolume

Use the properter, such as response.Data[0].Close , to access the properties in QuoteDelayItem

Response Example

{
    "data":[
        {
            "symbol":"AAPL",
            "open":144.38,
            "high":146.71,
            "low":143.9,
            "close":145.91,
            "preClose":145.31,
            "halted":0,
            "volume":52279761,
            "time":1677790800000
        }
    ],
    "code":0,
    "message":"success",
    "timestamp":1677848610005,
    "sign":"dvJVX8cPx8M4l+D5IGAxsQui4lZ0SqfTv735wa+k6sMy288Cl1vLjJKieoggAliI5ac2qDkPGnY4jPjSig2+fNErHfZneLAS6bVE0esVvfn9qcB3OS8OBGzlQwnwBc0zcm7x3npKmMsc6TIpojkqw4prstzlKZO6eRNEsN60ME4="
}

Get Timeline Data

Description

Get timeline data

Argument

ArgumentTypeRequiredDescription
symbolsarrayYesAn array of stock ticker symbols
periodstringYesperiod. 'day' or 'day5'
trade_sessionStringNoTradeSession:PreMarket,Regular,AfterHours; Regular by default
begin_timelongNoBegin time (timestamp in ms), default value is to return the data starting from today
langstringNoLangauge: zh_CN,zh_TW,en_US. en_US by default

Response

TigerOpenAPI.Quote.Response.QuoteTimelineResponsesourceopen in new window

structured as follows:

The returned data can be accessed with QuoteTimelineResponse.Data. This property will return a list of TimelineItem objects, where TigerOpenAPI.Quote.Response.TimelineItem has the following attributes:

NameTypeDescription
symbolstringTicker symbol of the stocks
periodstringperiod, day or 5day
preClosedoubleclose price of the last trading day
intradayobjectintraday data, see below for contained data fields
preMarketobject(U.S. Stocks Only) pre-market data object
afterHoursobject(U.S. Stocks Only) after-market data object
Use corresponding get method, such as getSymbol() to access data in TimelineItem

intraday:

NameDescription
volumeVolume
avgPriceaverage price
pricelast price
timetimestamp of the strating time of the minute

Example

  static async Task<QuoteTimelineResponse?> GetTimelineAsync(QuoteClient quoteClient)
  {
    TigerRequest<QuoteTimelineResponse> request = new TigerRequest<QuoteTimelineResponse>()
    {
      ApiMethodName = QuoteApiService.TIMELINE,
      ModelValue = new QuoteTimelineModel()
      {
        Symbols = new List<string> { "AAPL" },
        Period = TimeLineType.day,
        TradeSession = TradeSession.Regular.ToString(),
        BeginTime = DateUtil.ConvertTimestamp("2023-03-03 03:00:00", CustomTimeZone.NY_ZONE)
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data":[
        {
            "symbol":"AAPL",
            "period":"day",
            "preClose":145.91000366210938,
            "intraday":{
                "items":[
                    {
                        "price":147.6432,
                        "avgPrice":147.89961,
                        "volume":1233166,
                        "time":1677853800000
                    },
                    {
                        "price":147.64,
                        "avgPrice":147.87505,
                        "volume":346545,
                        "time":1677853860000
                    },
                    {
                        "price":147.9377,
                        "avgPrice":147.8773,
                        "volume":406248,
                        "time":1677853920000
                    },
                    {
                        "price":148.1899,
                        "avgPrice":147.89348,
                        "volume":279532,
                        "time":1677853980000
                    }
                ],
                "beginTime":1677830400000,
                "endTime":1677877140000
            },
            "preMarket":null,
            "afterHours":null
        }
    ],
    "code":0,
    "message":"success",
    "timestamp":1678020675510,
    "sign":"BwyUekDkekIaBCYIFaUPt0x4V7okT2Sb4UbahUgHQNk/NabZksBPdWarGmBIefDczJct8q+6Ym8If2zYe3fkWlMv/12aih6fm233BlP7tsjc+Zx93J7ozurK2Cgtpl8HWTUUwRRhao+NdIB/2UoCv0C3WmpGXtRYZ4mIJmFy54k="
}

Get History Timeline Data

Description

Get history timeline data

Argument

ArgumentTypeRequiredDescription
symbolsarrayYesAn array of stock ticker symbols
datestringYesdate, formate: yyyyMMdd
rightRightOptionNobr/nr, default is br

Response

TigerOpenAPI.Quote.Response.QuoteHistoryTimelineResponsesourceopen in new window

structured as follows:

The returned data can be accessed with QuoteHistoryTimelineResponse.Data. This property will return a list of HistoryTimelineItem objects, where TigerOpenAPI.Quote.Response.HistoryTimelineItem has the following attributes:

NameTypeDescription
symbolstringTicker symbol of the stocks
itemsTimelinePointtimeline point data

TimelinePoint:

NameDescription
volumeVolume
avgPriceaverage price
pricelast price
timetimestamp of the strating time of the minute

Example

  static async Task<QuoteHistoryTimelineResponse?> GetHistoryTimelineAsync(QuoteClient quoteClient)
  {
    TigerRequest<QuoteHistoryTimelineResponse> request = new TigerRequest<QuoteHistoryTimelineResponse>()
    {
      ApiMethodName = QuoteApiService.HISTORY_TIMELINE,
      ModelValue = new QuoteHistoryTimelineModel()
      {
        Symbols = new List<string> { "AAPL" },
        Date = "2023-03-03",
        Rigth = RightOption.br
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data":[
        {
            "symbol":"AAPL",
            "items":[
                {
                    "price":147.63,
                    "avgPrice":147.59154,
                    "volume":379709,
                    "time":1677853800000
                },
                {
                    "price":147.64,
                    "avgPrice":147.62659,
                    "volume":185673,
                    "time":1677853860000
                },
                // ......
                {
                    "price":151.03,
                    "avgPrice":149.61783,
                    "volume":310667,
                    "time":1677877080000
                },
                {
                    "price":151.03,
                    "avgPrice":149.62384,
                    "volume":9627407,
                    "time":1677877140000
                }
            ]
        }
    ],
    "code":0,
    "message":"success",
    "timestamp":1678022489149,
    "sign":"ic+gOTQqv51pYiqbHril8WLXySNMmTKDRhVjhGTSogYrxB94IF+4ETUM/wmm7nO+4/6fSSa++Ayyn8xdFyfxWhtVLNsor439y40bvC4Nsm0m6V8kk65c3DUhZQZS++1oEldVzrXSrIKEi6wiMiX4cqwJOvwd5fTQ+7TgpbGSIvI="
}

Get Realtime Quote

Description

Get real-time data for a stock/stocks. An active market quote permission is required.

Argument

ArgumentTypeRequiredDescription
symbolsarrayYeslist of stock ticker symbols (maximum 50 per request)
includeHourTradingBooleanNoWhether to include U.S. stocks before and after the market data, default: false
langstringNolanguage: zh_CN,zh_TW,en_US. en_US by default

Response

TigerOpenAPI.Quote.Response.QuoteRealTimeQuoteResponsesourceopen in new window

Use QuoteRealTimeQuoteResponse.Data to access data. The property returns a RealTimeQuoteItem object,where TigerOpenAPI.Quote.Response.RealTimeQuoteItem has the following attributes:

NameTypeDescription
symbolstringstock ticker symbol
opendoubleopening price
highdoublehigh price
lowdoublelow price
closedoubleclose price
preClosedoubleclose price of last trading day
latestPricedoublelast price
latestTimelonglatest trade time
askPricedoubleask price
askSizelongask size
bidPricedoublebid price
bidSizelongbid size
volumelongvolume
statusstringstatus
hourTradingobjectU.S. stocks pre-market and post-market data(Response hourTrading only before and after the market time)

hourTrading has the following attributes:

NameTypeDescription
tagstringpre-market("Pre-Mkt")、post-market("Post-Mkt") tag
latestPricedoublelast price
preClosedoubleclose price of the last trading day
latestTimestringlatest trade time
volumelongtrading volume
timestamplonglatest trade time in timestamp(ms)

Use the property, RealTimeQuoteItem.Symbol to access the actual data

Example

  static async Task<QuoteRealTimeQuoteResponse?> GetRealTimeQuoteAsync(QuoteClient quoteClient)
  {
    TigerRequest<QuoteRealTimeQuoteResponse> request = new TigerRequest<QuoteRealTimeQuoteResponse>()
    {
      ApiMethodName = QuoteApiService.QUOTE_REAL_TIME,
      ModelValue = new QuoteSymbolModel()
      {
        Symbols = new List<string> { "AAPL" },
        IncludeHourTrading = true
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data":[
        {
            "symbol":"AAPL",
            "open":148.045,
            "high":151.11,
            "low":147.33,
            "close":151.03,
            "preClose":145.91,
            "latestPrice":151.03,
            "askPrice":0,
            "askSize":0,
            "bidPrice":0,
            "bidSize":0,
            "volume":69933182,
            "latestTime":1677877200000,
            "status":"NORMAL",
            "hourTrading":{
                "tag":"Post-Mkt",
                "latestPrice":151.42,
                "preClose":151.03,
                "latestTime":"19:59 EST",
                "volume":3774373,
                "timestamp":1677891598858
            }
        }
    ],
    "code":0,
    "message":"success",
    "timestamp":1678025982737,
    "sign":"TrET7dNWCsGjc08Sq0U4DMxiozQnZEx8FHboLSx92Gwqhf3yXHw6rCPiYd2lehYTs/gIHcGiGOjwZB5upZ52rzwAPBgPrFguCbHr3icKJm+bObQZvzQ+CBRkkCQvsO/DIyBRJDXjAmuGc9WNSbO164JBmS/R4hA3wa6l5Qck20A="
}

Get Bars

Description

Get K-line (bar) Data, including different time periods, such as daily, weekly, minute, etc.

Argument

ArgumentTypeRequiredDescription
symbolsarrayYesA list of symbols. Maximum 50 per request, 10 for A-Shares
periodstringYesK line period, possible values are: day, week, month, year, 1min, 3min, 5min, 15min, 30min, 60min, 120min, 240min
rightstringNoAdjuestment type. Default value is forward adjustment. br: forward adjust,nr: No adjustment
begin_timelongNoBegin time. Unix time stamp in millisecond or a date string. Example: 1639371600000, default value is -1, which means unbounded.
end_timelongNoEnd time. Unix time stamp in millisecond or a date string. Example: 1639371600000, default value is -1, which means unbounded.
limitintegerNoThe maximum number of bars returned. Default value is 300. Maximum is 1200
langstringNoLanguage: zh_CN,zh_TW,en_US. en_US by default

Response

TigerOpenAPI.Quote.Response.QuoteKlineResponsesourceopen in new window

Use QuoteKlineResponse.Data to access the data. This method returns a KlineItem object, where TigerOpenAPI.Quote.Response.QuoteKlineItem has the following attributes :

NameTypeDescription
symbolstringSymbol
periodstringK-line period
nextPageTokenstringToken that can be used to query the next page
itemsarrayarray that contains the acutal data

items has the following attributes:

NameTypeDescription
closedoubleclose price
highdoublehigh price
lowdoublelow price
opendoubleopen price
timelongtime
volumelongvolume
amountdoubletrading amount

Use the property QuoteKlineItem.Symbol to acess the actual data

Example

  static async Task<QuoteKlineResponse?> GetKLineAsync(QuoteClient quoteClient)
  {
    TigerRequest<QuoteKlineResponse> request = new TigerRequest<QuoteKlineResponse>()
    {
      ApiMethodName = QuoteApiService.KLINE,
      ModelValue = new QuoteKlineModel()
      {
        Symbols = new List<string> { "AAPL" },
        Period = KLineType.day.Value,
        BeginTime = DateUtil.ConvertTimestamp("2023-03-01", CustomTimeZone.NY_ZONE),
        EndTime = DateUtil.CurrentTimeMillis(),
        Rigth = RightOption.br
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data":[
        {
            "symbol":"AAPL",
            "period":"day",
            "nextPageToken":null,
            "items":[
                {
                    "open":146.83,
                    "high":147.2285,
                    "low":145.01,
                    "close":145.31,
                    "volume":55478991,
                    "amount":7978231154.30112,
                    "time":1677646800000
                },
                {
                    "open":144.38,
                    "high":146.71,
                    "low":143.9,
                    "close":145.91,
                    "volume":52279761,
                    "amount":7562022394.142693,
                    "time":1677733200000
                },
                {
                    "open":148.045,
                    "high":151.11,
                    "low":147.33,
                    "close":151.03,
                    "volume":69935182,
                    "amount":10492713141.015995,
                    "time":1677819600000
                }
            ]
        }
    ],
    "code":0,
    "message":"success",
    "timestamp":1678027621172,
    "sign":"c+ArPr2a7AQt5c/gR12AoLqMS+sjDMQuqV9pfez9foyhtxRew8KxQ/YhRUHbwgbkrmfV17/3WQlcB/8hHYSWEJ4i/erQCxpfXS+jngegzO1A0BOJB+7HyEQ7alFNOBtm/0zpPfcEBQyvKLDPsM/ChaBg5wzAOMbwUNYuNsDXBYo="
}

Get Market Depth Quote

Get market depth quote, including price, quantity and number of orders, Request limit is 50 symbols per request

CAUTION

The closing auction time of Hong Kong stocks is 16:00-16:10 (the market closes randomly between 16:08 and 16:10), and the last ask-bid data is generally delayed to update one or two minutes after 16:10

Argument

ArgumentTypeRequiredDescription
symbolsarrayYesSymbols, maximum number supported is 50
marketstringYesUS, HK, CN, ALL

Response

TigerOpenAPI.Quote.Response.QuoteDepthResponsesourceopen in new window

Structured as follows:

namespace TigerOpenAPI.Quote.Response
{
  public class QuoteDepthResponse : TigerResponse
  {
    [JsonProperty(PropertyName = "data")]
    public List<QuoteDepthItem> Data { get; set; }

  }
}

Use QuoteDepthResponse.Datato access the response. The data is contained in QuoteDepthItem objects,TigerOpenAPI.Quote.Response.QuoteDepthItem has the following attributes:

NameTypeDescription
symbolStringsymbol
askslistsell order data
bidslistbuying order data

asks/bids data as follows:

NameTypeDescription
pricedoubleprice
volumelongvolume
countintnumber of orders(only supports Hong Kong market )

Example

  static async Task<QuoteDepthResponse?> GetDepthQuoteAsync(QuoteClient quoteClient)
  {
    TigerRequest<QuoteDepthResponse> request = new TigerRequest<QuoteDepthResponse>()
    {
      ApiMethodName = QuoteApiService.QUOTE_DEPTH,
      ModelValue = new QuoteDepthModel()
      {
        Symbols = new List<string> { "AAPL" },
        Market = Market.US
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data":[
        {
            "symbol":"AAPL",
            "asks":[
                {
                    "price":151.5,
                    "volume":50,
                    "count":0
                },
                {
                    "price":151.5,
                    "volume":30,
                    "count":0
                },
                {
                    "price":151.75,
                    "volume":50,
                    "count":0
                },
                {
                    "price":152,
                    "volume":100,
                    "count":0
                },
                {
                    "price":152,
                    "volume":1,
                    "count":0
                },
                {
                    "price":152,
                    "volume":50,
                    "count":0
                },
                {
                    "price":152,
                    "volume":6,
                    "count":0
                },
                {
                    "price":152,
                    "volume":110,
                    "count":0
                },
                {
                    "price":152.02,
                    "volume":10,
                    "count":0
                },
                {
                    "price":152.12,
                    "volume":3,
                    "count":0
                },
                {
                    "price":152.2,
                    "volume":1,
                    "count":0
                },
                {
                    "price":152.25,
                    "volume":50,
                    "count":0
                },
                {
                    "price":152.25,
                    "volume":2,
                    "count":0
                },
                {
                    "price":152.48,
                    "volume":7,
                    "count":0
                },
                {
                    "price":152.48,
                    "volume":65,
                    "count":0
                },
                {
                    "price":152.5,
                    "volume":20,
                    "count":0
                },
                {
                    "price":152.5,
                    "volume":300,
                    "count":0
                },
                {
                    "price":152.5,
                    "volume":50,
                    "count":0
                },
                {
                    "price":152.52,
                    "volume":70,
                    "count":0
                },
                {
                    "price":152.56,
                    "volume":10,
                    "count":0
                },
                {
                    "price":152.79,
                    "volume":30,
                    "count":0
                },
                {
                    "price":153,
                    "volume":3000,
                    "count":0
                },
                {
                    "price":153,
                    "volume":200,
                    "count":0
                },
                {
                    "price":153,
                    "volume":34,
                    "count":0
                },
                {
                    "price":153.2,
                    "volume":20,
                    "count":0
                },
                {
                    "price":153.25,
                    "volume":5,
                    "count":0
                },
                {
                    "price":153.7,
                    "volume":3000,
                    "count":0
                },
                {
                    "price":153.89,
                    "volume":5,
                    "count":0
                },
                {
                    "price":154.61,
                    "volume":14000,
                    "count":0
                },
                {
                    "price":154.75,
                    "volume":50,
                    "count":0
                },
                {
                    "price":154.97,
                    "volume":3,
                    "count":0
                },
                {
                    "price":155,
                    "volume":1500,
                    "count":0
                },
                {
                    "price":155,
                    "volume":2161,
                    "count":0
                },
                {
                    "price":155,
                    "volume":1,
                    "count":0
                },
                {
                    "price":155,
                    "volume":5,
                    "count":0
                },
                {
                    "price":155,
                    "volume":20,
                    "count":0
                },
                {
                    "price":155,
                    "volume":9,
                    "count":0
                },
                {
                    "price":155.02,
                    "volume":250,
                    "count":0
                },
                {
                    "price":155.87,
                    "volume":250,
                    "count":0
                },
                {
                    "price":156,
                    "volume":1415,
                    "count":0
                }
            ],
            "bids":[
                {
                    "price":151.18,
                    "volume":10,
                    "count":0
                },
                {
                    "price":151.03,
                    "volume":3,
                    "count":0
                },
                {
                    "price":151.03,
                    "volume":1,
                    "count":0
                },
                {
                    "price":151,
                    "volume":50,
                    "count":0
                },
                {
                    "price":150.97,
                    "volume":5,
                    "count":0
                },
                {
                    "price":150.88,
                    "volume":1000,
                    "count":0
                },
                {
                    "price":150.86,
                    "volume":1000,
                    "count":0
                },
                {
                    "price":150.83,
                    "volume":10,
                    "count":0
                },
                {
                    "price":150.82,
                    "volume":20,
                    "count":0
                },
                {
                    "price":150.8,
                    "volume":1,
                    "count":0
                },
                {
                    "price":150.79,
                    "volume":200,
                    "count":0
                },
                {
                    "price":150.75,
                    "volume":50,
                    "count":0
                },
                {
                    "price":150.6,
                    "volume":32,
                    "count":0
                },
                {
                    "price":150.54,
                    "volume":6,
                    "count":0
                },
                {
                    "price":150.25,
                    "volume":100,
                    "count":0
                },
                {
                    "price":150.05,
                    "volume":500,
                    "count":0
                },
                {
                    "price":150,
                    "volume":155,
                    "count":0
                },
                {
                    "price":150,
                    "volume":1100,
                    "count":0
                },
                {
                    "price":150,
                    "volume":2,
                    "count":0
                },
                {
                    "price":150,
                    "volume":100,
                    "count":0
                },
                {
                    "price":150,
                    "volume":20,
                    "count":0
                },
                {
                    "price":149.95,
                    "volume":100,
                    "count":0
                },
                {
                    "price":149.8,
                    "volume":40,
                    "count":0
                },
                {
                    "price":149.27,
                    "volume":300,
                    "count":0
                },
                {
                    "price":149.25,
                    "volume":50,
                    "count":0
                },
                {
                    "price":149.22,
                    "volume":15,
                    "count":0
                },
                {
                    "price":149,
                    "volume":50,
                    "count":0
                },
                {
                    "price":149,
                    "volume":20,
                    "count":0
                },
                {
                    "price":149,
                    "volume":500,
                    "count":0
                },
                {
                    "price":148.75,
                    "volume":50,
                    "count":0
                },
                {
                    "price":148.5,
                    "volume":50,
                    "count":0
                },
                {
                    "price":148.25,
                    "volume":50,
                    "count":0
                },
                {
                    "price":148,
                    "volume":50,
                    "count":0
                },
                {
                    "price":148,
                    "volume":18,
                    "count":0
                },
                {
                    "price":147.85,
                    "volume":250,
                    "count":0
                },
                {
                    "price":147.75,
                    "volume":50,
                    "count":0
                },
                {
                    "price":147.7,
                    "volume":1,
                    "count":0
                },
                {
                    "price":147.6,
                    "volume":200,
                    "count":0
                },
                {
                    "price":147.5,
                    "volume":50,
                    "count":0
                },
                {
                    "price":147,
                    "volume":2,
                    "count":0
                }
            ]
        }
    ],
    "code":0,
    "message":"success",
    "timestamp":1678072446460,
    "sign":"jDZcf0XeaZs/KC3N8zGghObWTo8ww9PzV4ynLJR2R/nZDDcMi+N0lJuuZI/YZu3fHCbd6EGhCr0oxs6TyjxyYCvrqNRG+NRifdL/55nOi6fUQfTwjY6Bqlidys151F5LeXAW8hy4blmag+dirZ85MjfYCd0z/eAk/kKHmPDXO+k="
}

Get Trade Ticks

Description

Get the tick data of selected stocks

Argument

ArgumentTypeRequiredDescription
symbolsarrayYesAn array of ticker symbol of a list of stocks
trade_sessionStringNoTradeSession:PreMarket,Regular,AfterHours; Regular by default
limitintegerNoMaximum number of data points, 2000 by default. Returns the number of recent deals for each symbol.
langstringNoLanguage: zh_CN,zh_TW,en_US, en_US by default

Response

TigerOpenAPI.Quote.Response.QuoteTradeTickResponsesourceopen in new window

Structured as follows:

namespace TigerOpenAPI.Quote.Response
{
  public class QuoteTradeTickResponse : TigerResponse
  {
    [JsonProperty(PropertyName = "data")]
    public List<TradeTickItem> Data { get; set; }
  }
}

Use QuoteTradeTickResponse.Data to access returned data. The method will return a TradeTickItem object,TigerOpenAPI.Quote.Response.TradeTickItem has the following attributes:

NameTypeDescription
beginIndexlongStart index of the returned data
endIndexlongEnd index of the returned data
symbolstringStock ticker symbol
itemsList<TickPoint>List contains the acutal data, a TickPoint corresponds to a data point

TickPoint has the following attributes:

NameTypeDescription
timelongTrading time
pricedoublePrice
volumelongVolume
typestringDirection of the price change, "+" stands for "active buy", "-" stands for "active sell", "*" stands for "neutral transaction"

Use the property, TickPoint.Time to access the data, or use JsonConvert.SerializeObject() method to convert the data to a string

Example

  static async Task<QuoteTradeTickResponse?> GetTradeTickAsync(QuoteClient quoteClient)
  {
    TigerRequest<QuoteTradeTickResponse> request = new TigerRequest<QuoteTradeTickResponse>()
    {
      ApiMethodName = QuoteApiService.TRADE_TICK,
      ModelValue = new QuoteTradeTickModel()
      {
        Symbols = new List<string> { "00700" },
        BeginIndex = 0,
        EndIndex = 10
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data":[
        {
            "symbol":"00700",
            "beginIndex":0,
            "endIndex":10,
            "items":[
                {
                    "price":366.6,
                    "time":1678064400047,
                    "volume":4,
                    "type":"*"
                },
                {
                    "price":373.37,
                    "time":1678064533066,
                    "volume":1,
                    "type":"*"
                },
                {
                    "price":374.8,
                    "time":1678064533066,
                    "volume":941,
                    "type":"*"
                },
                {
                    "price":374.8,
                    "time":1678064533120,
                    "volume":1081,
                    "type":"*"
                },
                {
                    "price":365.732,
                    "time":1678064704553,
                    "volume":500,
                    "type":"*"
                },
                {
                    "price":366.163,
                    "time":1678064704770,
                    "volume":200,
                    "type":"*"
                },
                {
                    "price":364,
                    "time":1678065634761,
                    "volume":200,
                    "type":"*"
                },
                {
                    "price":364,
                    "time":1678065634761,
                    "volume":600,
                    "type":"*"
                },
                {
                    "price":364,
                    "time":1678065634761,
                    "volume":100,
                    "type":"*"
                },
                {
                    "price":364,
                    "time":1678065634761,
                    "volume":200,
                    "type":"*"
                }
            ]
        }
    ],
    "code":0,
    "message":"success",
    "timestamp":1678073932004,
    "sign":"Yb90+yYB5IhAv2Sz3hbKSvdB4IsGD+C9+qgkS3lWpgrZq/EQNi3/qcXe2xJiBkSMtBsLFhuPJYu83rUdJJPtv5PiteOPFWHKRub9Z7zmtSDCfhSHPUOlCnBexW4xFWJBYUqQ8l34zhf1eeLHQhXrkcWv2zY392u+DxaiFyIIxpU="
}

Get Trading Requirement

Description

Get the required information for trading, such as lot size, for a tradable asset.

Argument

ArgumentTypeRequiredDescription
symbolsarrayYesSymbols, maximum number supported is 50

Response

TigerOpenAPI.Quote.Response.QuoteStockTradeResponsesourceopen in new window

Structured as follows:

namespace TigerOpenAPI.Quote.Response
{
  public class QuoteStockTradeResponse : TigerResponse
  {
    [JsonProperty(PropertyName = "data")]
    public List<QuoteStockTradeItem> Data { get; set; }
  }
}

Use QuoteStockTradeResponse.Datato access the response. The data is contained in QuoteStockTradeItem objects,TigerOpenAPI.Quote.Response.QuoteStockTradeItem has the following attributes:

NameTypeDescription
symbolStringsymbol
lotSizeIntegerlotsize
spreadScaleIntegertick size
minTickDoubleminimum tick

Use the property QuoteStockTradeItem.Symbol to access, or use JsonConvert.SerializeObject() method to convert the data to a string.

Example

  static async Task<QuoteStockTradeResponse?> GetStockTradeInfoAsync(QuoteClient quoteClient)
  {
    TigerRequest<QuoteStockTradeResponse> request = new TigerRequest<QuoteStockTradeResponse>()
    {
      ApiMethodName = QuoteApiService.QUOTE_STOCK_TRADE,
      ModelValue = new QuoteStockTradeModel()
      {
        Symbols = new List<string> { "AAPL", "TSLA" }
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data":[
        {
            "symbol":"AAPL",
            "lotSize":1,
            "spreadScale":1,
            "minTick":0.01
        },
        {
            "symbol":"TSLA",
            "lotSize":1,
            "spreadScale":1,
            "minTick":0.01
        }
    ],
    "code":0,
    "message":"success",
    "timestamp":1678085243684,
    "sign":"fBAjMdmHGwtnMy0Uc8Zmo4Rp6E/jUCrsrc9gFRNEQYkGyrnYfiKk7n+4/ABg9rSt/MFcyfwjwCXU3n5pCNfQjMWhB0LUgiPFDkHATyNcxA/glFlzJEXgYDb2Eauy8A94zx72NlUdr53li/fTLdl31/gW6O0ltmesWaF2je20l6s="
}

Get Capital Flow

Description

Get capital net inflow Data, including different time periods, such as daily, weekly, monthly, etc.

Argument

ArgumentTypeRequiredDescription
symbolstringYessymbol
periodstringYesperiod, possible values are: intraday, day, week, month, year, quarter, 6month
marketstringYesUS-U.S. Stocks, HK-Hongkong Stocks, CN-A-Shares
begin_timelongNoBegin time. Unix time stamp in millisecond or a date string. Example: 1639371600000, default value is -1, which means unbounded.
end_timelongNoEnd time. Unix time stamp in millisecond or a date string. Example: 1639371600000, default value is -1, which means unbounded.
limitintegerNoThe maximum number of points returned. Default value is 200. Maximum is 1200
langstringNoLanguage: zh_CN,zh_TW,en_US. en_US by default

Response

TigerOpenAPI.Quote.Response.QuoteCapitalFlowResponsesourceopen in new window

Use QuoteCapitalFlowResponse.Data to access the data. This method returns a CapitalFlowItem object, where TigerOpenAPI.Quote.Response.CapitalFlowItem has the following attributes :

NameTypeDescription
symbolstringsymbol
periodstringcapital period
itemsarrayarray that contains the capital flow data

items has the following attributes:

NameTypeDescription
netInflowdoublenet inflow
timestringtime, "11-25 12:48:00 EST"
timestamplongtimestamp

Example

  static async Task<QuoteCapitalFlowResponse?> GetStockCaptialFlowAsync(QuoteClient quoteClient)
  {
    TigerRequest<QuoteCapitalFlowResponse> request = new TigerRequest<QuoteCapitalFlowResponse>()
    {
      ApiMethodName = QuoteApiService.CAPITAL_FLOW,
      ModelValue = new QuoteCapitalFlowModel()
      {
        Symbol = "AAPL",
        Market = Market.US,
        Period = CapitalPeriod.day.Value,
        BeginTime = DateUtil.ConvertTimestamp("2023-02-25", CustomTimeZone.NY_ZONE),
        EndTime = DateUtil.ConvertTimestamp("2023-03-06", CustomTimeZone.NY_ZONE)
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data":{
        "symbol":"AAPL",
        "period":"day",
        "items":[
            {
                "time":"2023-02-27",
                "timestamp":1677474000000,
                "netInflow":-288999272.76
            },
            {
                "time":"2023-02-28",
                "timestamp":1677560400000,
                "netInflow":-346622305.07
            },
            {
                "time":"2023-03-01",
                "timestamp":1677646800000,
                "netInflow":-174423081.65
            },
            {
                "time":"2023-03-02",
                "timestamp":1677733200000,
                "netInflow":-41739535.19
            },
            {
                "time":"2023-03-03",
                "timestamp":1677819600000,
                "netInflow":-41875734.65
            }
        ]
    },
    "code":0,
    "message":"success",
    "timestamp":1678086433167,
    "sign":"gP8aYcWjmajCC4ns1gc/zPpDURIZT/1zbfsAFXWi0PxhGqtwNvFvi7bPKH/fa7llQKml5ZPyspKjJTynFkyICFOBLTU0zAqBcg3vsH4CiUD1R3tugzz+ov89nuj75vUEli8IiEvTZ96KNCGel482jqnakE8JBblnibI7DRztGC4="
}

Get Capital Distribution

Description

Get capital distribution.

Argument

ArgumentTypeRequiredDescription
symbolstringYessymbol
marketstringYesUS-U.S. Stocks, HK-Hongkong Stocks, CN-A-Shares
langstringNoLanguage: zh_CN,zh_TW,en_US. en_US by default

Response

TigerOpenAPI.Quote.Response.QuoteCapitalDistributionResponsesourceopen in new window

Use QuoteCapitalDistributionResponse.Data to access the data. This property returns a CapitalDistributionItem object, where TigerOpenAPI.Quote.Response.CapitalDistributionItem has the following attributes :

NameTypeDescription
symbolstringsymbol
netInflowdoublenet inflow(inAll - outAll)
inAlldoubleall inflow(inBig + inMid + inSmall)
inBigdoublebig orders's inflow
inMiddoublemedian orders's inflow
inSmalldoublesmall orders's inflow
outAlldoubleall outflow(outBig + outMid + outSmall)
outBigdoublebig orders's outflow
outMiddoublemedian orders's outflow
outSmalldoublesmall orders's outflow

Example

  static async Task<QuoteCapitalDistributionResponse?> GetStockCaptialDistributionAsync(QuoteClient quoteClient)
  {
    TigerRequest<QuoteCapitalDistributionResponse> request = new TigerRequest<QuoteCapitalDistributionResponse>()
    {
      ApiMethodName = QuoteApiService.CAPITAL_DISTRIBUTION,
      ModelValue = new QuoteCapitalModel()
      {
        Symbol = "AAPL",
        Market = Market.US
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data":{
        "symbol":"AAPL",
        "netInflow":-41875734.65,
        "inAll":3520585989.78,
        "inBig":518600830.5749997,
        "inMid":319845745.91350037,
        "inSmall":2682139413.2889147,
        "outAll":3562461724.42,
        "outBig":393653507.9933999,
        "outMid":303140576.80540013,
        "outSmall":2865667639.6250362
    },
    "code":0,
    "message":"success",
    "timestamp":1678090250440,
    "sign":"rdlz75GgCaz/yTNgnZE38lR7k8/J5ONbemBM1j5H0r6WQqpGOmCxTsjXVtktJOXMCDltnSesljHryq8cEmBabnPlXJPRHMDj1CoNLz36oFYT1rfzBPFUp8PDXpWvT5trdGz5CV2ILEBwS3IkG3viS7oRg5/qiqXf19d9PGMQBPU="
}

Get Stock Broker

Description

Get stock broker infomation.

Argument

ArgumentTypeRequiredDescription
symbolstringYessymbol
limitintegerNoThe maximum number of points returned. Default value is 40. Maximum is 60
langstringNoLanguage: zh_CN,zh_TW,en_US. en_US by default

Response

TigerOpenAPI.Quote.Response.QuoteStockBrokerResponsesourceopen in new window

Use QuoteStockBrokerResponse.Data to access the data. This property returns a StockBrokerItem object, where TigerOpenAPI.Quote.Response.StockBrokerItem has the following attributes :

NameTypeDescription
symbolstringsymbol
bidBrokerarrayarray that contains the 'LevelBroker' data
askBrokerarrayarray that contains the 'LevelBroker' data

'LevelBroker' has the following attributes:

NameTypeDescription
levelintegerprice level
pricedoubleprice
brokerCountintegerthe count of borkers
brokerarraythe list of borkers

Example

  static async Task<QuoteStockBrokerResponse?> GetStockBrokerAsync(QuoteClient quoteClient)
  {
    TigerRequest<QuoteStockBrokerResponse> request = new TigerRequest<QuoteStockBrokerResponse>()
    {
      ApiMethodName = QuoteApiService.STOCK_BROKER,
      ModelValue = new QuoteStockBrokerModel()
      {
        Symbol = "00700",// only support HK market's symbol
        Limit = 10
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

Response Example

{
    "data":{
        "symbol":"00700",
        "bidBroker":[
            {
                "level":1,
                "price":363,
                "brokerCount":1,
                "broker":[
                    {
                        "id":"3537",
                        "name":"Citadel"
                    }
                ]
            },
            {
                "level":2,
                "price":362.8,
                "brokerCount":9,
                "broker":[
                    {
                        "id":"8302",
                        "name":"FUTU Securities"
                    },
                    {
                        "id":"9055",
                        "name":"UBS"
                    },
                    {
                        "id":"6996",
                        "name":"China Investment"
                    },
                    {
                        "id":"6997",
                        "name":"China Investment"
                    },
                    {
                        "id":"6999",
                        "name":"China Investment"
                    },
                    {
                        "id":"8949",
                        "name":"BOCI"
                    },
                    {
                        "id":"5369",
                        "name":"DBS Vickers"
                    },
                    {
                        "id":"7385",
                        "name":"Citigroup"
                    },
                    {
                        "id":"9063",
                        "name":"UBS"
                    }
                ]
            }
        ],
        "askBroker":[
            {
                "level":1,
                "price":363.2,
                "brokerCount":3,
                "broker":[
                    {
                        "id":"6997",
                        "name":"China Investment"
                    },
                    {
                        "id":"4456",
                        "name":"Barclays Asia"
                    },
                    {
                        "id":"4456",
                        "name":"Barclays Asia"
                    }
                ]
            },
            {
                "level":2,
                "price":363.4,
                "brokerCount":2,
                "broker":[
                    {
                        "id":"7386",
                        "name":"Citigroup"
                    },
                    {
                        "id":"5338",
                        "name":"J.P. Morgan"
                    }
                ]
            },
            {
                "level":3,
                "price":363.6,
                "brokerCount":3,
                "broker":[
                    {
                        "id":"6387",
                        "name":"Morgan Stanley"
                    },
                    {
                        "id":"2398",
                        "name":"KGI Asia"
                    },
                    {
                        "id":"8597",
                        "name":"KGI Asia"
                    }
                ]
            },
            {
                "level":4,
                "price":363.8,
                "brokerCount":2,
                "broker":[
                    {
                        "id":"8463",
                        "name":"FUTU Securities"
                    },
                    {
                        "id":"3436",
                        "name":"Goldman Sachs"
                    }
                ]
            }
        ]
    },
    "code":0,
    "message":"success",
    "timestamp":1678091160144,
    "sign":"FcjmxHoOE0livAqO6OPU9mOkq+08GvT6ZLJdmWT3N58QngR6qovqtcvSjmTvdKuW2STAeTqWmLdVvqgvb2pM4+/b/hv/jn0J+XyWXR5XgKOnISU/I9eXLmTdmlZ9bAFNNKL6aWJbX4Diyb6RTa0ToH+r2qBXoMEc7ZYAX3/3GGY="
}
Last update: