Market Data

The Go SDK exposes all market-data endpoints through QuoteClient. Every method returns a strongly-typed struct from the model package — no manual json.Unmarshal required.

A complete runnable example:

package main

import (
	"fmt"
	"log"

	"github.com/tigerfintech/openapi-go-sdk/client"
	"github.com/tigerfintech/openapi-go-sdk/config"
	"github.com/tigerfintech/openapi-go-sdk/quote"
)

func main() {
	cfg, err := config.NewClientConfig()
	if err != nil {
		log.Fatal(err)
	}

	// Use the quote HTTP client (automatically uses the quote server URL)
	qc := quote.NewQuoteClient(client.NewQuoteHttpClient(cfg))

	// Market status
	states, err := qc.GetMarketState("US")
	if err != nil {
		log.Fatal(err)
	}
	for _, s := range states {
		fmt.Printf("%s status=%s openTime=%s\n", s.Market, s.MarketStatus, s.OpenTime)
	}

	// Real-time quotes
	briefs, err := qc.GetBrief(model.BriefRequest{Symbols: []string{"AAPL", "TSLA"}})
	if err != nil {
		log.Fatal(err)
	}
	for _, b := range briefs {
		fmt.Printf("%s latestPrice=%.2f change=%.2f\n", b.Symbol, b.LatestPrice, b.Change)
	}

	// K-line
	klines, err := qc.GetKline("AAPL", "day")
	if err != nil {
		log.Fatal(err)
	}
	if len(klines) > 0 {
		fmt.Printf("%s bars=%d\n", klines[0].Symbol, len(klines[0].Items))
	}
}

Basic market data

GetMarketState — market status

qc.GetMarketState(market string) ([]model.MarketState, error)

Description

Queries the current trading status of the specified market.

Parameters

NameTypeRequiredDescription
marketstringYesMarket code: US / HK / CN / SG

Returns

[]model.MarketState

FieldTypeDescription
MarketstringMarket code
MarketStatusstringHuman-readable status, e.g. "Trading" / "Not Yet Opened"
StatusstringEnum like NOT_YET_OPEN / TRADING
OpenTimestringNext open time label

Example

states, err := qc.GetMarketState("US")
if err != nil {
    log.Fatal(err)
}
for _, s := range states {
    fmt.Printf("%s %s %s\n", s.Market, s.MarketStatus, s.OpenTime)
}

GetBrief — real-time quotes

qc.GetBrief(req model.BriefRequest) ([]model.Brief, error)

Breaking in v0.3.0: positional symbols []string was replaced with a Request struct.

Description

Batch fetch real-time snapshots for a list of symbols.

Request — model.BriefRequest

FieldTypeRequiredDescription
Symbols[]stringYesStock codes
IncludeHourTrading*boolNoInclude pre/post-market trading
SecTypestringNoSecurity type, e.g. STK / OPT
LangstringNoLanguage, e.g. zh_CN / en_US

Returns

[]model.Brief

FieldTypeDescription
SymbolstringCode
LatestPricefloat64Latest price
PreClosefloat64Previous close
Open / High / Low / Closefloat64OHLC
Change / ChangeRatefloat64Change / change rate
Volumeint64Volume
BidPrice / AskPricefloat64Best bid / ask price
BidSize / AskSizeint64Best bid / ask size
LatestTimeint64Latest tick time (ms timestamp)
StatusstringTrading status

Example

briefs, err := qc.GetBrief(model.BriefRequest{
    Symbols: []string{"AAPL", "TSLA", "00700"},
})
if err != nil {
    log.Fatal(err)
}
for _, b := range briefs {
    fmt.Printf("%s %.2f (%.2f%%)\n", b.Symbol, b.LatestPrice, b.ChangeRate*100)
}

GetKline — K-line data

qc.GetKline(symbol, period string) ([]model.Kline, error)

Description

Fetch historical candlesticks for a single symbol.

Parameters

NameTypeRequiredDescription
symbolstringYesStock code
periodstringYesPeriod: day / week / month / year / 1min / 5min / 15min / 30min / 60min

Returns

[]model.Kline

Each Kline contains Symbol, Period and Items []KlineItem; each KlineItem contains Time / Open / High / Low / Close / Volume / Amount.

Example

klines, err := qc.GetKline("AAPL", "day")
if err != nil {
    log.Fatal(err)
}
if len(klines) > 0 {
    for _, k := range klines[0].Items[:5] {
        fmt.Printf("%d O=%.2f H=%.2f L=%.2f C=%.2f V=%d\n",
            k.Time, k.Open, k.High, k.Low, k.Close, k.Volume)
    }
}

GetTimeline — intraday timeline

qc.GetTimeline(symbols []string) ([]model.Timeline, error)

Description

Fetch the current trading day's intraday timeline.

Parameters

NameTypeRequiredDescription
symbols[]stringYesStock codes

Returns

[]model.Timeline

Each Timeline contains Symbol / Period / PreClose / Intraday / PreHours / AfterHours. The last three are *TimelineBucket, each containing Items []TimelineItem (Time / Price / Volume / AvgPrice).

Example

