Securities

GetSymbols

Purpose

Retrieves symbols data and decodes it into the published Go return model.

Signature

func (c *QuoteClient) GetSymbols(req model.SymbolsRequest) ([]string, error)

Availability depends on market, instrument, and enabled data access.

Parameters

model.SymbolsRequest

SDK fieldTypeRequiredSerializationSDK default and constraints
MarketstringNoOmitted if emptyAllowed values: ALL, US, HK, CN, SG
SecTypestringNoOmitted if emptyAllowed values: ALL, STK, OPT, WAR, IOPT, FUT, FOP, CASH, MLEG, FUND
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US

Returns

([]string, error)

Invocation example

result, err := qc.GetSymbols(model.SymbolsRequest{
	Market: "US",
	SecType: "STK",
	Lang: "en_US",
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  "AAPL",
  "MSFT",
  "GOOGL",
  "AMZN",
  "TSLA"
]

GetSymbolNames

Purpose

Retrieves symbol names data and decodes it into the published Go return model.

Signature

func (c *QuoteClient) GetSymbolNames(req model.SymbolsRequest) ([]model.SymbolName, error)

Availability depends on market, instrument, and enabled data access.

Parameters

model.SymbolsRequest

SDK fieldTypeRequiredSerializationSDK default and constraints
MarketstringNoOmitted if emptyAllowed values: ALL, US, HK, CN, SG
SecTypestringNoOmitted if emptyAllowed values: ALL, STK, OPT, WAR, IOPT, FUT, FOP, CASH, MLEG, FUND
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US

Returns

([]model.SymbolName, error). Key fields from model.SymbolName:

FieldTypeJSON field
Symbolstringsymbol
Namestringname
Marketstringmarket

Invocation example

result, err := qc.GetSymbolNames(model.SymbolsRequest{
	Market: "US",
	SecType: "STK",
	Lang: "en_US",
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "symbol": "AAPL",
    "name": "Apple Inc",
    "market": "US"
  },
  {
    "symbol": "MSFT",
    "name": "Microsoft Corp",
    "market": "US"
  },
  {
    "symbol": "GOOGL",
    "name": "Alphabet Inc",
    "market": "US"
  }
]

GetTradeMetas

Purpose

Retrieves trade metas data and decodes it into the published Go return model.

Signature

func (c *QuoteClient) GetTradeMetas(req model.TradeMetasRequest) ([]model.TradeMeta, error)

Availability depends on market, instrument, and enabled data access.

Parameters

model.TradeMetasRequest

SDK fieldTypeRequiredSerializationSDK default and constraints
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US

Returns

([]model.TradeMeta, error). Key fields from model.TradeMeta:

FieldTypeJSON field
Symbolstringsymbol
LotSizeintlotSize
MinTickfloat64minTick
SpreadScalefloat64spreadScale
ShortableFlagstringshortableFlag
MarginableFlagstringmarginableFlag

Invocation example

result, err := qc.GetTradeMetas(model.TradeMetasRequest{
	Symbols: []string{"AAPL"},
	Lang: "en_US",
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "symbol": "AAPL",
    "lotSize": 1,
    "minTick": 0.01,
    "spreadScale": 0.01,
    "shortableFlag": "Y",
    "marginableFlag": "Y"
  }
]

GetRealTimeQuote

Purpose

Retrieves real time quote data and decodes it into the published Go return model.

Signature

func (c *QuoteClient) GetRealTimeQuote(req model.BriefRequest) ([]model.Brief, error)

Availability depends on market, instrument, and enabled data access.

Parameters

model.BriefRequest

SDK fieldTypeRequiredSerializationSDK default and constraints
SecTypestringNoOmitted if emptyAllowed values: ALL, STK, OPT, WAR, IOPT, FUT, FOP, CASH, MLEG, FUND
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US

Returns

([]model.Brief, error). Key fields from model.Brief:

FieldTypeJSON field
Symbolstringsymbol
Openfloat64open
Highfloat64high
Lowfloat64low
Closefloat64close
PreClosefloat64preClose
LatestPricefloat64latestPrice
LatestTimeint64latestTime
AskPricefloat64askPrice
AskSizeint64askSize
BidPricefloat64bidPrice
BidSizeint64bidSize
Volumeint64volume
Statusstringstatus

Invocation example

result, err := qc.GetRealTimeQuote(model.BriefRequest{
	Symbols: []string{"AAPL"},
	SecType: "STK",
	Lang: "en_US",
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "symbol": "AAPL",
    "open": 304.81,
    "high": 310.69,
    "low": 300.0,
    "close": 308.91,
    "preClose": 333.43,
    "latestPrice": 308.91,
    "latestTime": 1785528000000,
    "askPrice": 310.97,
    "askSize": 400,
    "bidPrice": 310.89,
    "bidSize": 80,
    "volume": 176739024,
    "status": "NORMAL"
  }
]

GetDelayedQuote

Purpose

Retrieves delayed quote data and decodes it into the published Go return model.

Signature

func (c *QuoteClient) GetDelayedQuote(req model.StockDelayBriefsRequest) ([]model.Brief, error)

Retrieves delayed quotes.

Parameters

model.StockDelayBriefsRequest

SDK fieldTypeRequiredSerializationSDK default and constraints
SecTypestringNoOmitted if emptyAllowed values: ALL, STK, OPT, WAR, IOPT, FUT, FOP, CASH, MLEG, FUND
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US

Returns

([]model.Brief, error). Key fields from model.Brief:

FieldTypeJSON field
Symbolstringsymbol
Openfloat64open
Highfloat64high
Lowfloat64low
Closefloat64close
PreClosefloat64preClose
LatestPricefloat64latestPrice
LatestTimeint64latestTime
AskPricefloat64askPrice
AskSizeint64askSize
BidPricefloat64bidPrice
BidSizeint64bidSize
Volumeint64volume
Statusstringstatus

Invocation example

result, err := qc.GetDelayedQuote(model.StockDelayBriefsRequest{
	Symbols: []string{"AAPL"},
	SecType: "STK",
	Lang: "en_US",
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "symbol": "AAPL",
    "open": 304.81,
    "high": 310.69,
    "low": 300.0,
    "close": 308.91,
    "preClose": 333.43,
    "latestPrice": 308.91,
    "latestTime": 1785528000000,
    "askPrice": 310.97,
    "askSize": 400,
    "bidPrice": 310.89,
    "bidSize": 80,
    "volume": 176739024,
    "status": "NORMAL"
  }
]

GetKline

Purpose

Retrieves kline data and decodes it into the published Go return model.

Signature

func (c *QuoteClient) GetKline(req model.KlineRequest) ([]model.Kline, error)

Availability depends on market, instrument, and enabled data access.

Parameters

model.KlineRequest

SDK fieldTypeRequiredSerializationSDK default and constraints
PeriodstringNoOmitted if emptyAllowed values: day, week, month, year, 1min, 5min, 15min, 30min, 60min
RightstringNoOmitted if emptyAllowed values: PUT, CALL (option side); br, nr when used as quote adjustment
BeginTimeint64NoOmitted if emptyNone; mutually exclusive with BeginIndex/EndIndex; millisecond timestamp
EndTimeint64NoOmitted if emptyNone; mutually exclusive with BeginIndex/EndIndex; millisecond timestamp
SecTypestringNoOmitted if emptyAllowed values: ALL, STK, OPT, WAR, IOPT, FUT, FOP, CASH, MLEG, FUND
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US

Returns

([]model.Kline, error). Key fields from model.Kline:

FieldTypeJSON field
Symbolstringsymbol
Periodstringperiod
NextPageTokenstringnextPageToken
Items[]KlineItemitems

Invocation example

result, err := qc.GetKline(model.KlineRequest{
	Symbols: []string{"AAPL"},
	Period: "day",
	Right: "CALL",
	BeginTime: 1735689600000,
	EndTime: 1738281600000,
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "symbol": "AAPL",
    "period": "day",
    "nextPageToken": null,
    "items": [
      {
        "time": 1785384000000,
        "volume": 74817792,
        "open": 333.10,
        "close": 333.43,
        "high": 334.75,
        "low": 329.59,
        "amount": 24701334239.0
      },
      {
        "time": 1785470400000,
        "volume": 132489137,
        "open": 304.81,
        "close": 308.91,
        "high": 310.69,
        "low": 300.0,
        "amount": 40348574927.0
      }
    ]
  }
]

GetKlineByPage

Purpose

Retrieves kline by page data and decodes it into the published Go return model. The client performs client-side pagination and merges pages.

Signature

func (c *QuoteClient) GetKlineByPage(req model.KlineByPageRequest) ([]model.KlineItem, error)

Availability depends on market, instrument, and enabled data access.

Parameters

model.KlineByPageRequest

SDK fieldTypeRequiredSerializationSDK default and constraints
PeriodstringNoOmitted if emptyAllowed values: day, week, month, year, 1min, 5min, 15min, 30min, 60min
RightstringNoOmitted if emptyAllowed values: PUT, CALL (option side); br, nr when used as quote adjustment
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US

Returns

([]model.KlineItem, error). Key fields from model.KlineItem:

FieldTypeJSON field
Timeint64time
Volumeint64volume
Openfloat64open
Closefloat64close
Highfloat64high
Lowfloat64low
Amountfloat64amount

Invocation example

result, err := qc.GetKlineByPage(model.KlineByPageRequest{
	Symbol: "AAPL",
	Period: "day",
	BeginTime: 1735689600000,
	EndTime: 1738281600000,
	TotalSize: 100,
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "time": 1785384000000,
    "volume": 74817792,
    "open": 333.10,
    "close": 333.43,
    "high": 334.75,
    "low": 329.59,
    "amount": 24701334239.0
  },
  {
    "time": 1785470400000,
    "volume": 132489137,
    "open": 304.81,
    "close": 308.91,
    "high": 310.69,
    "low": 300.0,
    "amount": 40348574927.0
  }
]

GetTimeline

Purpose

Retrieves timeline data and decodes it into the published Go return model.

Signature

func (c *QuoteClient) GetTimeline(symbols []string) ([]model.Timeline, error)

Availability depends on market, instrument, and enabled data access.

Parameters

ParameterTypeRequiredSDK defaultConstraints
symbols[]stringYesNoneInstrument symbols; the SDK does not enforce a batch limit

Returns

([]model.Timeline, error). Key fields from model.Timeline:

FieldTypeJSON field
Symbolstringsymbol
Periodstringperiod
PreClosefloat64preClose
Intraday*TimelineBucketintraday
PreHours*TimelineBucketpreHours
AfterHours*TimelineBucketafterHours

Invocation example

result, err := qc.GetTimeline([]string{"AAPL"})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "symbol": "AAPL",
    "period": "day",
    "preClose": 333.43,
    "intraday": {
      "items": [
        {"time": 1785504600000, "price": 304.05, "avgPrice": 304.77, "volume": 3808851},
        {"time": 1785504660000, "price": 301.93, "avgPrice": 304.60, "volume": 1704737},
        {"time": 1785504720000, "price": 302.03, "avgPrice": 304.24, "volume": 2029081}
      ]
    },
    "preHours": null,
    "afterHours": null
  }
]

