Market Data
The Rust SDK provides an async QuoteClient built on Tokio. Every method returns a typed Result<T, TigerError> (e.g. Vec<MarketState>, Vec<Brief>, Vec<Kline>).
Quick Start
use tigeropen::config::ClientConfig;
use tigeropen::model::quote_requests::BriefRequest;
use tigeropen::quote::QuoteClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = ClientConfig::builder().build()?;
// v0.5.0+: use from_config() directly — no need to create HttpClient manually
let qc = QuoteClient::from_config(config);
// Get US market status
let states = qc.get_market_state("US").await?;
println!("US market state: {:?}", states);
// Get real-time quotes
let briefs = qc.get_real_time_quote(BriefRequest {
symbols: Some(vec!["AAPL".to_string(), "TSLA".to_string()]),
..Default::default()
}).await?;
for b in &briefs {
println!("{} latest_price={}", b.symbol, b.latest_price);
}
// Get daily candlestick data (v0.5.0+: multi-symbol slice)
let klines = qc.get_kline(&["AAPL", "TSLA"], "day").await?;
for k in &klines {
println!("{} bars={}", k.symbol, k.items.len());
}
Ok(())
}General
get_market_state
pub async fn get_market_state(&self, market: &str) -> Result<Vec<MarketState>, TigerError>Returns the current trading session status for the specified market.
| Parameter | Type | Required | Description |
|---|---|---|---|
market | &str | Yes | Market code: "US", "HK", "CN", "SG" |
Returns: Vec<MarketState> with fields market, market_status, status, open_time.
let states = qc.get_market_state("US").await?;
for s in &states {
println!("{}: {} openTime={}", s.market, s.market_status, s.open_time);
}Data Example
Request parameters:
{ "market": "US" }Response data:
[
{
"market": "US",
"status": "trading",
"openTime": 1735020600000,
"closeTime": 1735044000000,
"timezone": "America/New_York"
}
]get_trading_calendar
pub async fn get_trading_calendar(&self, req: TradingCalendarRequest) -> Result<Vec<TradingCalendar>, TigerError>Returns the trading calendar for a given market and date range.
TradingCalendarRequest fields:
| Field | Type | Required | Description |
|---|---|---|---|
| market | Option<String> | Yes | Market code, e.g. "US", "HK" |
| begin_date | Option<String> | No | Start date (yyyy-MM-dd) |
| end_date | Option<String> | No | End date (yyyy-MM-dd) |
use tigeropen::model::quote_requests::TradingCalendarRequest;
let calendar = qc.get_trading_calendar(TradingCalendarRequest {
market: Some("US".to_string()),
begin_date: Some("2025-01-01".to_string()),
end_date: Some("2025-12-31".to_string()),
..Default::default()
}).await?;grab_quote_permission
pub async fn grab_quote_permission(&self) -> Result<Vec<QuotePermission>, TigerError>Returns the current account's market data subscription permissions (with expiration timestamps).
let perms = qc.grab_quote_permission().await?;
for p in &perms {
println!("{} expires_at={}", p.name, p.expire_at);
}Data Example
Response data:
[
{ "name": "usStockQuote", "expireAt": 1735042800000 },
{ "name": "hkStockQuote", "expireAt": 1735042800000 }
]get_kline_quota
pub async fn get_kline_quota(&self) -> Result<KlineQuota, TigerError>Query remaining intraday kline quota for the current account.
let quota = qc.get_kline_quota().await?;
println!("used={} total={}", quota.used, quota.total);Stock Market Data
get_symbols
pub async fn get_symbols(&self, req: SymbolsRequest) -> Result<Vec<String>, TigerError>Query the list of symbols for a given market or category.
SymbolsRequest fields:
| Field | Type | Required | Description |
|---|---|---|---|
| market | Option<String> | No | Market: "US" / "HK" / "CN" / "SG" |
| sec_type | Option<String> | No | Security type |
| include_otc | Option<bool> | No | Whether to include OTC |
| lang | Option<String> | No | Language |
use tigeropen::model::quote_requests::SymbolsRequest;
let symbols = qc.get_symbols(SymbolsRequest {
market: Some("US".to_string()),
..Default::default()
}).await?;
println!("total={}", symbols.len());get_symbol_names
pub async fn get_symbol_names(&self, req: SymbolNamesRequest) -> Result<Vec<SymbolName>, TigerError>Batch query Chinese and English names for symbols.
let names = qc.get_symbol_names(SymbolNamesRequest {
symbols: Some(vec!["AAPL".to_string(), "TSLA".to_string()]),
..Default::default()
}).await?;
for n in &names {
println!("{} {}", n.symbol, n.name);
}get_trade_metas
pub async fn get_trade_metas(&self, req: TradeMetasRequest) -> Result<Vec<TradeMeta>, TigerError>Query trading attributes (lot size, min tick, limit-up/down rules, shortable/marginable flags, etc.).
TradeMetasRequest fields:
| Field | Type | Required | Description |
|---|---|---|---|
| symbols | Option<Vec<String>> | Yes | Stock codes, up to 50 symbols |
| lang | Option<String> | No | Language |
let metas = qc.get_trade_metas(TradeMetasRequest {
symbols: Some(vec!["AAPL".to_string()]),
..Default::default()
}).await?;
for m in &metas {
println!("{} lot_size={} min_tick={}", m.symbol, m.lot_size, m.min_tick);
}get_real_time_quote
pub async fn get_real_time_quote(&self, req: BriefRequest) -> Result<Vec<Brief>, TigerError>Returns real-time snapshot quotes. Backed by the brief server method.
BriefRequest fields:
| Field | Type | Required | Description |
|---|---|---|---|
| symbols | Option<Vec<String>> | Yes | Stock symbol list, up to 100 symbols |
| include_hour_trading | Option<bool> | No | Include pre/after-hours |
| sec_type | Option<String> | No | Security type |
| lang | Option<String> | No | Language |
use tigeropen::model::quote_requests::BriefRequest;
let briefs = qc.get_real_time_quote(BriefRequest {
symbols: Some(vec!["AAPL".to_string(), "TSLA".to_string()]),
..Default::default()
}).await?;
for b in &briefs {
println!("{}: latest_price={}", b.symbol, b.latest_price);
}Data Example
Request parameters:
{ "symbols": ["AAPL", "TSLA"] }Response data:
[
{
"symbol": "AAPL",
"market": "US",
"name": "Apple Inc.",
"latestPrice": 227.52,
"preClose": 225.01,
"change": 2.51,
"changePercentage": 1.115,
"volume": 62345678,
"amount": 14189233280.0,
"open": 225.50,
"high": 228.10,
"low": 224.80,
"timestamp": 1735042800000
},
{
"symbol": "TSLA",
"market": "US",
"name": "Tesla Inc.",
"latestPrice": 410.44,
"preClose": 403.84,
"change": 6.60,
"changePercentage": 1.634,
"volume": 98765432,
"amount": 40542123456.0,
"open": 405.00,
"high": 415.20,
"low": 402.30,
"timestamp": 1735042800000
}
]get_delayed_quote
pub async fn get_delayed_quote(&self, req: BriefRequest) -> Result<Vec<Brief>, TigerError>Delayed quotes — no real-time subscription needed. Same response shape as get_real_time_quote.
let briefs = qc.get_delayed_quote(BriefRequest {
symbols: Some(vec!["AAPL".to_string()]),
..Default::default()
}).await?;get_kline
pub async fn get_kline(&self, symbols: &[&str], period: &str) -> Result<Vec<Kline>, TigerError>Returns historical OHLCV candlestick data for the specified symbols and period. Each Kline carries a symbol, period, next_page_token, and a Vec<KlineItem>.
| Parameter | Type | Required | Description |
|---|---|---|---|
symbols | &[&str] | Yes | Stock symbols, e.g. &["AAPL", "TSLA"] |
period | &str | Yes | Bar period: "day", "week", "month", "1min", "5min", "15min", "30min", "60min" |
let daily = qc.get_kline(&["AAPL", "TSLA"], "day").await?;
for k in &daily {
for bar in &k.items {
println!("{} O={} H={} L={} C={}", k.symbol, bar.open, bar.high, bar.low, bar.close);
}
}Data Example
Request parameters:
{ "symbols": ["AAPL"], "period": "day" }Response data:
[
{
"symbol": "AAPL",
"period": "day",
"items": [
{
"time": 1734912000000,
"open": 222.56,
"high": 225.72,
"low": 222.11,
"close": 225.01,
"volume": 55234100
},
{
"time": 1734998400000,
"open": 225.50,
"high": 228.10,
"low": 224.80,
"close": 227.52,
"volume": 62345678
}
]
}
]get_timeline
pub async fn get_timeline(&self, symbols: &[&str]) -> Result<Vec<Timeline>, TigerError>Returns intraday minute-level price and volume timeline for today's session. Each Timeline contains intraday, pre_hours, and after_hours buckets (each an Option<TimelineBucket>).
| Parameter | Type | Required | Description |
|---|---|---|---|
symbols | &[&str] | Yes | List of stock symbols, up to 50 symbols |
let timelines = qc.get_timeline(&["AAPL"]).await?;
for tl in &timelines {
let count = tl.intraday.as_ref().map(|b| b.items.len()).unwrap_or(0);
println!("{} intraday_points={} preClose={}", tl.symbol, count, tl.pre_close);
}Data Example
Request parameters:
{ "symbols": ["AAPL"] }Response data:
{
"symbol": "AAPL",
"items": [
{
"time": 1735020600000,
"price": 225.50,
"volume": 3021456,
"avgPrice": 225.48
},
{
"time": 1735020660000,
"price": 225.80,
"volume": 1234567,
"avgPrice": 225.55
}
]
}get_timeline_history
pub async fn get_timeline_history(&self, req: TimelineHistoryRequest) -> Result<Vec<Timeline>, TigerError>Get intraday data for a historical date.
TimelineHistoryRequest fields:
| Field | Type | Required | Description |
|---|---|---|---|
| symbols | Option<Vec<String>> | Yes | Stock codes, up to 50 symbols |
| date | Option<String> | No | Date (yyyy-MM-dd) |
| right | Option<String> | No | Adjustment |
| trade_session | Option<String> | No | Trade session |
| lang | Option<String> | No | Language |
use tigeropen::model::quote_requests::TimelineHistoryRequest;
let tl = qc.get_timeline_history(TimelineHistoryRequest {
symbols: Some(vec!["AAPL".to_string()]),
date: Some("2025-09-01".to_string()),
..Default::default()
}).await?;get_trade_tick
pub async fn get_trade_tick(&self, req: TradeTickRequest) -> Result<Vec<TradeTick>, TigerError>Returns the most recent trade ticks (price, volume, timestamp, direction) for the given symbols.
| Field | Type | Required | Description |
|---|---|---|---|
| symbols | Option<Vec<String>> | Yes | Stock symbol list, up to 50 symbols |
| begin_index | Option<i32> | No | Start index |
| end_index | Option<i32> | No | End index |
| limit | Option<i32> | No | Max records returned |
| lang | Option<String> | No | Language |
use tigeropen::model::quote_requests::TradeTickRequest;
let ticks = qc.get_trade_tick(TradeTickRequest {
symbols: Some(vec!["AAPL".to_string()]),
..Default::default()
}).await?;
for t in &ticks {
println!("{} ticks={}", t.symbol, t.items.len());
}Data Example
Request parameters:
{ "symbols": ["AAPL"] }Response data:
{
"symbol": "AAPL",
"items": [
{
"time": 1735042780000,
"price": 227.52,
"volume": 100,
"type": "BUY"
},
{
"time": 1735042781000,
"price": 227.50,
"volume": 200,
"type": "SELL"
}
]
}get_quote_depth
pub async fn get_quote_depth(&self, req: DepthQuoteRequest) -> Result<Vec<Depth>, TigerError>Returns Level 2 order book for the specified symbol.
| Field | Type | Required | Description |
|---|---|---|---|
| symbols | Option<Vec<String>> | Yes | Stock symbol list, up to 50 symbols |
| market | Option<String> | Yes | Market code, e.g. "US", "HK" |
| lang | Option<String> | No | Language |
use tigeropen::model::quote_requests::DepthQuoteRequest;
let depths = qc.get_quote_depth(DepthQuoteRequest {
symbols: Some(vec!["AAPL".to_string()]),
market: Some("US".to_string()),
..Default::default()
}).await?;
if let Some(d) = depths.first() {
println!("{}: asks={} bids={}", d.symbol, d.asks.len(), d.bids.len());
}get_capital_flow
pub async fn get_capital_flow(
&self,
symbol: &str,
market: &str,
period: &str,
) -> Result<Option<CapitalFlow>, TigerError>Returns net capital inflow/outflow data segmented by trade size.
| Parameter | Type | Required | Description |
|---|---|---|---|
symbol | &str | Yes | Stock symbol |
market | &str | Yes | Market code, e.g. "US" |
period | &str | Yes | Period, e.g. "day", "1min" |
if let Some(cf) = qc.get_capital_flow("AAPL", "US", "day").await? {
println!("{} period={} rows={}", cf.symbol, cf.period, cf.items.len());
}Data Example
Request parameters:
{ "symbol": "AAPL", "market": "US", "period": "day" }Response data:
{
"symbol": "AAPL",
"inflow": 8234567890,
"outflow": 7123456789,
"netInflow": 1111111101,
"largeOrderInflow": 5123456789,
"largeOrderOutflow": 4012345678,
"mediumOrderInflow": 2012345678,
"smallOrderInflow": 1098765432,
"timestamp": 1735042800000
}get_capital_distribution
pub async fn get_capital_distribution(
&self,
symbol: &str,
market: &str,
) -> Result<Option<CapitalDistribution>, TigerError>Returns the distribution of buy/sell capital across different order-size tiers.
| Parameter | Type | Required | Description |
|---|---|---|---|
symbol | &str | Yes | Stock symbol |
market | &str | Yes | Market code, e.g. "US" |
if let Some(cd) = qc.get_capital_distribution("AAPL", "US").await? {
println!("{} netInflow={}", cd.symbol, cd.net_inflow);
}Data Example
Request parameters:
{ "symbol": "AAPL", "market": "US" }Response data:
{
"symbol": "AAPL",
"netInflow": 1111111101,
"inAll": 8234567890,
"inBig": 5123456789,
"inMid": 2012345678,
"inSmall": 1098765432,
"outAll": 7123456789,
"outBig": 4012345678,
"outMid": 1912345678,
"outSmall": 1198765432
}get_trade_rank
pub async fn get_trade_rank(&self, req: TradeRankRequest) -> Result<Vec<TradeRankItem>, TigerError>Volume/turnover leaderboard for a given market.
TradeRankRequest fields:
| Field | Type | Required | Description |
|---|---|---|---|
| market | String | Yes | Market code |
| lang | Option<String> | No | Language |
let rank = qc.get_trade_rank(TradeRankRequest {
market: "HK".to_string(),
..Default::default()
}).await?;
for r in rank.iter().take(10) {
println!("{} {} amount={}", r.symbol, r.name, r.amount);
}get_short_interest
pub async fn get_short_interest(&self, req: ShortInterestRequest) -> Result<Vec<ShortInterest>, TigerError>US stock short interest, borrow rate, and available shares.
ShortInterestRequest fields:
| Field | Type | Required | Description |
|---|---|---|---|
| symbols | Option<Vec<String>> | Yes | Stock codes, up to 50 symbols |
| lang | Option<String> | No | Language |
let si = qc.get_short_interest(ShortInterestRequest {
symbols: Some(vec!["TSLA".to_string()]),
..Default::default()
}).await?;get_stock_broker
pub async fn get_stock_broker(&self, req: StockBrokerRequest) -> Result<Vec<StockBroker>, TigerError>HK stock broker queue details for each order book level. Requires HK Level2 entitlement.
StockBrokerRequest fields:
| Field | Type | Required | Description |
|---|---|---|---|
| symbol | String | Yes | Single stock code |
| limit | Option<i32> | No | Max brokers per level |
| sec_type | Option<String> | No | Security type |
| lang | Option<String> | No | Language |
let sb = qc.get_stock_broker(StockBrokerRequest {
symbol: "00700".to_string(),
limit: Some(40),
..Default::default()
}).await?;
if let Some(b) = sb.first() {
println!("{} ask_levels={} bid_levels={}", b.symbol, b.level_ask_list.len(), b.level_bid_list.len());
}get_stock_industry
pub async fn get_stock_industry(&self, req: StockIndustryRequest) -> Result<Vec<StockIndustry>, TigerError>GICS industry classification for symbols.
StockIndustryRequest fields:
| Field | Type | Required | Description |
|---|---|---|---|
| symbol | String | Yes | Stock code |
| market | Option<String> | No | Market |
| sec_type | Option<String> | No | Security type |
| lang | Option<String> | No | Language |
let si = qc.get_stock_industry(StockIndustryRequest {
symbol: "AAPL".to_string(),
market: Some("US".to_string()),
..Default::default()
}).await?;Options
get_option_expiration
pub async fn get_option_expiration(&self, symbols: &[&str]) -> Result<Vec<OptionExpiration>, TigerError>Returns all available option expiration dates for the underlying symbols.
| Parameter | Type | Required | Description |
|---|---|---|---|
symbols | &[&str] | Yes | Underlying symbols, e.g. &["AAPL", "TSLA"] |
let exps = qc.get_option_expiration(&["AAPL"]).await?;
if let Some(e) = exps.first() {
for date in &e.dates {
println!("Expiry: {}", date);
}
}Data Example
Request parameters:
{ "symbols": ["AAPL"] }Response data:
[
{
"symbol": "AAPL",
"dates": ["2025-01-17", "2025-02-21", "2025-03-21"],
"timestamps": [1737081600000, 1740096000000, 1742515200000],
"periods": ["weekly", "monthly", "monthly"]
}
]get_option_symbols
pub async fn get_option_symbols(&self, req: OptionSymbolsRequest) -> Result<Vec<String>, TigerError>Query option symbol list for a given market.
OptionSymbolsRequest fields:
| Field | Type | Required | Description |
|---|---|---|---|
| market | Option<String> | No | Market code |
| lang | Option<String> | No | Language |
let syms = qc.get_option_symbols(OptionSymbolsRequest {
market: Some("US".to_string()),
..Default::default()
}).await?;get_option_chain
pub async fn get_option_chain(&self, req: OptionChainRequest) -> Result<Vec<OptionChain>, TigerError>Returns the full option chain (all strikes, both calls and puts) for the given symbol/expiry pairs. The SDK converts date strings to millisecond timestamps using the correct exchange timezone (America/New_York for US, Asia/Hong_Kong for HK) internally. Since v0.5.3, the parameter is OptionChainRequest instead of a slice of tuples.
OptionChainItem constructors
| Method | Description |
|---|---|
OptionChainItem::from_date("AAPL", "2025-01-17")? | Date string — timezone inferred from symbol |
OptionChainItem::from_date_tz("AAPL", "2025-01-17", "America/New_York")? | Explicit timezone |
OptionChainItem::new("AAPL", 1737072000000) | Direct millisecond timestamp |
| Parameter | Type | Required | Description |
|---|---|---|---|
req.option_basic | Option<Vec<OptionChainItem>> | Yes | List of symbol/expiry pairs |
req.market | Option<String> | No | Market code, e.g. "HK" |
use tigeropen::model::quote_requests::{OptionChainItem, OptionChainRequest};
let chain = qc.get_option_chain(OptionChainRequest::new(vec![
OptionChainItem::from_date("AAPL", "2025-01-17")?,
])).await?;
if let Some(c) = chain.first() {
println!("{} rows={}", c.symbol, c.items.len());
for row in &c.items {
if let Some(call) = &row.call {
println!("call {} strike={}", call.identifier, call.strike);
}
}
}Data Example
Request parameters:
{ "option_basic": [{ "symbol": "AAPL", "expiry": 1737072000000 }] }Response data:
[
{
"strike": 220.0,
"callSymbol": "AAPL 250117C00220000",
"putSymbol": "AAPL 250117P00220000",
"callLatestPrice": 9.50,
"putLatestPrice": 2.10,
"callImpliedVolatility": 0.285,
"putImpliedVolatility": 0.312
}
]get_option_quote
pub async fn get_option_quote(&self, req: OptionQuoteRequest) -> Result<Vec<OptionBrief>, TigerError>Returns real-time quotes for specific option contracts. Each OCC identifier is parsed into symbol / expiry (ms) / right ("CALL" / "PUT") / strike (string, e.g. "150.0"). Since v0.5.3, strike is serialized as a JSON string in minimal-decimal format (e.g. "310.0", consistent with Java/Go/TypeScript SDKs; fixes latestPrice=0 returned by the old 3-decimal format).
OptionContractItem constructors
| Method | Description |
|---|---|
OptionContractItem::from_occ("AAPL 250117C00150000")? | OCC identifier — timezone inferred from symbol (recommended) |
OptionContractItem::from_occ_tz("AAPL 250117C00150000", "America/New_York")? | Explicit timezone |
OptionContractItem::new("AAPL", 1737072000000, "CALL", "150.0") | Direct construction |
| Parameter | Type | Required | Description |
|---|---|---|---|
req.option_basic | Option<Vec<OptionContractItem>> | Yes | Option contract list, up to 30 |
req.market | Option<String> | No | Market code |
use tigeropen::model::quote_requests::{OptionContractItem, OptionQuoteRequest};
let briefs = qc.get_option_quote(OptionQuoteRequest::new(vec![
OptionContractItem::from_occ("AAPL 250117C00150000")?,
])).await?;
for b in &briefs {
println!("{} latest_price={}", b.symbol, b.latest_price);
}Data Example
Request parameters:
{
"option_basic": [
{ "symbol": "AAPL", "expiry": 1737072000000, "right": "CALL", "strike": "150.0" }
]
}Response data:
[
{
"identifier": "AAPL 250117C00220000",
"latestPrice": 9.50,
"preClose": 9.10,
"change": 0.40,
"impliedVolatility": 0.285,
"delta": 0.612,
"gamma": 0.028,
"theta": -0.085,
"vega": 0.156,
"openInterest": 12540,
"volume": 3820
}
]get_option_kline
pub async fn get_option_kline(&self, req: OptionKlineRequest) -> Result<Vec<OptionKline>, TigerError>Returns historical candlestick data for one or more option contracts. Since v0.5.3, the parameter is OptionKlineRequest; strike is serialized as a JSON string in minimal-decimal format (e.g. "310.0", consistent with Java/Go/TypeScript SDKs; fixes empty results returned by the old 3-decimal string format). OptionKlineItem supports optional begin_time / end_time (ms) and limit.
OptionKlineItem constructors
| Method | Description |
|---|---|
OptionKlineItem::from_occ("AAPL 250117C00150000", "day")? | OCC identifier + period (recommended) |
OptionKlineItem::from_occ_tz("AAPL 250117C00150000", "day", "America/New_York")? | Explicit timezone |
OptionKlineItem::new("AAPL", 1737072000000, "CALL", "150.0", "day") | Direct construction |
| Parameter | Type | Required | Description |
|---|---|---|---|
req.option_query | Option<Vec<OptionKlineItem>> | Yes | Option kline query list |
req.market | Option<String> | No | Market code |
use tigeropen::model::quote_requests::{OptionKlineItem, OptionKlineRequest};
// Single contract with time range
let mut item = OptionKlineItem::from_occ("AAPL 250117C00150000", "day")?;
item.begin_time = Some(begin_ms);
item.limit = Some(60);
let klines = qc.get_option_kline(OptionKlineRequest {
option_query: Some(vec![item]),
..Default::default()
}).await?;
for k in &klines {
println!("bars={}", k.items.len());
}Data Example
Request parameters:
{
"option_query": [
{ "symbol": "AAPL", "expiry": 1737072000000, "right": "CALL", "strike": 150.0, "period": "day" }
]
}Response data:
[
{
"symbol": "AAPL 250117C00150000",
"period": "day",
"items": [
{ "time": 1734912000000, "open": 8.80, "high": 9.60, "low": 8.70, "close": 9.10, "volume": 2100 },
{ "time": 1734998400000, "open": 9.10, "high": 9.80, "low": 9.00, "close": 9.50, "volume": 3820 }
]
}
]get_option_trade_ticks
pub async fn get_option_trade_ticks(&self, req: OptionTradeTickRequest) -> Result<Vec<TradeTick>, TigerError>Returns trade ticks for option contracts.
let ticks = qc.get_option_trade_ticks(OptionTradeTickRequest {
contracts: vec![OptionQueryItem {
symbol: "AAPL".to_string(),
expiry: 1750291200000,
strike: "200".to_string(),
right: "CALL".to_string(),
..Default::default()
}],
..Default::default()
}).await?;get_option_timeline
pub async fn get_option_timeline(&self, req: OptionTimelineRequest) -> Result<Vec<Timeline>, TigerError>Returns intraday timeline for option contracts.
let tl = qc.get_option_timeline(OptionTimelineRequest {
option_query: vec![/* OptionQueryItem */],
..Default::default()
}).await?;get_option_depth
pub async fn get_option_depth(&self, req: OptionDepthRequest) -> Result<Vec<Depth>, TigerError>Returns order book depth for option contracts.
let depths = qc.get_option_depth(OptionDepthRequest {
option_basic: vec![/* OptionQueryItem */],
..Default::default()
}).await?;get_option_analysis
pub async fn get_option_analysis(&self, req: OptionAnalysisRequest) -> Result<Vec<OptionAnalysis>, TigerError>Returns implied and historical volatility analysis for option underlyings.
OptionAnalysisRequest fields:
| Field | Type | Required | Description |
|---|---|---|---|
| symbols | Option<Vec<String>> | Yes | Underlying codes, up to 10 symbols |
| market | Option<String> | No | Market |
| period | Option<String> | No | Historical volatility period |
| require_volatility_list | Option<bool> | No | Return historical volatility series |
| lang | Option<String> | No | Language |
let res = qc.get_option_analysis(OptionAnalysisRequest {
symbols: Some(vec!["AAPL".to_string()]),
market: Some("US".to_string()),
..Default::default()
}).await?;Futures
get_future_exchange
pub async fn get_future_exchange(&self) -> Result<Vec<FutureExchange>, TigerError>Returns the list of supported futures exchanges.
let exchanges = qc.get_future_exchange().await?;
for ex in &exchanges {
println!("{}: {}", ex.code, ex.name);
}Data Example
Response data:
[
{ "code": "CME", "name": "Chicago Mercantile Exchange", "zoneId": "America/Chicago" },
{ "code": "CBOT", "name": "Chicago Board of Trade", "zoneId": "America/Chicago" },
{ "code": "NYMEX", "name": "New York Mercantile Exchange", "zoneId": "America/New_York" },
{ "code": "HKEX", "name": "Hong Kong Exchanges and Clearing", "zoneId": "Asia/Hong_Kong" }
]get_future_contracts
pub async fn get_future_contracts(&self, exchange_code: &str) -> Result<Vec<FutureContractInfo>, TigerError>Returns available futures contracts on the specified exchange.
| Parameter | Type | Required | Description |
|---|---|---|---|
exchange_code | &str | Yes | Exchange code, e.g. "CME", "CBOT" |
let contracts = qc.get_future_contracts("CME").await?;
for c in &contracts {
println!("{} {}", c.contract_code, c.name);
}Data Example
Request parameters:
{ "exchange_code": "CME" }Response data:
[
{
"contractCode": "ES2506",
"name": "E-mini S&P 500",
"multiplier": 50,
"currency": "USD",
"minTick": 0.25,
"exchange": "CME"
}
]get_future_contract
pub async fn get_future_contract(&self, req: FutureContractRequest) -> Result<Option<FutureContractInfo>, TigerError>Lookup a futures contract by contract code or product type.
FutureContractRequest fields:
| Field | Type | Required | Description |
|---|---|---|---|
| contract_code | Option<String> | No | Contract code, e.g. "CL2609" |
| type_ | Option<String> | No | Product type code, e.g. "CL" |
| lang | Option<String> | No | Language |
let contract = qc.get_future_contract(FutureContractRequest {
contract_code: Some("CL2609".to_string()),
..Default::default()
}).await?;get_all_future_contracts
pub async fn get_all_future_contracts(&self, req: AllFutureContractsRequest) -> Result<Vec<FutureContractInfo>, TigerError>Returns all contracts for a given futures product type.
AllFutureContractsRequest fields: type_ / exchange / lang.
let contracts = qc.get_all_future_contracts(AllFutureContractsRequest {
type_: Some("CL".to_string()),
..Default::default()
}).await?;get_current_future_contract
pub async fn get_current_future_contract(&self, req: FutureContractRequest) -> Result<Option<FutureContractInfo>, TigerError>Returns the current main (front-month) contract for a futures product.
let c = qc.get_current_future_contract(FutureContractRequest {
type_: Some("CL".to_string()),
..Default::default()
}).await?;
if let Some(contract) = c {
println!("current main: {}", contract.contract_code);
}get_future_continuous_contracts
pub async fn get_future_continuous_contracts(&self, req: FutureContractsRequest) -> Result<Vec<FutureContractInfo>, TigerError>Returns the continuous contract series for a futures product.
FutureContractsRequest fields: type_ / lang.
get_future_history_main_contract
pub async fn get_future_history_main_contract(&self, req: FutureHistoryRequest) -> Result<Vec<FutureContractInfo>, TigerError>Returns the historical sequence of main contracts for a futures product.
FutureHistoryRequest fields:
| Field | Type | Required | Description |
|---|---|---|---|
| contract_codes | Vec<String> | Yes | Contract codes |
| begin_time | Option<i64> | No | Start ms timestamp |
| end_time | Option<i64> | No | End ms timestamp |
| lang | Option<String> | No | Language |
get_future_real_time_quote
pub async fn get_future_real_time_quote(&self, req: FutureBriefRequest) -> Result<Vec<FutureQuote>, TigerError>Returns real-time quotes for one or more futures contracts.
FutureBriefRequest fields:
| Field | Type | Required | Description |
|---|---|---|---|
| contract_codes | Option<Vec<String>> | Yes | Contract codes, up to 50 contracts |
| lang | Option<String> | No | Language |
use tigeropen::model::quote_requests::FutureBriefRequest;
let quotes = qc.get_future_real_time_quote(FutureBriefRequest {
contract_codes: Some(vec!["ES2506".to_string(), "NQ2506".to_string()]),
..Default::default()
}).await?;
for q in "es {
println!("{} latest_price={}", q.contract_code, q.latest_price);
}get_future_kline
pub async fn get_future_kline(&self, req: FutureKlineRequest) -> Result<Vec<FutureKline>, TigerError>Returns historical candlestick data for one or more futures contracts. When begin_time / end_time are left at 0, they are converted internally to -1.
FutureKlineRequest fields:
| Field | Type | Description |
|---|---|---|
contract_codes | Vec<String> | Futures contract codes |
period | String | Bar period (e.g. "day", "60min", "5min") |
begin_time | i64 | Start timestamp in ms. Leave 0 / -1 to omit |
end_time | i64 | End timestamp in ms. Leave 0 / -1 to omit |
limit | Option<i32> | Max bars returned |
page_token | Option<String> | Pagination token from a previous response |
use tigeropen::model::quote::FutureKlineRequest;
let klines = qc.get_future_kline(FutureKlineRequest {
contract_codes: vec!["ES2506".into()],
period: "day".into(),
begin_time: -1,
end_time: -1,
limit: None,
page_token: None,
}).await?;
for k in &klines {
println!("bars={}", k.items.len());
}Data Example
Request parameters:
{ "contract_codes": ["ES2506"], "period": "day", "begin_time": -1, "end_time": -1 }Response data:
[
{
"items": [
{ "time": 1734912000000, "open": 5870.00, "high": 5900.00, "low": 5860.00, "close": 5895.25, "volume": 1023456 },
{ "time": 1734998400000, "open": 5900.00, "high": 5935.00, "low": 5895.00, "close": 5920.50, "volume": 1234567 }
]
}
]get_future_trade_ticks
pub async fn get_future_trade_ticks(&self, req: FutureTradeTickRequest) -> Result<Vec<TradeTick>, TigerError>Returns trade ticks for a futures contract.
FutureTradeTickRequest fields:
| Field | Type | Required | Description |
|---|---|---|---|
| contract_code | String | Yes | Contract code |
| begin_index | Option<i32> | No | Start index |
| end_index | Option<i32> | No | End index |
| limit | Option<i32> | No | Max rows |
| lang | Option<String> | No | Language |
get_future_depth
pub async fn get_future_depth(&self, req: FutureDepthRequest) -> Result<Vec<Depth>, TigerError>Returns order book depth for futures contracts.
FutureDepthRequest fields: contract_codes: Vec<String> / lang.
get_future_trading_times
pub async fn get_future_trading_times(&self, req: FutureTradingTimesRequest) -> Result<Vec<FutureTradingTime>, TigerError>Returns the trading session schedule for a futures contract.
FutureTradingTimesRequest fields:
| Field | Type | Required | Description |
|---|---|---|---|
| contract_code | String | Yes | Contract code |
| trading_date | Option<String> | No | Trading date |
| lang | Option<String> | No | Language |
Funds
get_fund_symbols
pub async fn get_fund_symbols(&self, req: FundSymbolsRequest) -> Result<Vec<String>, TigerError>Returns the list of available fund symbols.
let symbols = qc.get_fund_symbols(FundSymbolsRequest {
..Default::default()
}).await?;get_fund_contracts
pub async fn get_fund_contracts(&self, req: FundContractsRequest) -> Result<Vec<FundContract>, TigerError>Returns fund contract metadata (name, currency, fund type, inception date, NAV, expense ratio).
FundContractsRequest fields: symbols: Vec<String> / lang.
let contracts = qc.get_fund_contracts(FundContractsRequest {
symbols: vec!["SPY".to_string()],
..Default::default()
}).await?;get_fund_quote
pub async fn get_fund_quote(&self, req: FundQuoteRequest) -> Result<Vec<FundQuote>, TigerError>Returns fund NAV quotes.
FundQuoteRequest fields: symbols: Vec<String> / lang.
let quotes = qc.get_fund_quote(FundQuoteRequest {
symbols: vec!["SPY".to_string()],
..Default::default()
}).await?;get_fund_history_quote
pub async fn get_fund_history_quote(&self, req: FundHistoryQuoteRequest) -> Result<Vec<FundHistoryQuote>, TigerError>Returns historical fund NAV data.
FundHistoryQuoteRequest fields:
| Field | Type | Required | Description |
|---|---|---|---|
| symbols | Vec<String> | Yes | Fund symbols, up to 500 symbols |
| begin_time | Option<i64> | No | Start ms timestamp |
| end_time | Option<i64> | No | End ms timestamp |
| limit | Option<i32> | No | Max rows |
| lang | Option<String> | No | Language |
Warrants
get_warrant_quote
pub async fn get_warrant_quote(&self, req: WarrantBriefsRequest) -> Result<Vec<Brief>, TigerError>Returns real-time quotes for warrant instruments.
WarrantBriefsRequest fields: symbols: Vec<String> / lang.
get_warrant_filter
pub async fn get_warrant_filter(&self, req: WarrantFilterRequest) -> Result<Vec<WarrantFilterResult>, TigerError>Warrant screener — filter warrants by underlying, issuer, expiry, etc.
WarrantFilterRequest fields:
| Field | Type | Required | Description |
|---|---|---|---|
| symbol | String | Yes | Underlying code |
| page | Option<i32> | No | Page number |
| page_size | Option<i32> | No | Page size |
| sort_field_name | Option<String> | No | Sort field |
| sort_dir | Option<String> | No | Sort direction |
| issuer_name | Option<String> | No | Filter by issuer |
| expire_ym | Option<String> | No | Filter by expiry year-month (yyyyMM) |
| lang | Option<String> | No | Language |
Industries
get_industry_list
pub async fn get_industry_list(&self, req: IndustryListRequest) -> Result<Vec<Industry>, TigerError>Returns GICS industry hierarchy by level (GSECTOR / GGROUP / GIND / GSUBIND).
IndustryListRequest fields: industry_level: String / lang.
let industries = qc.get_industry_list(IndustryListRequest {
industry_level: "GSECTOR".to_string(),
..Default::default()
}).await?;get_industry_stocks
pub async fn get_industry_stocks(&self, req: IndustryStocksRequest) -> Result<Vec<String>, TigerError>Returns the list of stocks belonging to a given industry.
IndustryStocksRequest fields: industry_id: String / market / lang.
let stocks = qc.get_industry_stocks(IndustryStocksRequest {
industry_id: "10".to_string(), // Energy sector
market: Some("US".to_string()),
..Default::default()
}).await?;Scanner
market_scanner
pub async fn market_scanner(&self, req: MarketScannerRequest) -> Result<Option<ScannerResult>, TigerError>Scans the market and returns stocks matching the given filter criteria.
MarketScannerRequest selected fields:
| Field | Type | Description |
|---|---|---|
market | String | Market code (required) |
page | Option<i32> | Page number |
page_size | Option<i32> | Page size |
cursor_id | Option<String> | Cursor for paging |
base_filter_list | Option<Vec<serde_json::Value>> | Base filter criteria |
accumulate_filter_list | Option<Vec<serde_json::Value>> | Accumulate filter criteria |
financial_filter_list | Option<Vec<serde_json::Value>> | Financial filter criteria |
multi_tags_filter_list | Option<Vec<serde_json::Value>> | Multi-tag filter criteria |
sort_field_data | Option<serde_json::Value> | Sort specification |
use tigeropen::model::quote::MarketScannerRequest;
if let Some(r) = qc.market_scanner(MarketScannerRequest {
market: "US".into(),
page: Some(0),
page_size: Some(10),
..Default::default()
}).await? {
println!("page={}/{} total={} items={}", r.page, r.total_page, r.total_count, r.items.len());
}Data Example
Request parameters:
{ "market": "US", "page": 0, "page_size": 10 }Response data:
[
{
"symbol": "AAPL",
"name": "Apple Inc.",
"latestPrice": 227.52,
"changePercentage": 1.115,
"marketCap": 3420000000000,
"volume": 62345678
},
{
"symbol": "NVDA",
"name": "NVIDIA Corporation",
"latestPrice": 138.85,
"changePercentage": 3.240,
"marketCap": 3390000000000,
"volume": 185432100
}
]get_market_scanner_tags
pub async fn get_market_scanner_tags(&self, req: MarketScannerTagsRequest) -> Result<Vec<ScannerTag>, TigerError>Query the list of filter tag fields supported by the market scanner.
MarketScannerTagsRequest fields: market: String / multi_tags_fields: Vec<String> / lang.
multi_tags_fieldsis required and must not be empty. Pass at least one field name such as["sector"]or["industry"].
let tags = qc.get_market_scanner_tags(MarketScannerTagsRequest {
market: "US".to_string(),
multi_tags_fields: vec!["sector".to_string()],
..Default::default()
}).await?;