Market Data
The TypeScript SDK provides a QuoteClient that wraps all market-data endpoints. Every method is async and returns a typed response object (or throws on error).
Quick Start
import { ClientConfig } from 'tigeropen';
import { QuoteClient } from 'tigeropen';
const config = new ClientConfig({
propertiesFilePath: 'tiger_openapi_config.properties',
});
const qc = new QuoteClient(config);
// Get US market status
const states = await qc.marketState('US');
console.log('US market state:', states);
// Get real-time quotes for two symbols
const briefs = await qc.quoteRealTime(['AAPL', 'TSLA']);
console.log('Real-time quotes:', briefs);
// Get daily candlestick data
const klines = await qc.kline('AAPL', 'day');
console.log('K-line data:', klines);Basic Quotes
marketState
async marketState(market: string): Promise<MarketStateResponse>Returns the current trading session status for the specified market.
| Parameter | Type | Required | Description |
|---|---|---|---|
market | string | Yes | Market code: 'US', 'HK', 'CN', 'SG' |
Returns: Array of market state objects with market, status, openTime, closeTime.
const states = await qc.marketState('US');
// [{ market: 'US', status: 'Trading', openTime: '09:30', closeTime: '16:00' }]
const hkStates = await qc.marketState('HK');Data Example
Request parameters:
{ "market": "US" }Response data:
[
{
"market": "US",
"status": "trading",
"openTime": 1735020600000,
"closeTime": 1735044000000,
"timezone": "America/New_York"
}
]quoteRealTime
async quoteRealTime(symbols: string[]): Promise<QuoteBriefResponse[]>Returns real-time snapshot quotes (latest price, bid/ask, volume, change, change ratio) for the given symbols.
| Parameter | Type | Required | Description |
|---|---|---|---|
symbols | string[] | Yes | Stock symbols, e.g. ['AAPL', 'TSLA'] |
const briefs = await qc.quoteRealTime(['AAPL', 'TSLA', 'MSFT']);
for (const b of briefs) {
console.log(`${b.symbol}: ${b.latestPrice} (${b.changeRatio}%)`);
}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
}
]kline
async kline(symbol: string, period: string): Promise<KlineBar[]>Returns historical OHLCV candlestick data for the specified symbol and period.
| Parameter | Type | Required | Description |
|---|---|---|---|
symbol | string | Yes | Stock symbol, e.g. 'AAPL' |
period | string | Yes | Bar period: 'day', 'week', 'month', '1min', '5min', '15min', '30min', '60min' |
// Daily bars
const dailyBars = await qc.kline('AAPL', 'day');
// 5-minute intraday bars
const bars5m = await qc.kline('AAPL', '5min');
for (const bar of dailyBars) {
console.log(`${bar.time}: O=${bar.open} H=${bar.high} L=${bar.low} C=${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
}
]
}timeline
async timeline(symbols: string[]): Promise<TimelineResponse[]>Returns intraday minute-level price and volume timeline for today's session.
| Parameter | Type | Required | Description |
|---|---|---|---|
symbols | string[] | Yes | List of stock symbols |
const timeline = await qc.timeline(['AAPL']);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
}
]
}tradeTick
async tradeTick(symbols: string[]): Promise<TradeTickResponse[]>Returns the most recent trade ticks (price, size, timestamp, direction) for the given symbols.
| Parameter | Type | Required | Description |
|---|---|---|---|
symbols | string[] | Yes | List of stock symbols |
const ticks = await qc.tradeTick(['AAPL']);Data Example
Request parameters:
{ "symbols": ["AAPL"] }Response data:
{
"symbol": "AAPL",
"items": [
{
"time": 1735042780000,
"price": 227.52,
"volume": 100,
"direction": "BUY"
},
{
"time": 1735042781000,
"price": 227.50,
"volume": 200,
"direction": "SELL"
}
]
}quoteDepth
async quoteDepth(symbol: string): Promise<DepthQuoteResponse>Returns Level 2 order book (up to 10 levels of bids and asks) for the specified symbol.
| Parameter | Type | Required | Description |
|---|---|---|---|
symbol | string | Yes | Stock symbol |
const depth = await qc.quoteDepth('AAPL');
console.log('Best bid:', depth.bids[0]);
console.log('Best ask:', depth.asks[0]);Data Example
Request parameters:
{ "symbol": "AAPL" }Response data:
{
"symbol": "AAPL",
"askList": [
{ "price": 227.53, "volume": 300, "orderCount": 2 },
{ "price": 227.55, "volume": 500, "orderCount": 4 },
{ "price": 227.58, "volume": 200, "orderCount": 1 },
{ "price": 227.60, "volume": 800, "orderCount": 6 },
{ "price": 227.65, "volume": 1200, "orderCount": 8 }
],
"bidList": [
{ "price": 227.52, "volume": 400, "orderCount": 3 },
{ "price": 227.50, "volume": 600, "orderCount": 5 },
{ "price": 227.48, "volume": 300, "orderCount": 2 },
{ "price": 227.45, "volume": 700, "orderCount": 5 },
{ "price": 227.40, "volume": 1000, "orderCount": 7 }
]
}Option Quotes
optionExpiration
async optionExpiration(symbol: string): Promise<string[]>Returns all available option expiration dates for the underlying symbol.
| Parameter | Type | Required | Description |
|---|---|---|---|
symbol | string | Yes | Underlying symbol, e.g. 'AAPL' |
const expDates = await qc.optionExpiration('AAPL');
// ['2025-01-17', '2025-02-21', '2025-03-21', ...]Data Example
Request parameters:
{ "symbols": ["AAPL"] }Response data:
["2025-01-17", "2025-02-21", "2025-03-21", "2025-06-20", "2025-09-19", "2025-12-19", "2026-01-16"]optionChain
async optionChain(symbol: string, expiry: string): Promise<OptionChainResponse>Returns the full option chain (all strikes, both calls and puts) for a given expiration date.
| Parameter | Type | Required | Description |
|---|---|---|---|
symbol | string | Yes | Underlying symbol |
expiry | string | Yes | Expiration date in 'YYYY-MM-DD' format |
const chain = await qc.optionChain('AAPL', '2025-01-17');Data Example
Request parameters:
{ "symbol": "AAPL", "expiry": "2025-01-17" }Response data:
[
{
"strike": 220.0,
"callSymbol": "AAPL 250117C00220000",
"putSymbol": "AAPL 250117P00220000",
"callLatestPrice": 9.50,
"putLatestPrice": 2.10,
"callImpliedVolatility": 0.285,
"putImpliedVolatility": 0.312
},
{
"strike": 225.0,
"callSymbol": "AAPL 250117C00225000",
"putSymbol": "AAPL 250117P00225000",
"callLatestPrice": 6.20,
"putLatestPrice": 3.80,
"callImpliedVolatility": 0.278,
"putImpliedVolatility": 0.299
}
]optionBrief
async optionBrief(identifiers: string[]): Promise<OptionBriefResponse[]>Returns real-time quotes for specific option contracts.
| Parameter | Type | Required | Description |
|---|---|---|---|
identifiers | string[] | Yes | OCC-style identifiers, e.g. ['AAPL 250117C00150000'] |
const optBriefs = await qc.optionBrief(['AAPL 250117C00150000']);Data Example
Request parameters:
{ "identifiers": ["AAPL 250117C00220000"] }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
}
]optionKline
async optionKline(identifier: string, period: string): Promise<KlineBar[]>Returns historical candlestick data for a specific option contract.
| Parameter | Type | Required | Description |
|---|---|---|---|
identifier | string | Yes | OCC-style option identifier |
period | string | Yes | Bar period (same values as kline) |
const optKline = await qc.optionKline('AAPL 250117C00150000', 'day');Data Example
Request parameters:
{ "identifier": "AAPL 250117C00220000", "period": "day" }Response data:
{
"identifier": "AAPL 250117C00220000",
"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
}
]
}Futures Quotes
futureExchange
async futureExchange(): Promise<ExchangeResponse[]>Returns the list of supported futures exchanges.
const exchanges = await qc.futureExchange();
// [{ code: 'CME', name: 'Chicago Mercantile Exchange' }, ...]Data Example
Response data:
[
{ "exchange": "CME", "name": "Chicago Mercantile Exchange" },
{ "exchange": "CBOT", "name": "Chicago Board of Trade" },
{ "exchange": "NYMEX", "name": "New York Mercantile Exchange" },
{ "exchange": "HKEX", "name": "Hong Kong Exchanges and Clearing" }
]futureContracts
async futureContracts(exchange: string): Promise<FutureContractResponse[]>Returns available futures contracts on the specified exchange.
| Parameter | Type | Required | Description |
|---|---|---|---|
exchange | string | Yes | Exchange code, e.g. 'CME', 'CBOT' |
const contracts = await qc.futureContracts('CME');Data Example
Request parameters:
{ "exchange": "CME" }Response data:
[
{
"symbol": "ES",
"name": "E-mini S&P 500",
"contractMultiplier": 50,
"currency": "USD",
"minTick": 0.25,
"exchange": "CME"
},
{
"symbol": "NQ",
"name": "E-mini NASDAQ-100",
"contractMultiplier": 20,
"currency": "USD",
"minTick": 0.25,
"exchange": "CME"
}
]futureRealTimeQuote
async futureRealTimeQuote(symbols: string[]): Promise<FutureQuoteResponse[]>Returns real-time quotes for the specified futures contracts.
| Parameter | Type | Required | Description |
|---|---|---|---|
symbols | string[] | Yes | Futures contract symbols, e.g. ['ES2506'] |
const futQuotes = await qc.futureRealTimeQuote(['ES2506', 'NQ2506']);Data Example
Request parameters:
{ "symbols": ["ES2506", "NQ2506"] }Response data:
[
{
"symbol": "ES2506",
"latestPrice": 5920.50,
"preClose": 5895.25,
"change": 25.25,
"changePercentage": 0.428,
"volume": 1234567,
"openInterest": 2345678,
"open": 5900.00,
"high": 5935.00,
"low": 5895.00,
"timestamp": 1735042800000
}
]futureKline
async futureKline(symbol: string, period: string): Promise<KlineBar[]>Returns historical candlestick data for a futures contract.
const futKline = await qc.futureKline('ES2506', 'day');Data Example
Request parameters:
{ "symbol": "ES2506", "period": "day" }Response data:
{
"symbol": "ES2506",
"period": "day",
"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
}
]
}Fundamental Data
financialDaily
async financialDaily(symbol: string): Promise<FinancialDailyResponse>Returns daily fundamental metrics (P/E ratio, market cap, EPS, dividend yield, etc.).
const daily = await qc.financialDaily('AAPL');Data Example
Request parameters:
{ "symbol": "AAPL" }Response data:
[
{
"date": "2024-12-24",
"pe": 38.5,
"pb": 58.2,
"eps": 6.52,
"dividendYield": 0.0044,
"marketCap": 3420000000000
}
]financialReport
async financialReport(symbol: string): Promise<FinancialReportResponse>Returns quarterly and annual financial report data (income statement, balance sheet, cash flow statement).
const report = await qc.financialReport('AAPL');Data Example
Request parameters:
{ "symbol": "AAPL" }Response data:
[
{
"period": "2024Q4",
"periodType": "quarterly",
"revenue": 124300000000,
"netIncome": 36330000000,
"totalAssets": 352583000000,
"totalLiabilities": 308030000000,
"cashFlow": 29943000000,
"eps": 2.40
}
]corporateAction
async corporateAction(symbol: string): Promise<CorporateActionResponse[]>Returns historical corporate actions including dividends, stock splits, and rights offerings.
const actions = await qc.corporateAction('AAPL');
for (const action of actions) {
console.log(`${action.type}: ${action.exDate} ratio=${action.ratio}`);
}Data Example
Request parameters:
{ "symbol": "AAPL" }Response data:
[
{
"actionType": "dividend",
"exDate": "2024-11-08",
"payDate": "2024-11-14",
"amount": 0.25,
"currency": "USD"
},
{
"actionType": "split",
"exDate": "2020-08-31",
"ratio": 4.0,
"description": "4:1 stock split"
}
]Capital Flow
capitalFlow
async capitalFlow(symbol: string): Promise<CapitalFlowResponse>Returns net capital inflow/outflow data segmented by trade size (retail vs. institutional).
const flow = await qc.capitalFlow('AAPL');Data Example
Request parameters:
{ "symbol": "AAPL" }Response data:
{
"symbol": "AAPL",
"inflow": 8234567890,
"outflow": 7123456789,
"netInflow": 1111111101,
"largeOrderInflow": 5123456789,
"largeOrderOutflow": 4012345678,
"mediumOrderInflow": 2012345678,
"smallOrderInflow": 1098765432,
"timestamp": 1735042800000
}capitalDistribution
async capitalDistribution(symbol: string): Promise<CapitalDistributionResponse>Returns the distribution of buy/sell orders across different order-size tiers.
const dist = await qc.capitalDistribution('AAPL');Data Example
Request parameters:
{ "symbol": "AAPL" }Response data:
{
"symbol": "AAPL",
"retailBuyRatio": 0.18,
"retailSellRatio": 0.15,
"institutionBuyRatio": 0.42,
"institutionSellRatio": 0.38,
"largeholderBuyRatio": 0.40,
"largeholderSellRatio": 0.47,
"timestamp": 1735042800000
}Market Scanner
marketScanner
async marketScanner(params: MarketScannerParams): Promise<ScanResult[]>Scans the market and returns stocks matching the given filter criteria.
| Parameter | Type | Required | Description |
|---|---|---|---|
params | MarketScannerParams | Yes | Filter criteria object |
Key fields in MarketScannerParams:
| Field | Type | Description |
|---|---|---|
market | string | Target market: 'US', 'HK' |
filter | array | Array of filter condition objects |
sortFieldName | string | Field name to sort results by |
sortDir | string | Sort direction: 'asc' or 'desc' |
const scanResult = await qc.marketScanner({
market: 'US',
filter: [
{ fieldName: 'marketCap', filterMin: 1_000_000_000 },
{ fieldName: 'volume', filterMin: 500_000 },
],
sortFieldName: 'marketCap',
sortDir: 'desc',
});
for (const item of scanResult) {
console.log(`${item.symbol}: marketCap=${item.marketCap}`);
}Data Example
Request parameters:
{
"market": "US",
"filter": [
{ "fieldName": "marketCap", "filterMin": 1000000000 },
{ "fieldName": "changePercentage", "filterMin": 2.0 }
]
}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
}
]grabQuotePermission
async grabQuotePermission(): Promise<QuotePermissionResponse>Returns the current account's market data subscription permissions and the list of authorized markets.
const perm = await qc.grabQuotePermission();
console.log('Permitted markets:', perm.markets);Data Example
Response data:
["US_BASIC", "HK_BASIC", "US_REALTIME"]Updated 6 days ago
