MMTMMT Docs
REST API

Heatmap (High Density)

Retrieve orderbook heatmap data at high density with finer price grouping for detailed liquidity visualization.

Returns historical orderbook heatmap data at high density. HD heatmaps use finer price grouping for more granular visualization of orderbook liquidity over time. This provides detailed insight into where large orders are placed and how the orderbook structure evolves.

Recommended: Use /flat_heatmap_hd for new integrations. It returns the same data in a flat format optimized for rendering. /heatmap_hd remains for compatibility.

Authentication

API key via X-API-Key header.

Endpoint

GET /api/v1/heatmap_hd

Parameters

ParameterTypeRequiredDescription
exchangestringYesExchange ID (e.g., binancef, bybitf). Aggregated format: colon-separated, unique, alphabetically ordered IDs (e.g., binancef:bybitf). Invalid aggregate strings return INVALID_EXCHANGE.
symbolstringYesTrading pair with slash separator (e.g., btc/usd, eth/usd)
tfstringYesTimeframe (e.g., 1m, 5m, 1h)
fromint64YesStart timestamp (Unix seconds, inclusive)
toint64YesEnd timestamp (Unix seconds, exclusive)

Example Request

curl -X GET "https://eu-central-1.mmt.gg/api/v1/heatmap_hd?exchange=binancef&symbol=btc/usd&tf=1m&from=1704067200&to=1704070800" \
  -H "X-API-Key: your-api-key"

Rate Limits

MetricValue
Cost Multiplier10x
Max Points4,000

Weight Calculation

For single-exchange requests:

base_points = (to - from) / tf_seconds
weight = ceil(base_points / 1000) x 10

For multi-exchange aggregated requests, each exchange adds 20% to the base cost:

weight = ceil(base_points / 1000) x 10 x (1 + 0.2 x num_exchanges)

Example: 1 hour of 1-minute HD heatmap data (1 exchange):

base_points = 3600 / 60 = 60 points
weight = ceil(60 / 1000) x 10 = 10 weight

Example: 1 hour of 1-minute HD heatmap data (5 exchanges, aggregated):

base_points = 3600 / 60 = 60 points
base_weight = ceil(60 / 1000) x 10 = 10
exchange_multiplier = 1 + 0.2 x 5 = 2.0
weight = 10 x 2.0 = 20 weight

Response

{
  "data": [
    {
      "t": 1704067200,
      "pg": 5,
      "s": [100000, 250000, 500000, 750000, 400000, 300000, 150000],
      "lp": 42050.00,
      "si": 3,
      "minp": 41800.00,
      "maxp": 42300.00,
      "mins": 10000,
      "maxs": 750000
    },
    {
      "t": 1704067260,
      "pg": 5,
      "s": [120000, 280000, 520000, 720000, 380000, 320000, 170000],
      "lp": 42075.00,
      "si": 3,
      "minp": 41825.00,
      "maxp": 42325.00,
      "mins": 12000,
      "maxs": 720000
    }
  ],
  "exchange": "binancef",
  "symbol": "btc/usd",
  "tf": "1m",
  "from": 1704067200,
  "to": 1704070800,
  "points": 60
}

Types

Encoding: Supports both JSON and CBOR. Use format=cbor query param or Accept: application/cbor header.

Response Type: FlatHeatmap

{"t": 1704067200, "pg": 5, "s": [100000, 250000, 500000, 750000, 400000, 300000, 150000], "si": 3, "lp": 42050.0, "minp": 41800.0, "maxp": 42300.0, "mins": 10000, "maxs": 750000}
FieldTypeDescription
tint64Unix timestamp (seconds)
pgfloat64Price grouping/bucket size
s[]float64Size values at each price level (bids below split index, asks at/above)
siint64Split index (divides bids/asks in sizes array)
lpfloat64Last traded price
minp, maxpfloat64Min/max price in range
mins, maxsfloat64Min/max size value

See Types for full details.

HD vs SD Heatmaps

FeatureHD (High Density)SD (Standard Density)
Price groupingFiner (smaller pg)Coarser (larger pg)
Detail levelMore granularLess granular
Max points4,0005,000
Cost multiplier10x5x
Use caseDetailed analysis, zoomed viewsOverview, longer time ranges

Errors

CodeHTTPDescription
INVALID_API_KEY401Missing or invalid API key
INVALID_EXCHANGE400Unknown/unsupported exchange ID, duplicate exchange in aggregate string, or non-alphabetical aggregate ordering
INVALID_SYMBOL400Unknown or unsupported trading symbol
INVALID_TIMEFRAME400Invalid timeframe format or outside allowed range
INVALID_PARAMS400Missing or invalid query parameters
MAX_POINTS_EXCEEDED400Request exceeds 4,000 point limit
TIER_RESTRICTED403Request outside tier's allowed history range
AGG_NOT_ALLOWED403Multi-exchange aggregation not allowed on tier
RATE_LIMITED429Rate limit exceeded
TIMEOUT504Query exceeded 30 second timeout
INTERNAL_ERROR500Internal server error

Example Error Response

{
  "error": {
    "code": "MAX_POINTS_EXCEEDED",
    "message": "Request exceeds max datapoints for stream",
    "details": {
      "requested": 5000,
      "max": 4000
    }
  }
}

On this page