-
Notifications
You must be signed in to change notification settings - Fork 0
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.
client := coinglass.NewClient("YOUR_API_KEY")
ctx := context.Background()coins, err := client.Spot.SupportedCoins(ctx)markets, err := client.Spot.CoinsMarkets(ctx, &coinglass.SpotCoinsMarketsParams{
Symbol: coinglass.StringPtr("BTC"),
})pairs, err := client.Spot.PairsMarkets(ctx, &coinglass.SpotPairsMarketsParams{
Symbol: coinglass.StringPtr("BTC"),
})prices, err := client.Spot.PriceHistory(ctx, &coinglass.SpotPriceHistoryParams{
Symbol: "BTC",
Interval: "1d",
Limit: coinglass.IntPtr(30),
})orderbook, err := client.Spot.OrderbookHistory(ctx, &coinglass.SpotOrderbookHistoryParams{
Symbol: "BTC",
Exchange: "Binance",
Interval: "1h",
})takerVol, err := client.Spot.TakerBuySellHistory(ctx, &coinglass.SpotTakerBuySellHistoryParams{
Symbol: "BTC",
Exchange: "Binance",
Interval: "1h",
})