Options

GetOptionExpiration

Purpose

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

Signature

func (c *QuoteClient) GetOptionExpiration(symbols []string) ([]model.OptionExpiration, 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.OptionExpiration, error). Key fields from model.OptionExpiration:

FieldTypeJSON field
Symbolstringsymbol
OptionSymbols[]stringoptionSymbols
Dates[]stringdates
Timestamps[]int64timestamps
Periods[]stringperiods
Counts[]intcounts

Invocation example

result, err := qc.GetOptionExpiration([]string{"AAPL"})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "symbol": "AAPL",
    "dates": ["2025-08-08", "2025-08-15", "2025-08-22", "2025-09-19", "2025-10-17"],
    "timestamp": [1786392000000, 1786996800000, 1787601600000, 1789988400000, 1792407600000]
  }
]

Special option symbols for indices

  • S&P 500 (.SPX): monthly options use SPX; weekly and quarterly options use SPXW.
  • Nasdaq-100: monthly options use NDX; weekly options use NDXP.
  • VIX: monthly options use VIX; weekly options use VIXW.

GetOptionChain

Purpose

Retrieves option chain data and decodes it into the published Go return model. The client uses API version 3.0.

Signature

func (c *QuoteClient) GetOptionChain(items [][2]string) ([]model.OptionChain, error)

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

Parameters

ParameterTypeRequiredSDK defaultConstraints
items[][2]stringYesNoneEach item is [underlying, YYYY-MM-DD]

Returns

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

FieldTypeJSON field
Symbolstringsymbol
Expiryint64expiry
Items[]OptionChainRowitems

Invocation example

result, err := qc.GetOptionChain([][2]string{{"AAPL", "2026-06-19"}})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "symbol": "AAPL",
    "expiry": "2025-08-15",
    "items": [
      {
        "identifier": "AAPL  250815C00300000",
        "symbol": "AAPL",
        "expiry": "2025-08-15",
        "strike": 300.0,
        "putCall": "CALL",
        "open": 12.50,
        "high": 14.80,
        "low": 11.90,
        "close": 13.25,
        "volume": 5432,
        "openInterest": 12345,
        "latestPrice": 13.25
      },
      {
        "identifier": "AAPL  250815P00300000",
        "symbol": "AAPL",
        "expiry": "2025-08-15",
        "strike": 300.0,
        "putCall": "PUT",
        "open": 4.10,
        "high": 5.20,
        "low": 3.80,
        "close": 4.50,
        "volume": 3210,
        "openInterest": 8765,
        "latestPrice": 4.50
      }
    ]
  }
]

GetOptionQuote

Purpose

Retrieves option quote data and decodes it into the published Go return model. The client uses API version 2.0.

Signature

func (c *QuoteClient) GetOptionQuote(identifiers []string) ([]model.Brief, error)

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

Parameters

ParameterTypeRequiredSDK defaultConstraints
identifiers[]stringYesNoneOCC option identifiers; malformed values fail before transport

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.GetOptionQuote([]string{"AAPL 260619C00200000"})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "identifier": "AAPL  250815C00300000",
    "symbol": "AAPL",
    "expiry": "2025-08-15",
    "strike": 300.0,
    "putCall": "CALL",
    "open": 12.50,
    "high": 14.80,
    "low": 11.90,
    "close": 13.25,
    "preClose": 11.80,
    "latestPrice": 13.25,
    "volume": 5432,
    "openInterest": 12345,
    "askPrice": 13.35,
    "askSize": 50,
    "bidPrice": 13.15,
    "bidSize": 80
  }
]

GetOptionKline

Purpose

Retrieves option kline data and decodes it into the published Go return model. The client uses API version 2.0.

Signature

func (c *QuoteClient) GetOptionKline(identifiers []string, period string) ([]model.Kline, error)

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

Parameters

ParameterTypeRequiredSDK defaultConstraints
identifiers[]stringYesNoneOCC option identifiers; malformed values fail before transport
periodstringYesNoneBar period; see the BarPeriod enum

Returns

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

FieldTypeJSON field
Symbolstringsymbol
Periodstringperiod
NextPageTokenstringnextPageToken
Items[]KlineItemitems

Invocation example

result, err := qc.GetOptionKline([]string{"AAPL 260619C00200000"}, "day")
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "symbol": "AAPL  250815C00300000",
    "period": "day",
    "nextPageToken": null,
    "items": [
      {"time": 1785384000000, "volume": 3200, "open": 11.80, "close": 12.50, "high": 12.90, "low": 11.50, "amount": 0},
      {"time": 1785470400000, "volume": 5432, "open": 12.50, "close": 13.25, "high": 14.80, "low": 11.90, "amount": 0}
    ]
  }
]

GetOptionTradeTicks

Purpose

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