tl, err := qc.GetTimeline([]string{"AAPL"})
if err != nil {
    log.Fatal(err)
}
if len(tl) > 0 && tl[0].Intraday != nil {
    fmt.Printf("intraday points=%d\n", len(tl[0].Intraday.Items))
}

GetTradeTick — trade ticks

qc.GetTradeTick(req model.TradeTickRequest) ([]model.TradeTick, error)

Breaking in v0.3.0: positional symbols []string was replaced with a Request struct.

Description

Fetch the latest trade-by-trade tick records.

Request — model.TradeTickRequest

FieldTypeRequiredDescription
Symbols[]stringYesStock codes
BeginIndexintNoStart index
EndIndexintNoEnd index
LimitintNoMax rows
LangstringNoLanguage

Returns

[]model.TradeTick

Each TradeTick contains Symbol / BeginIndex / EndIndex / Items []TradeTickItem. Each TradeTickItem has Time / Price / Volume / Type.

Example

ticks, err := qc.GetTradeTick(model.TradeTickRequest{Symbols: []string{"AAPL"}})
if err != nil {
    log.Fatal(err)
}
if len(ticks) > 0 {
    for _, t := range ticks[0].Items[:5] {
        fmt.Printf("%d price=%.2f vol=%d type=%s\n", t.Time, t.Price, t.Volume, t.Type)
    }
}

GetQuoteDepth — order book depth

qc.GetQuoteDepth(req model.DepthQuoteRequest) ([]model.Depth, error)

Breaking in v0.3.0: positional (symbol, market) was replaced with a Request struct; symbols is now batched.

Description

Fetch order-book depth. Supports US / HK markets only.

Request — model.DepthQuoteRequest

FieldTypeRequiredDescription
Symbols[]stringYesStock codes
MarketstringNoMarket: US / HK
TradeSessionstringNoTrade session
LangstringNoLanguage

Returns

[]model.Depth

Each Depth contains Symbol / Asks / Bids. Each DepthLevel contains Price / Count / Volume.

Example

depths, err := qc.GetQuoteDepth(model.DepthQuoteRequest{
    Symbols: []string{"AAPL"},
    Market:  "US",
})
if err != nil {
    log.Fatal(err)
}
if len(depths) > 0 {
    fmt.Printf("asks=%d bids=%d\n", len(depths[0].Asks), len(depths[0].Bids))
}

Options

GetOptionExpiration — option expirations

qc.GetOptionExpiration(symbol string) ([]model.OptionExpiration, error)

Description

List all option expiration dates for the underlying.

Returns

[]model.OptionExpiration

FieldTypeDescription
SymbolstringUnderlying code
Dates[]stringExpiration dates (YYYY-MM-DD)
Timestamps[]int64Expiration timestamps (ms)
OptionSymbols[]stringOption symbol codes

Example

exps, err := qc.GetOptionExpiration("AAPL")
if err != nil {
    log.Fatal(err)
}
if len(exps) > 0 {
    fmt.Printf("%s dates=%d first=%s\n", exps[0].Symbol, len(exps[0].Dates), exps[0].Dates[0])
}

GetOptionChain — option chain

qc.GetOptionChain(symbol, expiry string) ([]model.OptionChain, error)

Description

Fetch the full option chain for a given underlying and expiration date.

Parameters

NameTypeRequiredDescription
symbolstringYesUnderlying code
expirystringYesExpiration date, YYYY-MM-DD

Returns

[]model.OptionChain

Each OptionChain contains Symbol / Expiry / Items []OptionChainRow. Each OptionChainRow has Put / Call (*OptionLeg, with Identifier / Strike / Right / BidPrice / AskPrice / LatestPrice / Delta / Gamma / Theta / Vega / ImpliedVol, etc.).

Example

chain, err := qc.GetOptionChain("AAPL", "2026-06-19")
if err != nil {
    log.Fatal(err)
}
if len(chain) > 0 {
    for _, row := range chain[0].Items {
        if row.Call != nil {
            fmt.Printf("strike=%s call=%.2f IV=%.3f\n",
                row.Call.Strike, row.Call.LatestPrice, row.Call.ImpliedVol)
        }
    }
}

GetOptionBrief — option quotes

qc.GetOptionBrief(identifiers []string) ([]model.Brief, error)

Description

Batch fetch real-time quotes for option contracts.

Parameters

NameTypeRequiredDescription
identifiers[]stringYesOption identifiers; US format: "AAPL 260619C00200000" (note the two spaces)

Returns

[]model.Brief (shared with stock quotes; option-specific fields such as Expiry / Strike / Right / OpenInterest are also populated)

Example

briefs, err := qc.GetOptionBrief([]string{"AAPL  260619C00200000"})
if err != nil {
    log.Fatal(err)
}
for _, b := range briefs {
    fmt.Printf("%s latest=%.2f oi=%d\n", b.Symbol, b.LatestPrice, b.OpenInterest)
}

GetOptionKline — option K-line

qc.GetOptionKline(identifier, period string) ([]model.Kline, error)

Description

Fetch historical K-line data for an option contract.

Parameters

NameTypeRequiredDescription
identifierstringYesOption identifier
periodstringYesSame periods as stock K-line

Returns

[]model.Kline (same structure as GetKline)

Example

