Skip to content

Options Service

Igor Sazonov edited this page Jul 12, 2026 · 1 revision

The OptionsService provides access to Coinglass options market data, including max pain, open interest, and volume history. It is accessed via client.Options.

Initialization

client := coinglass.NewClient("YOUR_API_KEY")
ctx := context.Background()

Max Pain & Info

Get Options Max Pain

maxPain, err := client.Options.MaxPain(ctx, &coinglass.OptionParams{
    Underlying: "BTC",
})
if err == nil {
    fmt.Printf("Max Pain for BTC: %.2f\n", maxPain.MaxPain)
}

Get Options Info

info, err := client.Options.Info(ctx, &coinglass.OptionParams{
    Underlying: "BTC",
})

Open Interest & Volume

Exchange Open Interest History

oiHistory, err := client.Options.ExchangeOIHistory(ctx, &coinglass.OptionHistoryParams{
    Interval: "1d",
    Limit:    coinglass.IntPtr(30),
})

Exchange Volume History

volHistory, err := client.Options.ExchangeVolHistory(ctx, &coinglass.OptionHistoryParams{
    Interval: "1d",
    Limit:    coinglass.IntPtr(30),
})

Clone this wiki locally