Skip to content

Spot Service

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

The SpotService provides access to Coinglass spot market data, including price history, orderbook heatmaps, and taker buy/sell volumes. It is accessed via client.Spot.

Initialization

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

Markets & Coins

Get Supported Spot Coins

coins, err := client.Spot.SupportedCoins(ctx)

Get Spot Coins Markets

markets, err := client.Spot.CoinsMarkets(ctx, &coinglass.SpotCoinsMarketsParams{
    Symbol: coinglass.StringPtr("BTC"),
})

Get Spot Pairs Markets

pairs, err := client.Spot.PairsMarkets(ctx, &coinglass.SpotPairsMarketsParams{
    Symbol: coinglass.StringPtr("BTC"),
})

Price & Orderbook

Spot Price History (OHLC)

prices, err := client.Spot.PriceHistory(ctx, &coinglass.SpotPriceHistoryParams{
    Symbol:   "BTC",
    Interval: "1d",
    Limit:    coinglass.IntPtr(30),
})

Spot Orderbook History

orderbook, err := client.Spot.OrderbookHistory(ctx, &coinglass.SpotOrderbookHistoryParams{
    Symbol:   "BTC",
    Exchange: "Binance",
    Interval: "1h",
})

Spot Taker Buy/Sell History

takerVol, err := client.Spot.TakerBuySellHistory(ctx, &coinglass.SpotTakerBuySellHistoryParams{
    Symbol:   "BTC",
    Exchange: "Binance",
    Interval: "1h",
})

Clone this wiki locally