GetTimelineHistory

Purpose

Retrieves timeline history data and decodes it into the published Go return model.

Signature

func (c *QuoteClient) GetTimelineHistory(req model.TimelineHistoryRequest) ([]model.Timeline, error)

Availability depends on market, instrument, and enabled data access.

Parameters

model.TimelineHistoryRequest

SDK fieldTypeRequiredSerializationSDK default and constraints
DatestringNoOmitted if emptyNone; yyyy-MM-dd
RightstringNoOmitted if emptyAllowed values: PUT, CALL (option side); br, nr when used as quote adjustment
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US

Returns

([]model.Timeline, error). Key fields from model.Timeline:

FieldTypeJSON field
Symbolstringsymbol
Periodstringperiod
PreClosefloat64preClose
Intraday*TimelineBucketintraday
PreHours*TimelineBucketpreHours
AfterHours*TimelineBucketafterHours

Invocation example

result, err := qc.GetTimelineHistory(model.TimelineHistoryRequest{
	Symbols: []string{"AAPL"},
	Date: "2025-01-15",
	Right: "CALL",
	Lang: "en_US",
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "symbol": "AAPL",
    "period": "day",
    "preClose": 333.43,
    "intraday": {
      "items": [
        {"time": 1785504600000, "price": 304.05, "avgPrice": 304.77, "volume": 3808851},
        {"time": 1785504660000, "price": 301.93, "avgPrice": 304.60, "volume": 1704737},
        {"time": 1785504720000, "price": 302.03, "avgPrice": 304.24, "volume": 2029081}
      ]
    },
    "preHours": null,
    "afterHours": null
  }
]

