Skip to content

v1.0.0

Choose a tag to compare

@tigusigalpa tigusigalpa released this 12 Jul 17:51

coinglass-go v1.0.0

First stable release of coinglass-go — a zero-dependency Go client for the Coinglass API v4.

Highlights

  • Complete API coverage across five service groups: Futures, Spot, Options, ETF, and Indicators.
  • Zero external dependencies — built entirely on the Go standard library (net/http, encoding/json, context, time).
  • Idiomatic, typed API with functional-option configuration via NewClient.
  • Context-first and concurrency-safe — every method accepts a context.Context, and a single Client can be shared across goroutines.
  • Built-in resilience — automatic retry with exponential backoff on HTTP 429, honoring the Retry-After header when present.
  • Clear error model — sentinel errors (ErrUnauthorized, ErrNotFound, ErrRateLimited) for common statuses, plus a detailed *APIError (status code, envelope code/msg, raw body) for everything else.

What's included

  • Futures (client.Futures) — 23 endpoints: supported coins/pairs, markets, open interest, funding rate, long/short ratios, liquidations (history, heatmaps, maps), orderbook, taker buy/sell, and whale alerts.
  • Spot (client.Spot) — supported coins, markets, price history, orderbook, and taker buy/sell.
  • Options (client.Options) — max pain, info, exchange OI/volume history.
  • ETF (client.ETF) — Bitcoin/Ethereum ETF lists and flows, net assets, and Grayscale holdings.
  • Indicators (client.Indicators) — Fear & Greed index, RSI, futures basis, Coinbase premium, Bitcoin rainbow chart, Stock-to-Flow, and stablecoin market cap.

Configuration

  • NewClient(apiKey, ...opts) and NewClientFromEnv(...opts) (reads COINGLASS_API_KEY).
  • Options: WithBaseURL, WithHTTPClient, WithTimeout, WithRetry.
  • Pointer helpers for optional params: IntPtr, StringPtr, BoolPtr, Int64Ptr, Float64Ptr.

Testing & examples

  • Each service ships with its own httptest-based test suite.
  • Runnable examples in examples: basic, etf, and concurrency.

Requirements

  • Go 1.21+
  • A Coinglass API key

Installation

go get github.com/tigusigalpa/coinglass-go@v1.0.0

Full documentation: see the README.

License: MIT

Want me to also generate a matching CHANGELOG.md entry (Keep a Changelog format) or a shorter, condensed version of these notes?