MMT API Go Client Library Examples
This directory contains example applications demonstrating how to use the MMT API Go client library.
Prerequisites
All examples require a valid MMT API key. Set it as an environment variable before running any example:
export MMT_API_KEY="your-api-key-here"
Get your API key at https://mmt.gg.
Examples
1. REST Basic (rest_basic/)
Demonstrates basic usage of the REST API client:
- Getting candles (single exchange and aggregated)
- Getting market stats and open interest
- Getting volume delta and volume distribution
- Getting heatmaps and orderbook data
- Listing available markets
cd rest_basic
export MMT_API_KEY="your-api-key-here"
go run main.go
2. WebSocket Basic (websocket_basic/)
Demonstrates WebSocket client usage:
- Connecting to WebSocket with callbacks
- Subscribing to real-time data streams
- Handling different message types (candles, trades, stats, orderbook, flat heatmap)
- Graceful shutdown with cleanup
cd websocket_basic
export MMT_API_KEY="your-api-key-here"
go run main.go