GetTradeTick

Purpose

Retrieves trade tick data and decodes it into the published Go return model.

Signature

func (c *QuoteClient) GetTradeTick(req model.TradeTickRequest) ([]model.TradeTick, error)

Availability depends on market, instrument, and enabled data access.

Parameters

model.TradeTickRequest

SDK fieldTypeRequiredSerializationSDK default and constraints
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US

Returns

([]model.TradeTick, error). Key fields from model.TradeTick:

FieldTypeJSON field
Symbolstringsymbol
BeginIndexint64beginIndex
EndIndexint64endIndex
Items[]TradeTickItemitems

Invocation example

result, err := qc.GetTradeTick(model.TradeTickRequest{
	Symbols: []string{"AAPL"},
	Limit: 20,
	Lang: "en_US",
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "symbol": "AAPL",
    "beginIndex": 2062878,
    "endIndex": 2062880,
    "items": [
      {"time": 1785528000829, "volume": 36, "price": 308.91, "type": "-"},
      {"time": 1785528000899, "volume": 1, "price": 309.0, "type": "*"}
    ]
  }
]

GetQuoteDepth

Purpose

Retrieves quote depth data and decodes it into the published Go return model.

Signature

func (c *QuoteClient) GetQuoteDepth(req model.DepthQuoteRequest) ([]model.Depth, error)