ks, err := qc.GetOptionKline("AAPL  260619C00200000", "day")
if err != nil {
    log.Fatal(err)
}
if len(ks) > 0 {
    fmt.Printf("bars=%d\n", len(ks[0].Items))
}

Futures

GetFutureExchange — futures exchanges

qc.GetFutureExchange() ([]model.FutureExchange, error)

Description

List all supported futures exchanges.

Returns

[]model.FutureExchange

FieldTypeDescription
CodestringExchange code, e.g. CME / HKEX
NamestringExchange name
ZoneIDstringTimezone, e.g. America/Chicago

Example

exs, err := qc.GetFutureExchange()
if err != nil {
    log.Fatal(err)
}
for _, e := range exs {
    fmt.Printf("%s %s (%s)\n", e.Code, e.Name, e.ZoneID)
}

GetFutureContracts — futures contracts

qc.GetFutureContracts(exchange string) ([]model.FutureContractInfo, error)

Description

List all tradable futures contracts for a given exchange.

Parameters

NameTypeRequiredDescription
exchangestringYesExchange code, e.g. CME

Returns

[]model.FutureContractInfo

FieldTypeDescription
ContractCodestringContract code, e.g. MEUR2609
TypestringProduct type code, e.g. MEUR
NamestringContract name
ContractMonthstringDelivery month
LastTradingDatestringLast trading date
Multiplierfloat64Contract multiplier
MinTickfloat64Minimum price increment
CurrencystringCurrency
ExchangestringExchange
Continuous / TradeboolContinuous contract / tradable

Example

cs, err := qc.GetFutureContracts("CME")
if err != nil {
    log.Fatal(err)
}
fmt.Printf("contracts=%d first=%s\n", len(cs), cs[0].ContractCode)

GetFutureRealTimeQuote — futures real-time quotes

qc.GetFutureRealTimeQuote(req model.FutureBriefRequest) ([]model.FutureQuote, error)

Breaking in v0.3.0: positional contractCodes []string was replaced with a Request struct.

Description

Batch fetch real-time quotes for futures contracts.

Request — model.FutureBriefRequest

FieldTypeRequiredDescription
ContractCodes[]stringYesContract codes, e.g. ["CL2609", "ES2506"]
LangstringNoLanguage

Returns

[]model.FutureQuote

FieldTypeDescription
ContractCodestringContract code
LatestPrice / LatestSize / LatestTimefloat64/int64Latest trade
BidPrice / AskPrice / BidSize / AskSizefloat64/int64Best bid / ask
OpenInterest / OpenInterestChangeint64Open interest / change
Open / High / Low / Settlement / AvgPricefloat64Prices
Volumeint64Volume

Example

q, err := qc.GetFutureRealTimeQuote(model.FutureBriefRequest{
    ContractCodes: []string{"CL2609"},
})
if err != nil {
    log.Fatal(err)
}
for _, f := range q {
    fmt.Printf("%s latest=%.4f oi=%d\n", f.ContractCode, f.LatestPrice, f.OpenInterest)
}

GetFutureKline — futures K-line

qc.GetFutureKline(req model.FutureKlineRequest) ([]model.FutureKline, error)

Description

Fetch historical K-line data for a futures contract. Uses a Request struct because of the parameter count.

Request — model.FutureKlineRequest

FieldTypeRequiredDescription
ContractCodes[]stringYesContract codes
PeriodstringYesday / week / 1min / 5min / 15min / 30min / 60min
BeginTimeint64NoStart ms timestamp; 0 or -1 means unbounded
EndTimeint64NoEnd ms timestamp; 0 or -1 means unbounded
LimitintNoMax rows
PageTokenstringNoPagination token

Returns

[]model.FutureKline

Each FutureKline contains Items []FutureKlineItem (Time / Open / Close / High / Low / Volume / OpenInterest / Settlement) and NextPageToken.

Example

ks, err := qc.GetFutureKline(model.FutureKlineRequest{
    ContractCodes: []string{"CL2609"},
    Period:        "day",
    BeginTime:     -1,
    EndTime:       -1,
})
if err != nil {
    log.Fatal(err)
}
if len(ks) > 0 {
    fmt.Printf("bars=%d\n", len(ks[0].Items))
}

Fundamentals

GetFinancialDaily — daily financial data

qc.GetFinancialDaily(req model.FinancialDailyRequest) ([]model.FinancialDailyItem, error)

Description

Fetch daily financial metrics such as shares outstanding.

Request — model.FinancialDailyRequest

FieldTypeRequiredDescription
Symbols[]stringYesStock codes
MarketstringYesUS / HK / CN
Fields[]stringYesFields, e.g. ["shares_outstanding"]
BeginDatestringYesStart date YYYY-MM-DD
EndDatestringYesEnd date YYYY-MM-DD

Returns

[]model.FinancialDailyItem (Symbol / Field / Date / Value)

Example

items, err := qc.GetFinancialDaily(model.FinancialDailyRequest{
    Symbols:   []string{"AAPL"},
    Market:    "US",
    Fields:    []string{"shares_outstanding"},
    BeginDate: "2025-01-01",
    EndDate:   "2025-01-31",
})

Capital flow