Signature

func (c *QuoteClient) GetOptionTradeTicks(req model.OptionTradeTicksRequest) ([]model.TradeTick, error)

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

Parameters

model.OptionTradeTicksRequest

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.GetOptionTradeTicks(model.OptionTradeTicksRequest{
	Contracts: []model.OptionQueryItem{{Symbol: "AAPL", Expiry: 1781827200000, Strike: "200", Right: "CALL"}},
	Lang: "en_US",
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "symbol": "AAPL  250815C00300000",
    "beginIndex": 1200,
    "endIndex": 1202,
    "items": [
      {"time": 1785527980000, "volume": 10, "price": 13.20, "type": "+"},
      {"time": 1785527985000, "volume": 5, "price": 13.25, "type": "-"}
    ]
  }
]

GetOptionTimeline

Purpose

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

Signature

func (c *QuoteClient) GetOptionTimeline(req model.OptionTimelineRequest) ([]model.Timeline, error)

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

Parameters

model.OptionTimelineRequest

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.Timeline, error). Key fields from model.Timeline:

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

Invocation example

result, err := qc.GetOptionTimeline(model.OptionTimelineRequest{
	OptionQuery: []model.OptionQueryItem{{Symbol: "AAPL", Expiry: 1781827200000, Strike: "200", Right: "CALL"}},
	Market: "US",
	Lang: "en_US",
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "symbol": "AAPL  250815C00300000",
    "period": "day",
    "preClose": 11.80,
    "intraday": {
      "items": [
        {"time": 1785504600000, "price": 12.50, "avgPrice": 12.50, "volume": 120},
        {"time": 1785504660000, "price": 12.65, "avgPrice": 12.57, "volume": 85},
        {"time": 1785504720000, "price": 12.45, "avgPrice": 12.53, "volume": 200}
      ]
    },
    "preHours": null,
    "afterHours": null
  }
]

GetOptionDepth

Purpose

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

Signature

func (c *QuoteClient) GetOptionDepth(req model.OptionDepthRequest) ([]model.Depth, error)

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

Parameters

model.OptionDepthRequest

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.GetOptionDepth(model.OptionDepthRequest{
	OptionBasic: []model.OptionQueryItem{{Symbol: "AAPL", Expiry: 1781827200000, Strike: "200", Right: "CALL"}},
	Market: "US",
	Lang: "en_US",
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "symbol": "AAPL  250815C00300000",
    "asks": [
      {"price": 13.35, "volume": 50, "count": 0},
      {"price": 13.40, "volume": 120, "count": 0}
    ],
    "bids": [
      {"price": 13.15, "volume": 80, "count": 0},
      {"price": 13.10, "volume": 150, "count": 0}
    ]
  }
]

GetOptionSymbols

Purpose

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

Signature

func (c *QuoteClient) GetOptionSymbols(req model.OptionSymbolsRequest) ([]model.OptionSymbol, error)

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

Parameters

model.OptionSymbolsRequest

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.OptionSymbol, error). Key fields from model.OptionSymbol:

FieldTypeJSON field
Symbolstringsymbol
Marketstringmarket
NameCNstringnameCN
NameENstringnameEN

Invocation example

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

GetOptionAnalysis

Purpose

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

Signature

func (c *QuoteClient) GetOptionAnalysis(req model.OptionAnalysisRequest) ([]model.OptionAnalysis, error)

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

Parameters

model.OptionAnalysisRequest

SDK fieldTypeRequiredSerializationSDK default and constraints
MarketstringNoOmitted if emptyAllowed values: ALL, US, HK, CN, SG
PeriodstringNoOmitted if emptyNone; OptionAnalysisPeriod; Allowed values: day, week, month, year, 1min, 5min, 15min, 30min, 60min
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US

Returns

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

FieldTypeJSON field
Symbolstringsymbol
HistoricalVol30Dfloat64historicalVolatility30Day
HistoricalVol60Dfloat64historicalVolatility60Day
HistoricalVol90Dfloat64historicalVolatility90Day
ImpliedVolfloat64impliedVolatility
VolatilityList[]OptionVolatilityPointvolatilityList

Invocation example

result, err := qc.GetOptionAnalysis(model.OptionAnalysisRequest{
	Symbols: []string{"AAPL"},
	Market: "US",
	Period: "day",
	Lang: "en_US",
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "identifier": "AAPL  250815C00300000",
    "symbol": "AAPL",
    "expiry": "2025-08-15",
    "strike": 300.0,
    "putCall": "CALL",
    "delta": 0.72,
    "gamma": 0.015,
    "theta": -0.35,
    "vega": 0.48,
    "rho": 0.12,
    "impliedVol": 0.42,
    "openInterest": 12345,
    "volume": 5432
  }
]


Did this page help you?