Availability depends on market, instrument, and enabled data access.

Parameters

model.DepthQuoteRequest

SDK fieldTypeRequiredSerializationSDK default and constraints
MarketstringNoOmitted if emptyAllowed values: ALL, US, HK, CN, SG
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US

Returns

([]model.Depth, error). Key fields from model.Depth:

FieldTypeJSON field
Symbolstringsymbol
Asks[]DepthLevelasks
Bids[]DepthLevelbids

Invocation example

result, err := qc.GetQuoteDepth(model.DepthQuoteRequest{
	Symbols: []string{"AAPL"},
	Market: "US",
	Lang: "en_US",
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "symbol": "AAPL",
    "asks": [
      {"price": 310.97, "volume": 400, "count": 0},
      {"price": 310.98, "volume": 200, "count": 0},
      {"price": 311.00, "volume": 1500, "count": 0}
    ],
    "bids": [
      {"price": 310.89, "volume": 80, "count": 0},
      {"price": 310.88, "volume": 300, "count": 0},
      {"price": 310.85, "volume": 600, "count": 0}
    ]
  }
]

GetCapitalFlow

Purpose

Retrieves capital flow data and decodes it into the published Go return model.

Signature

func (c *QuoteClient) GetCapitalFlow(symbol, market, period string) (*model.CapitalFlow, error)

Availability depends on market, instrument, and enabled data access.

Parameters

ParameterTypeRequiredSDK defaultConstraints
symbolstringYesNoneInstrument or underlying symbol
marketstringYesNoneMarket code; SDK enum values are ALL/US/HK/CN/SG
periodstringYesNoneBar period; see the BarPeriod enum

Returns

(*model.CapitalFlow, error). Key fields from model.CapitalFlow:

FieldTypeJSON field
Symbolstringsymbol
Periodstringperiod
Items[]CapitalFlowItemitems

Invocation example

result, err := qc.GetCapitalFlow("AAPL", "US", "day")
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
{
  "symbol": "AAPL",
  "period": "day",
  "items": [
    {"time": 1785470400000, "netInflow": -52341890.50, "inBig": 182345000.0, "inMid": 95432100.0, "inSmall": 23456000.0, "outBig": 195678900.0, "outMid": 98765400.0, "outSmall": 59131690.5}
  ]
}

GetCapitalDistribution

Purpose

Retrieves capital distribution data and decodes it into the published Go return model.

Signature

func (c *QuoteClient) GetCapitalDistribution(symbol, market string) (*model.CapitalDistribution, error)

Availability depends on market, instrument, and enabled data access.

Parameters

ParameterTypeRequiredSDK defaultConstraints
symbolstringYesNoneInstrument or underlying symbol
marketstringYesNoneMarket code; SDK enum values are ALL/US/HK/CN/SG

Returns

(*model.CapitalDistribution, error). Key fields from model.CapitalDistribution:

FieldTypeJSON field
Symbolstringsymbol
NetInflowfloat64netInflow
InAllfloat64inAll
InBigfloat64inBig
InMidfloat64inMid
InSmallfloat64inSmall
OutAllfloat64outAll
OutBigfloat64outBig
OutMidfloat64outMid
OutSmallfloat64outSmall

Invocation example

result, err := qc.GetCapitalDistribution("AAPL", "US")
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
{
  "symbol": "AAPL",
  "netInflow": -52341890.50,
  "inAll": 301233100.0,
  "inBig": 182345000.0,
  "inMid": 95432100.0,
  "inSmall": 23456000.0,
  "outAll": 353574990.50,
  "outBig": 195678900.0,
  "outMid": 98765400.0,
  "outSmall": 59130690.50
}