GetCapitalFlow — capital flow time series

qc.GetCapitalFlow(symbol, market, period string) (*model.CapitalFlow, error)

Description

Fetch capital flow time series for a stock.

Parameters

NameTypeRequiredDescription
symbolstringYesStock code
marketstringYesMarket
periodstringYesintraday / day / week / month / year / quarter

Returns

*model.CapitalFlow (Symbol / Period / Items []CapitalFlowItem; each CapitalFlowItem has Time / Timestamp / NetInflow)

Example

cf, err := qc.GetCapitalFlow("AAPL", "US", "day")
if err != nil {
    log.Fatal(err)
}
fmt.Printf("%s period=%s rows=%d\n", cf.Symbol, cf.Period, len(cf.Items))

GetCapitalDistribution — capital distribution

qc.GetCapitalDistribution(symbol, market string) (*model.CapitalDistribution, error)

Description

Fetch the current capital distribution snapshot.

Returns

*model.CapitalDistribution

FieldTypeDescription
SymbolstringCode
NetInflowfloat64Net inflow
InAll / InBig / InMid / InSmallfloat64Total / big / mid / small inflow
OutAll / OutBig / OutMid / OutSmallfloat64Total / big / mid / small outflow

Example

cd, err := qc.GetCapitalDistribution("AAPL", "US")
if err != nil {
    log.Fatal(err)
}
fmt.Printf("%s netInflow=%.2f\n", cd.Symbol, cd.NetInflow)

Scanner

MarketScanner — stock scanner

qc.MarketScanner(req model.MarketScannerRequest) (*model.ScannerResult, error)

Description

Screen stocks by custom filter conditions.

Request — model.MarketScannerRequest

FieldTypeRequiredDescription
MarketstringYesMarket
PageintNoPage number (zero-based)
PageSizeintNoPage size
CursorIDstringNoPagination cursor
BaseFilterList[]map[string]interfaceNoBase field filters
AccumulateFilterList[]map[string]interfaceNoAccumulated field filters
FinancialFilterList[]map[string]interfaceNoFinancial field filters
MultiTagsFilterList[]map[string]interfaceNoMulti-tag filters
SortFieldDatamap[string]interfaceNoSort field

Returns

*model.ScannerResult (Page / TotalPage / TotalCount / PageSize / CursorID / Items []ScannerResultItem)

Each ScannerResultItem has Symbol / Market plus BaseDataList / AccumulateDataList / FinancialDataList / MultiTagDataList.

Example

res, err := qc.MarketScanner(model.MarketScannerRequest{
    Market:   "US",
    Page:     0,
    PageSize: 10,
})
if err != nil {
    log.Fatal(err)
}
fmt.Printf("page=%d/%d total=%d items=%d\n",
    res.Page, res.TotalPage, res.TotalCount, len(res.Items))

GrabQuotePermission — quote permissions

qc.GrabQuotePermission() ([]model.QuotePermission, error)

Description

List the quote permissions enabled for the current account.

Returns

[]model.QuotePermission (Name / ExpireAt)

Example

perms, err := qc.GrabQuotePermission()
if err != nil {
    log.Fatal(err)
}
for _, p := range perms {
    fmt.Printf("%s expireAt=%d\n", p.Name, p.ExpireAt)
}

GetMarketScannerTags — scanner tag metadata

qc.GetMarketScannerTags(req model.MarketScannerTagsRequest) (*model.MarketScannerTags, error)

Description

List the multi_tags fields and allowed values that can be used by MarketScanner.

Request: Market / MultiTagsFields []string / Lang.

Returns

*model.MarketScannerTags (TagFields / Tags []MarketScannerTag; each MarketScannerTag has Field / Name / Values)


Stock basics (new in v0.3.0)

GetSymbols — all symbol codes of a market

qc.GetSymbols(req model.SymbolsRequest) ([]string, error)

Description

List every tradable symbol code in the given market.

Request — model.SymbolsRequest

FieldTypeRequiredDescription
MarketstringNoMarket: US / HK / CN / SG
SecTypestringNoSecurity type
IncludeOtcboolNoWhether to include OTC
LangstringNoLanguage

Returns

[]string — list of symbol codes.

Example

symbols, err := qc.GetSymbols(model.SymbolsRequest{Market: "US"})
if err != nil {
    log.Fatal(err)
}
fmt.Printf("total=%d first=%s\n", len(symbols), symbols[0])

GetSymbolNames — symbols with names

qc.GetSymbolNames(req model.SymbolsRequest) ([]model.SymbolName, error)

Description

Same as GetSymbols, but also returns the Chinese and English names.

Returns

[]model.SymbolName (Symbol / Name / Market)

Example

items, err := qc.GetSymbolNames(model.SymbolsRequest{Market: "US"})
if err != nil {
    log.Fatal(err)
}
for _, it := range items[:5] {
    fmt.Printf("%s %s\n", it.Symbol, it.Name)
}

GetTradeMetas — trading metadata

qc.GetTradeMetas(req model.TradeMetasRequest) ([]model.TradeMeta, error)

Description

Trading metadata (minimum tick, lot size, shortable / marginable flags).

Request — model.TradeMetasRequest

