Stocks
Get Market Status
Description
Get the maket status of a queried market, and get the most recent open time of this market
Argument
Argument | Type | Required | Description |
---|---|---|---|
market | string | Yes | US-U.S. Stocks,HK-Hongkong Stocks,CN-A-Shares, ALL-all markets |
lang | string | No | Language: zh_CN,zh_TW,en_US, By default: en_US |
Response
TigerOpenAPI.Quote.Response.MarketStateResponse
source
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:
Name | Type | Description |
---|---|---|
market | string | name of the Market being queried(US, CN, HK, etc.) |
marketStatus | string | Market Status, not a constant. This information includes holidays |
status | string | Market Status, NOT_YET_OPEN,PRE_HOUR_TRADING, TRADING,MIDDLE_CLOSE,POST_HOUR_TRADING, CLOSING,EARLY_CLOSED, MARKET_CLOSED |
openTime | string | Most 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
Argument | Type | Required | Description |
---|---|---|---|
market | Market | Yes | filter by market, you can use the enums defined in Market, such as Market.US, Market.HK, Market.CN |
begin_date | string | No | begin date of calendar,include this day. format yyyy-MM-dd, like '2022-06-01' |
end_date | string | No | end date of calendar,exclude this day. format yyyy-MM-dd |
begin_time and end_time arguments' description:
begin_time is passed | end_time is passed | description |
---|---|---|
yes | yes | begin_time, end_time are the values passed |
yes | no | end_time is 365 days after begin_time |
no | yes | begin_time is 365 days before end_time |
no | no | begin_time is the current date, end_time is 30 days after begin_time |
Response
TigerOpenAPI.Quote.Response.TradeCalendarResponse
source
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:
Name | Type | Description |
---|---|---|
date | string | trade day date |
type | string | trade 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
Argument | Type | Required | Description |
---|---|---|---|
market | string | Yes | US, HK, CN |
include_otc | boolean | No | Whether to include OTC symbols, default: false |
lang | string | No | Language: zh_CN,zh_TW,en_US. en_US by default |
Response
TigerOpenAPI.Model.TigerListStringResponse
source
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
Argument | Type | Required | Description |
---|---|---|---|
market | string | Yes | US, HK, CN |
include_otc | boolean | No | Whether to include OTC symbols, default: false |
lang | string | No | Language: zh_CN,zh_TW,en_US, en_US by default |
Response
TigerOpenAPI.Quote.Response.SymbolNameResponse
source
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:
Name | Type | Description |
---|---|---|
name | string | Name |
symbol | string | Symbol |
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
Argument | Type | Required | Description |
---|---|---|---|
symbols | array | Yes | Stock 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.QuoteDelayResponse
source
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:
Argument | Type | Description |
---|---|---|
close | double | close price |
high | double | high price |
low | double | low price |
open | double | opening price |
preClose | double | close price of the last trading day |
time | long | time |
volume | long | volume |
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
Argument | Type | Required | Description |
---|---|---|---|
symbols | array | Yes | An array of stock ticker symbols |
period | string | Yes | period. 'day' or 'day5' |
trade_session | String | No | TradeSession:PreMarket,Regular,AfterHours; Regular by default |
begin_time | long | No | Begin time (timestamp in ms), default value is to return the data starting from today |
lang | string | No | Langauge: zh_CN,zh_TW,en_US. en_US by default |
Response
TigerOpenAPI.Quote.Response.QuoteTimelineResponse
source
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:
Name | Type | Description |
---|---|---|
symbol | string | Ticker symbol of the stocks |
period | string | period, day or 5day |
preClose | double | close price of the last trading day |
intraday | object | intraday data, see below for contained data fields |
preMarket | object | (U.S. Stocks Only) pre-market data object |
afterHours | object | (U.S. Stocks Only) after-market data object |
Use corresponding get method, such as getSymbol() to access data in TimelineItem |
intraday:
Name | Description |
---|---|
volume | Volume |
avgPrice | average price |
price | last price |
time | timestamp 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
Argument | Type | Required | Description |
---|---|---|---|
symbols | array | Yes | An array of stock ticker symbols |
date | string | Yes | date, formate: yyyyMMdd |
right | RightOption | No | br/nr, default is br |
Response
TigerOpenAPI.Quote.Response.QuoteHistoryTimelineResponse
source
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:
Name | Type | Description |
---|---|---|
symbol | string | Ticker symbol of the stocks |
items | TimelinePoint | timeline point data |
TimelinePoint:
Name | Description |
---|---|
volume | Volume |
avgPrice | average price |
price | last price |
time | timestamp 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
Argument | Type | Required | Description |
---|---|---|---|
symbols | array | Yes | list of stock ticker symbols (maximum 50 per request) |
includeHourTrading | Boolean | No | Whether to include U.S. stocks before and after the market data, default: false |
lang | string | No | language: zh_CN,zh_TW,en_US. en_US by default |
Response
TigerOpenAPI.Quote.Response.QuoteRealTimeQuoteResponse
source
Use QuoteRealTimeQuoteResponse.Data
to access data. The property returns a RealTimeQuoteItem
object,where TigerOpenAPI.Quote.Response.RealTimeQuoteItem
has the following attributes:
Name | Type | Description |
---|---|---|
symbol | string | stock ticker symbol |
open | double | opening price |
high | double | high price |
low | double | low price |
close | double | close price |
preClose | double | close price of last trading day |
latestPrice | double | last price |
latestTime | long | latest trade time |
askPrice | double | ask price |
askSize | long | ask size |
bidPrice | double | bid price |
bidSize | long | bid size |
volume | long | volume |
status | string | status |
hourTrading | object | U.S. stocks pre-market and post-market data(Response hourTrading only before and after the market time) |
hourTrading
has the following attributes:
Name | Type | Description |
---|---|---|
tag | string | pre-market("Pre-Mkt")、post-market("Post-Mkt") tag |
latestPrice | double | last price |
preClose | double | close price of the last trading day |
latestTime | string | latest trade time |
volume | long | trading volume |
timestamp | long | latest 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
Argument | Type | Required | Description |
---|---|---|---|
symbols | array | Yes | A list of symbols. Maximum 50 per request, 10 for A-Shares |
period | string | Yes | K line period, possible values are: day, week, month, year, 1min, 3min, 5min, 15min, 30min, 60min, 120min, 240min |
right | string | No | Adjuestment type. Default value is forward adjustment. br: forward adjust,nr: No adjustment |
begin_time | long | No | Begin time. Unix time stamp in millisecond or a date string. Example: 1639371600000, default value is -1, which means unbounded. |
end_time | long | No | End time. Unix time stamp in millisecond or a date string. Example: 1639371600000, default value is -1, which means unbounded. |
limit | integer | No | The maximum number of bars returned. Default value is 300. Maximum is 1200 |
lang | string | No | Language: zh_CN,zh_TW,en_US. en_US by default |
Response
TigerOpenAPI.Quote.Response.QuoteKlineResponse
source
Use QuoteKlineResponse.Data
to access the data. This method returns a KlineItem
object, where TigerOpenAPI.Quote.Response.QuoteKlineItem
has the following attributes :
Name | Type | Description |
---|---|---|
symbol | string | Symbol |
period | string | K-line period |
nextPageToken | string | Token that can be used to query the next page |
items | array | array that contains the acutal data |
items has the following attributes:
Name | Type | Description |
---|---|---|
close | double | close price |
high | double | high price |
low | double | low price |
open | double | open price |
time | long | time |
volume | long | volume |
amount | double | trading 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
Argument | Type | Required | Description |
---|---|---|---|
symbols | array | Yes | Symbols, maximum number supported is 50 |
market | string | Yes | US, HK, CN, ALL |
Response
TigerOpenAPI.Quote.Response.QuoteDepthResponse
source
Structured as follows:
namespace TigerOpenAPI.Quote.Response
{
public class QuoteDepthResponse : TigerResponse
{
[JsonProperty(PropertyName = "data")]
public List<QuoteDepthItem> Data { get; set; }
}
}
Use QuoteDepthResponse.Data
to access the response. The data is contained in QuoteDepthItem
objects,TigerOpenAPI.Quote.Response.QuoteDepthItem
has the following attributes:
Name | Type | Description |
---|---|---|
symbol | String | symbol |
asks | list | sell order data |
bids | list | buying order data |
asks/bids data as follows:
Name | Type | Description |
---|---|---|
price | double | price |
volume | long | volume |
count | int | number 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
Argument | Type | Required | Description |
---|---|---|---|
symbols | array | Yes | An array of ticker symbol of a list of stocks |
trade_session | String | No | TradeSession:PreMarket,Regular,AfterHours; Regular by default |
limit | integer | No | Maximum number of data points, 2000 by default. Returns the number of recent deals for each symbol. |
lang | string | No | Language: zh_CN,zh_TW,en_US, en_US by default |
Response
TigerOpenAPI.Quote.Response.QuoteTradeTickResponse
source
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:
Name | Type | Description |
---|---|---|
beginIndex | long | Start index of the returned data |
endIndex | long | End index of the returned data |
symbol | string | Stock ticker symbol |
items | List<TickPoint> | List contains the acutal data, a TickPoint corresponds to a data point |
TickPoint
has the following attributes:
Name | Type | Description |
---|---|---|
time | long | Trading time |
price | double | Price |
volume | long | Volume |
type | string | Direction 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
Argument | Type | Required | Description |
---|---|---|---|
symbols | array | Yes | Symbols, maximum number supported is 50 |
Response
TigerOpenAPI.Quote.Response.QuoteStockTradeResponse
source
Structured as follows:
namespace TigerOpenAPI.Quote.Response
{
public class QuoteStockTradeResponse : TigerResponse
{
[JsonProperty(PropertyName = "data")]
public List<QuoteStockTradeItem> Data { get; set; }
}
}
Use QuoteStockTradeResponse.Data
to access the response. The data is contained in QuoteStockTradeItem
objects,TigerOpenAPI.Quote.Response.QuoteStockTradeItem
has the following attributes:
Name | Type | Description |
---|---|---|
symbol | String | symbol |
lotSize | Integer | lotsize |
spreadScale | Integer | tick size |
minTick | Double | minimum 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
Argument | Type | Required | Description |
---|---|---|---|
symbol | string | Yes | symbol |
period | string | Yes | period, possible values are: intraday, day, week, month, year, quarter, 6month |
market | string | Yes | US-U.S. Stocks, HK-Hongkong Stocks, CN-A-Shares |
begin_time | long | No | Begin time. Unix time stamp in millisecond or a date string. Example: 1639371600000, default value is -1, which means unbounded. |
end_time | long | No | End time. Unix time stamp in millisecond or a date string. Example: 1639371600000, default value is -1, which means unbounded. |
limit | integer | No | The maximum number of points returned. Default value is 200. Maximum is 1200 |
lang | string | No | Language: zh_CN,zh_TW,en_US. en_US by default |
Response
TigerOpenAPI.Quote.Response.QuoteCapitalFlowResponse
source
Use QuoteCapitalFlowResponse.Data
to access the data. This method returns a CapitalFlowItem
object, where TigerOpenAPI.Quote.Response.CapitalFlowItem
has the following attributes :
Name | Type | Description |
---|---|---|
symbol | string | symbol |
period | string | capital period |
items | array | array that contains the capital flow data |
items has the following attributes:
Name | Type | Description |
---|---|---|
netInflow | double | net inflow |
time | string | time, "11-25 12:48:00 EST" |
timestamp | long | timestamp |
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
Argument | Type | Required | Description |
---|---|---|---|
symbol | string | Yes | symbol |
market | string | Yes | US-U.S. Stocks, HK-Hongkong Stocks, CN-A-Shares |
lang | string | No | Language: zh_CN,zh_TW,en_US. en_US by default |
Response
TigerOpenAPI.Quote.Response.QuoteCapitalDistributionResponse
source
Use QuoteCapitalDistributionResponse.Data
to access the data. This property returns a CapitalDistributionItem
object, where TigerOpenAPI.Quote.Response.CapitalDistributionItem
has the following attributes :
Name | Type | Description |
---|---|---|
symbol | string | symbol |
netInflow | double | net inflow(inAll - outAll) |
inAll | double | all inflow(inBig + inMid + inSmall) |
inBig | double | big orders's inflow |
inMid | double | median orders's inflow |
inSmall | double | small orders's inflow |
outAll | double | all outflow(outBig + outMid + outSmall) |
outBig | double | big orders's outflow |
outMid | double | median orders's outflow |
outSmall | double | small 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
Argument | Type | Required | Description |
---|---|---|---|
symbol | string | Yes | symbol |
limit | integer | No | The maximum number of points returned. Default value is 40. Maximum is 60 |
lang | string | No | Language: zh_CN,zh_TW,en_US. en_US by default |
Response
TigerOpenAPI.Quote.Response.QuoteStockBrokerResponse
source
Use QuoteStockBrokerResponse.Data
to access the data. This property returns a StockBrokerItem
object, where TigerOpenAPI.Quote.Response.StockBrokerItem
has the following attributes :
Name | Type | Description |
---|---|---|
symbol | string | symbol |
bidBroker | array | array that contains the 'LevelBroker' data |
askBroker | array | array that contains the 'LevelBroker' data |
'LevelBroker' has the following attributes:
Name | Type | Description |
---|---|---|
level | integer | price level |
price | double | price |
brokerCount | integer | the count of borkers |
broker | array | the 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="
}