GetTradeRank

Purpose

Retrieves trade rank data and decodes it into the published Go return model.

Signature

func (c *QuoteClient) GetTradeRank(req model.TradeRankRequest) ([]model.TradeRankItem, error)

Availability depends on market, instrument, and enabled data access.

Parameters

model.TradeRankRequest

SDK fieldTypeRequiredSerializationSDK default and constraints
MarketstringNoOmitted if emptyAllowed values: ALL, US, HK, CN, SG
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US

Returns

([]model.TradeRankItem, error). Key fields from model.TradeRankItem:

FieldTypeJSON field
Symbolstringsymbol
Namestringname
LatestPrfloat64latestPrice
Changefloat64change
ChangeRatefloat64changeRate
Volumeint64volume
Amountfloat64amount

Invocation example

result, err := qc.GetTradeRank(model.TradeRankRequest{
	Market: "US",
	Lang: "en_US",
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "symbol": "NVDA",
    "name": "NVIDIA Corp",
    "latestPrice": 132.15,
    "change": 8.42,
    "changeRate": 0.068,
    "volume": 385241000,
    "amount": 50871234567.0
  },
  {
    "symbol": "TSLA",
    "name": "Tesla Inc",
    "latestPrice": 285.50,
    "change": 12.30,
    "changeRate": 0.045,
    "volume": 112456000,
    "amount": 32089765432.0
  }
]

GetShortInterest

Purpose

Retrieves short interest data and decodes it into the published Go return model.

Signature

func (c *QuoteClient) GetShortInterest(req model.ShortInterestRequest) ([]model.ShortInterest, error)

Availability depends on market, instrument, and enabled data access.

Parameters

model.ShortInterestRequest

SDK fieldTypeRequiredSerializationSDK default and constraints
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US

Returns

([]model.ShortInterest, error). Key fields from model.ShortInterest:

FieldTypeJSON field
Symbolstringsymbol
SettlementDatestringsettlementDate
ShortInterestfloat64shortInterest
AvgDailyVolumefloat64avgDailyVolume
DaysToCoverfloat64daysToCover
PercentOfFloatfloat64percentOfFloat
ShortInterestPreviousfloat64shortInterestPrevious
PercentChangefloat64percentChange

Invocation example

result, err := qc.GetShortInterest(model.ShortInterestRequest{
	Symbols: []string{"AAPL"},
	Lang: "en_US",
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "symbol": "AAPL",
    "settlementDate": "2025-07-15",
    "shortInterest": 98234567.0,
    "avgDailyVolume": 65432100.0,
    "daysToCover": 1.5,
    "percentOfFloat": 0.65,
    "shortInterestPrevious": 96543210.0,
    "percentChange": 1.75
  }
]

GetStockBroker

Purpose

Retrieves stock broker data and decodes it into the published Go return model.

Signature

func (c *QuoteClient) GetStockBroker(req model.StockBrokerRequest) (*model.StockBroker, error)

Availability depends on market, instrument, and enabled data access.

Parameters

model.StockBrokerRequest

SDK fieldTypeRequiredSerializationSDK default and constraints
SecTypestringNoOmitted if emptyAllowed values: ALL, STK, OPT, WAR, IOPT, FUT, FOP, CASH, MLEG, FUND
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US

Returns

(*model.StockBroker, error). Key fields from model.StockBroker:

FieldTypeJSON field
Symbolstringsymbol
LevelAskList[]StockBrokerItemlevelAskList
LevelBidList[]StockBrokerItemlevelBidList

Invocation example

result, err := qc.GetStockBroker(model.StockBrokerRequest{
	Symbol: "AAPL",
	Limit: 20,
	SecType: "STK",
	Lang: "en_US",
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
{
  "symbol": "00700",
  "levelAskList": [
    {
      "level": 1,
      "price": 420.80,
      "brokerCount": 2,
      "broker": [
        {"id": "8461", "name": "FUTU Securities"},
        {"id": "8577", "name": "HSBC"}
      ]
    }
  ],
  "levelBidList": [
    {
      "level": 1,
      "price": 420.60,
      "brokerCount": 3,
      "broker": [
        {"id": "6997", "name": "China Investment"},
        {"id": "8134", "name": "BOC"},
        {"id": "5342", "name": "J.P. Morgan"}
      ]
    }
  ]
}


Did this page help you?