FieldTypeRequiredDescription
Symbols[]stringYesStock codes
LangstringNoLanguage

Returns

[]model.TradeMeta (Symbol / LotSize / MinTick / SpreadScale / ShortableFlag / MarginableFlag)

Example

metas, err := qc.GetTradeMetas(model.TradeMetasRequest{Symbols: []string{"AAPL", "00700"}})
if err != nil {
    log.Fatal(err)
}
for _, m := range metas {
    fmt.Printf("%s lot=%d minTick=%.4f\n", m.Symbol, m.LotSize, m.MinTick)
}

GetStockDelayBriefs — delayed quotes

qc.GetStockDelayBriefs(req model.StockDelayBriefsRequest) ([]model.Brief, error)

Description

Delayed snapshots (same shape as the real-time GetBrief).

Request — model.StockDelayBriefsRequest

FieldTypeRequiredDescription
Symbols[]stringYesStock codes
SecTypestringNoSecurity type
LangstringNoLanguage

Example

briefs, err := qc.GetStockDelayBriefs(model.StockDelayBriefsRequest{
    Symbols: []string{"AAPL"},
})

GetBars — K-line (full)

qc.GetBars(req model.BarsRequest) ([]model.Kline, error)

Description

A richer K-line endpoint than GetKline, with time-range / index pagination, adjustment, and pre/post-market support.

Field naming: BeginTime / EndTime are millisecond timestamps (wire begin_time / end_time).

Request — model.BarsRequest

FieldTypeRequiredDescription
Symbols[]stringYesStock codes
PeriodstringNoday / week / month / year / 1min / 5min / 15min / 30min / 60min
RightstringNoAdjustment type: br / nr, etc.
BeginTimeint64NoStart ms timestamp
EndTimeint64NoEnd ms timestamp
LimitintNoMax rows
BeginIndexintNoStart index (mutually exclusive with time range)
EndIndexintNoEnd index
PageTokenstringNoPagination token
TradeSessionstringNoTrade session
DatestringNoTarget date
WithFundamental*boolNoInclude fundamentals
SecTypestringNoSecurity type
LangstringNoLanguage

Returns

[]model.Kline (same structure as GetKline)

Example

bars, err := qc.GetBars(model.BarsRequest{
    Symbols: []string{"AAPL"},
    Period:  "day",
    Limit:   100,
})
if err != nil {
    log.Fatal(err)
}
if len(bars) > 0 {
    fmt.Printf("bars=%d\n", len(bars[0].Items))
}

GetBarsByPage — client-side paginated K-line

qc.GetBarsByPage(req model.BarsByPageRequest) ([]model.KlineItem, error)

Description

Client-side pagination wrapper: repeatedly calls GetBars until the requested number of bars is collected, returned in ascending time order.

Request — model.BarsByPageRequest

FieldTypeRequiredDescription
SymbolstringYesSingle stock code
PeriodstringYesPeriod
BeginTimeint64NoStart ms timestamp
EndTimeint64NoEnd ms timestamp
TotalSizeintNoTotal bars to retrieve (default 1000)
PageSizeintNoBars per page (default 200)
RightstringNoAdjustment
TradeSessionstringNoTrade session
LangstringNoLanguage

Returns

[]model.KlineItem (flattened)

Example

items, err := qc.GetBarsByPage(model.BarsByPageRequest{
    Symbol:    "AAPL",
    Period:    "day",
    TotalSize: 500,
    PageSize:  200,
})
fmt.Printf("got %d bars\n", len(items))

GetTimelineHistory — historical intraday timeline

qc.GetTimelineHistory(req model.TimelineHistoryRequest) ([]model.Timeline, error)

Description

Intraday timeline for a historical trading day.

Request — model.TimelineHistoryRequest

FieldTypeRequiredDescription
Symbols[]stringYesStock codes
DatestringNoDate (yyyy-MM-dd)
RightstringNoAdjustment
TradeSessionstringNoTrade session
LangstringNoLanguage

Returns

[]model.Timeline (same shape as GetTimeline)

Example

tl, err := qc.GetTimelineHistory(model.TimelineHistoryRequest{
    Symbols: []string{"AAPL"},
    Date:    "2025-09-01",
})

GetTradeRank — trade ranking

qc.GetTradeRank(req model.TradeRankRequest) ([]model.TradeRankItem, error)

Description

Market trade-volume / turnover ranking board.

Request — model.TradeRankRequest

FieldTypeRequiredDescription
MarketstringYesMarket
LangstringNoLanguage

Returns

[]model.TradeRankItem (Symbol / Name / LatestPr / Change / ChangeRate / Volume / Amount)

Example

rank, err := qc.GetTradeRank(model.TradeRankRequest{Market: "HK"})
for _, r := range rank[:10] {
    fmt.Printf("%s %s amount=%.0f\n", r.Symbol, r.Name, r.Amount)
}

GetShortInterest — short interest

qc.GetShortInterest(req model.ShortInterestRequest) ([]model.ShortInterest, error)

Description

US short-interest data.

Request — model.ShortInterestRequest

FieldTypeRequiredDescription
Symbols[]stringYesStock codes
LangstringNoLanguage

Returns

[]model.ShortInterest (Symbol / SettlementDate / ShortInterest / AvgDailyVolume / DaysToCover / PercentOfFloat / ShortInterestPrevious / PercentChange)

Example

si, err := qc.GetShortInterest(model.ShortInterestRequest{Symbols: []string{"TSLA"}})

GetStockBroker — HK broker queue

qc.GetStockBroker(req model.StockBrokerRequest) (*model.StockBroker, error)

Description

HK broker queue for a stock (requires HK Level2 entitlement).

Request — model.StockBrokerRequest

FieldTypeRequiredDescription
SymbolstringYesSingle stock code
LimitintNoMax brokers per level
SecTypestringNoSecurity type
LangstringNoLanguage

Returns

*model.StockBroker (Symbol / LevelAskList / LevelBidList; each StockBrokerItem has Level / Price / Brokers []BrokerDetail)

Example

sb, err := qc.GetStockBroker(model.StockBrokerRequest{Symbol: "00700", Limit: 40})
if err != nil {
    log.Fatal(err)
}
fmt.Printf("%s askLevels=%d bidLevels=%d\n", sb.Symbol, len(sb.LevelAskList), len(sb.LevelBidList))

GetStockIndustry — GICS industry classification

qc.GetStockIndustry(req model.StockIndustryRequest) ([]model.StockIndustry, error)

Request — model.StockIndustryRequest

FieldTypeRequiredDescription
SymbolstringYesStock code
MarketstringNoMarket
SecTypestringNoSecurity type
LangstringNoLanguage

Returns

[]model.StockIndustry (Symbol / GSector / GGroup / GInd / GSubInd / Level)

Example

si, err := qc.GetStockIndustry(model.StockIndustryRequest{Symbol: "AAPL", Market: "US"})

GetQuotePermission — quote permissions with date range

qc.GetQuotePermission(req model.QuotePermissionRequest) ([]model.QuotePermission, error)

Description

Query quote permissions. Unlike the parameterless GrabQuotePermission, this variant accepts a date range and returns permissions valid in that window.

Request — model.QuotePermissionRequest

FieldTypeRequiredDescription
BeginDatestringNoStart date (yyyyMMdd)
EndDatestringNoEnd date (yyyyMMdd)
LangstringNoLanguage

Example

perms, err := qc.GetQuotePermission(model.QuotePermissionRequest{
    BeginDate: "20250101",
    EndDate:   "20251231",
})

GetKlineQuota — K-line call quota

qc.GetKlineQuota(req model.KlineQuotaRequest) ([]model.KlineQuota, error)

Description

Remaining call quota for the K-line APIs.

Request — model.KlineQuotaRequest

FieldTypeRequiredDescription
WithDetailsboolNoReturn per-symbol breakdown
LangstringNoLanguage

Returns

[]model.KlineQuota (Method / Used / Quota / Detail; each KlineQuotaDetail has Symbol / Market / UsedBars / QuotaBars / LastAccess)

Example

quota, err := qc.GetKlineQuota(model.KlineQuotaRequest{WithDetails: true})
for _, q := range quota {
    fmt.Printf("%s used=%d/%d\n", q.Method, q.Used, q.Quota)
}

Options (new in v0.3.0)

All option-extended methods share the OptionQueryItem nested type to precisely locate a single contract:

type OptionQueryItem struct {
    Symbol     string
    Expiry     int64  // ms timestamp
    Strike     string
    Right      string // CALL / PUT
    Period     string // only used by K-line / timeline
    BeginTime  int64
    EndTime    int64
    Limit      int
    BeginIndex int
    EndIndex   int
    PageToken  string
}

GetOptionBars — option K-line

qc.GetOptionBars(req model.OptionBarsRequest) ([]model.Kline, error)

Request — model.OptionBarsRequest: OptionQuery []OptionQueryItem / Market / Lang.

Example

bars, err := qc.GetOptionBars(model.OptionBarsRequest{
    OptionQuery: []model.OptionQueryItem{{
        Symbol: "AAPL", Expiry: 1750291200000, Strike: "200", Right: "CALL", Period: "day",
    }},
    Market: "US",
})

GetOptionTradeTicks — option trade ticks

qc.GetOptionTradeTicks(req model.OptionTradeTicksRequest) ([]model.TradeTick, error)

Request: Contracts []OptionQueryItem / Lang.

Example

ticks, err := qc.GetOptionTradeTicks(model.OptionTradeTicksRequest{
    Contracts: []model.OptionQueryItem{{Symbol: "AAPL", Expiry: 1750291200000, Strike: "200", Right: "CALL"}},
})

GetOptionTimeline — option intraday timeline

qc.GetOptionTimeline(req model.OptionTimelineRequest) ([]model.Timeline, error)

Request: OptionQuery []OptionQueryItem / Market / Lang.


GetOptionDepth — option depth

qc.GetOptionDepth(req model.OptionDepthRequest) ([]model.Depth, error)

Request: OptionBasic []OptionQueryItem / Market / Lang.


GetOptionSymbols — option symbol list

qc.GetOptionSymbols(req model.OptionSymbolsRequest) ([]model.OptionSymbol, error)

Request — model.OptionSymbolsRequest: Market / Lang.

Returns

[]model.OptionSymbol (Symbol / Market / NameCN / NameEN)

Example

syms, err := qc.GetOptionSymbols(model.OptionSymbolsRequest{Market: "US"})

GetOptionAnalysis — option volatility analysis

qc.GetOptionAnalysis(req model.OptionAnalysisRequest) ([]model.OptionAnalysis, error)

Request — model.OptionAnalysisRequest

FieldTypeRequiredDescription
Symbols[]stringYesUnderlying codes
MarketstringNoMarket
PeriodstringNoHistorical volatility period
RequireVolatilityListboolNoReturn historical volatility series
LangstringNoLanguage

Returns

[]model.OptionAnalysis (Symbol / HistoricalVol30D / HistoricalVol60D / HistoricalVol90D / ImpliedVol / VolatilityList)

Example

res, err := qc.GetOptionAnalysis(model.OptionAnalysisRequest{
    Symbols: []string{"AAPL"},
    Market:  "US",
})

Futures (new in v0.3.0)

GetFutureContract — lookup by contract code

qc.GetFutureContract(req model.FutureContractSingleRequest) ([]model.FutureContractInfo, error)

Request — model.FutureContractSingleRequest: ContractCode / Type / Lang.

Example

cs, err := qc.GetFutureContract(model.FutureContractSingleRequest{ContractCode: "CL2609"})

GetAllFutureContracts — all contracts of a product

qc.GetAllFutureContracts(req model.AllFutureContractsRequest) ([]model.FutureContractInfo, error)

Request — model.AllFutureContractsRequest: Type / Exchange / Lang.

Example

cs, err := qc.GetAllFutureContracts(model.AllFutureContractsRequest{Type: "CL"})

GetCurrentFutureContract — current main contract

qc.GetCurrentFutureContract(req model.FutureContractSingleRequest) (*model.FutureContractInfo, error)

Example

c, err := qc.GetCurrentFutureContract(model.FutureContractSingleRequest{Type: "CL"})
fmt.Printf("current main: %s\n", c.ContractCode)

GetFutureContinuousContracts — continuous contracts

qc.GetFutureContinuousContracts(req model.FutureContinuousContractsRequest) ([]model.FutureContractInfo, error)

Request: Type / Lang.


GetFutureHistoryMainContract — historical main contract

qc.GetFutureHistoryMainContract(req model.FutureHistoryMainContractRequest) ([]model.FutureMainContractHistory, error)

Request — model.FutureHistoryMainContractRequest

FieldTypeRequiredDescription
ContractCodes[]stringYesContract codes
BeginTimeint64NoStart ms timestamp
EndTimeint64NoEnd ms timestamp
LangstringNoLanguage

Returns

[]model.FutureMainContractHistory (ContractCode / Symbol / BeginDate / EndDate)


GetFutureBars — futures K-line (with index pagination)

qc.GetFutureBars(req model.FutureBarsRequest) ([]model.FutureKline, error)

Request — model.FutureBarsRequest

FieldTypeRequiredDescription
ContractCodes[]stringNoContract codes
ContractCodestringNoSingle contract code
PeriodstringYesPeriod
BeginTimeint64NoStart ms timestamp
EndTimeint64NoEnd ms timestamp
BeginIndex / EndIndexintNoIndex pagination
LimitintNoMax rows
PageTokenstringNoPagination token
LangstringNoLanguage

Example

bars, err := qc.GetFutureBars(model.FutureBarsRequest{
    ContractCodes: []string{"CL2609"},
    Period:        "day",
    Limit:         200,
})

GetFutureBarsByPage — client-side paginated futures K-line

qc.GetFutureBarsByPage(req model.FutureBarsByPageRequest) ([]model.FutureKlineItem, error)

Request — model.FutureBarsByPageRequest

FieldTypeRequiredDescription
ContractCodestringYesContract code
PeriodstringYesPeriod
BeginTimeint64NoStart ms timestamp
EndTimeint64NoEnd ms timestamp
TotalSizeintNoTotal bars to retrieve
PageSizeintNoBars per page
LangstringNoLanguage

GetFutureTradeTicks — futures trade ticks

qc.GetFutureTradeTicks(req model.FutureTradeTicksRequest) ([]model.FutureTradeTickItem, error)

Request — model.FutureTradeTicksRequest

FieldTypeRequiredDescription
ContractCodestringYesContract code
BeginIndex / EndIndexintNoIndex pagination
LimitintNoMax rows
LangstringNoLanguage

Returns

[]model.FutureTradeTickItem (ContractCode / Index / Time / Price / Volume / Direction)


GetFutureDepth — futures depth

qc.GetFutureDepth(req model.FutureDepthRequest) ([]model.FutureDepth, error)

Request: ContractCodes []string / Lang.

Returns

[]model.FutureDepth (ContractCode / Timestamp / Asks / Bids)


GetFutureTradingTimes — futures trading sessions

qc.GetFutureTradingTimes(req model.FutureTradingTimesRequest) (*model.FutureTradingTime, error)

Request — model.FutureTradingTimesRequest

FieldTypeRequiredDescription
ContractCodestringYesContract code
TradingDatestringNoTrading date
LangstringNoLanguage

Returns

*model.FutureTradingTime (ContractCode / BizDate / Zone / TradingTimes []FutureTradingSegment; each FutureTradingSegment has Start / End / Type)


Funds (new in v0.3.0)

GetFundSymbols — fund symbol list

qc.GetFundSymbols(req model.FundSymbolsRequest) ([]string, error)

Request: Lang.


GetFundContracts — fund contract metadata

qc.GetFundContracts(req model.FundContractsRequest) ([]model.FundContractInfo, error)

Request: Symbols []string / Lang.

Returns

[]model.FundContractInfo (Symbol / Name / Currency / FundType / Inception / NetAssetVal / ExpenseRatio)


GetFundQuote — fund NAV quote

qc.GetFundQuote(req model.FundQuoteRequest) ([]model.FundQuote, error)

Request: Symbols []string / Lang.

Returns

[]model.FundQuote (Symbol / LatestNav / Change / ChangeRate / Date)

Example

q, err := qc.GetFundQuote(model.FundQuoteRequest{Symbols: []string{"SPY"}})

GetFundHistoryQuote — fund NAV history

qc.GetFundHistoryQuote(req model.FundHistoryQuoteRequest) ([]model.FundHistoryQuote, error)

Request — model.FundHistoryQuoteRequest

FieldTypeRequiredDescription
Symbols[]stringYesFund symbols
BeginTimeint64NoStart ms timestamp
EndTimeint64NoEnd ms timestamp
LimitintNoMax rows
LangstringNoLanguage

Returns

[]model.FundHistoryQuote (Symbol / Date / Nav)


Warrants (new in v0.3.0)

GetWarrantBriefs — warrant quotes

qc.GetWarrantBriefs(req model.WarrantBriefsRequest) ([]model.WarrantBrief, error)

Request: Symbols []string / Lang.

Returns

[]model.WarrantBrief (Symbol / Name / LatestPrice / Change / ChangeRate / Volume / Amount / Underlying / Issuer / ExpiryDate / StrikePrice / WarrantType)


GetWarrantFilter — warrant screener

qc.GetWarrantFilter(req model.WarrantFilterRequest) (*model.WarrantFilterResult, error)

Request — model.WarrantFilterRequest

FieldTypeRequiredDescription
SymbolstringYesUnderlying code
Page / PageSizeintNoPagination
SortFieldName / SortDirstringNoSort
IssuerNamestringNoFilter by issuer
ExpireYmstringNoFilter by expiry year-month (yyyyMM)
LangstringNoLanguage

Returns

*model.WarrantFilterResult (Total / Items / PageSize / Page)


Industries (new in v0.3.0)

GetIndustryList — industry list

qc.GetIndustryList(req model.IndustryListRequest) ([]model.IndustryItem, error)

Request — model.IndustryListRequest: IndustryLevel / Lang.

Returns

[]model.IndustryItem (ID / Name / Level)


GetIndustryStocks — stocks in an industry

qc.GetIndustryStocks(req model.IndustryStocksRequest) ([]model.IndustryStock, error)

Request — model.IndustryStocksRequest: IndustryID / Market / Lang.

Returns

[]model.IndustryStock (Symbol / Name / IndustryID / Change / ChangeRate)


Financials & calendar (new in v0.3.0)

GetFinancialCurrency — financial reporting currency

qc.GetFinancialCurrency(req model.FinancialCurrencyRequest) ([]model.FinancialCurrency, error)

Request: Symbols []string / Market / Lang.

Returns

[]model.FinancialCurrency (Symbol / Market / Currency)


GetFinancialExchangeRate — FX rates

qc.GetFinancialExchangeRate(req model.FinancialExchangeRateRequest) ([]model.ExchangeRate, error)

Request — model.FinancialExchangeRateRequest

FieldTypeRequiredDescription
CurrencyList[]stringYesCurrency list, e.g. ["USD", "HKD"]
BeginDatestringNoStart date (yyyyMMdd)
EndDatestringNoEnd date (yyyyMMdd)
TimezonestringNoTimezone
LangstringNoLanguage

Note: BeginDate / EndDate here use the yyyyMMdd format (no dashes), different from the millisecond timestamps used for K-lines.

Returns

[]model.ExchangeRate (Currency / Date / Rate / BaseCurrency)

Example

rates, err := qc.GetFinancialExchangeRate(model.FinancialExchangeRateRequest{
    CurrencyList: []string{"HKD", "EUR"},
    BeginDate:    "20250101",
    EndDate:      "20250131",
})

GetTradingCalendar — trading calendar

qc.GetTradingCalendar(req model.TradingCalendarRequest) ([]model.TradingCalendarItem, error)

Request — model.TradingCalendarRequest

FieldTypeRequiredDescription
MarketstringYesMarket
BeginDatestringNoStart date (yyyy-MM-dd)
EndDatestringNoEnd date (yyyy-MM-dd)
LangstringNoLanguage

Returns

[]model.TradingCalendarItem (Market / Date / IsTrading / SessionType)

Example

cal, err := qc.GetTradingCalendar(model.TradingCalendarRequest{
    Market:    "US",
    BeginDate: "2025-01-01",
    EndDate:   "2025-12-31",
})