MMTMMT Docs
REST API

Heatmap (Standard Density)

Retrieve orderbook heatmap data at standard density with wider price grouping for a broader view of liquidity distribution.

Returns orderbook heatmap data at standard density (wider price grouping). Standard density heatmaps provide a broader view of orderbook liquidity distribution across price levels with less granular price buckets compared to HD heatmaps.

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

Authentication

API key via X-API-Key header.

Endpoint

GET /api/v1/heatmap_sd

Example

GET /api/v1/heatmap_sd?exchange=binancef&symbol=btc/usd&tf=1m&from=1704067200&to=1704070800

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)
tfstringYesTimeframe (e.g., 1m, 5m, 1h)
fromint64YesStart timestamp (Unix seconds, inclusive)
toint64YesEnd timestamp (Unix seconds, exclusive)

Rate Limits

PropertyValue
Cost Multiplier5x
Max Points5,000

Weight Calculation

For single-exchange requests:

base_points = (to - from) / tf_seconds
weight = ceil(base_points / 1000) * 5

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

weight = ceil(base_points / 1000) * 5 * (1 + 0.2 * num_exchanges)

Examples

Requesting 1 hour of 1-minute heatmap_sd (1 exchange):

base_points = 3600 / 60 = 60 points
weight = ceil(60 / 1000) * 5 = 1 * 5 = 5 weight

Requesting 1 hour of 1-minute heatmap_sd (3 exchanges, aggregated):

base_points = 3600 / 60 = 60 points
base_weight = ceil(60 / 1000) * 5 = 5
exchange_multiplier = 1 + 0.2 * 3 = 1.6
weight = 5 * 1.6 = 8 weight

Response

{
  "data": [
    {
      "t": 1704067200,
      "pg": 10,
      "s": [100000, 250000, 500000, 300000, 150000, 200000, 350000, 180000],
      "lp": 42050.00,
      "si": 4,
      "minp": 41500.00,
      "maxp": 42500.00,
      "mins": 10000,
      "maxs": 500000
    }
  ],
  "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": 10, "s": [100000, 250000, 500000, 300000, 150000, 200000, 350000, 180000], "si": 4, "lp": 42050.0, "minp": 42000.0, "maxp": 42070.0, "mins": 100000, "maxs": 500000}
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.

Errors

Validation Errors

CodeHTTPDescription
INVALID_PARAMS400Missing or invalid parameters
INVALID_EXCHANGE400Unknown exchange ID, duplicate exchange in aggregate string, or non-alphabetical aggregate ordering
INVALID_TIMEFRAME400Invalid timeframe format or outside allowed range
{
  "error": {
    "code": "INVALID_PARAMS",
    "message": "Invalid request parameters",
    "details": {
      "message": "from and to are required"
    }
  }
}

Tier Errors

CodeHTTPDescription
TIER_RESTRICTED403Request outside tier's allowed history
AGG_NOT_ALLOWED403Multi-exchange aggregation not allowed on tier
MAX_POINTS_EXCEEDED400Request exceeds 5,000 point limit
{
  "error": {
    "code": "MAX_POINTS_EXCEEDED",
    "message": "Request exceeds max datapoints for stream",
    "details": {
      "requested": 6000,
      "max": 5000
    }
  }
}

Rate Limit Errors

CodeHTTPDescription
RATE_LIMITED429Rate limit exceeded
{
  "error": {
    "code": "RATE_LIMITED",
    "message": "Rate limit exceeded",
    "details": {
      "retry_after": 45
    }
  }
}

Server Errors

CodeHTTPDescription
TIMEOUT504Query exceeded 30 second timeout
INTERNAL_ERROR500Internal server error
{
  "error": {
    "code": "TIMEOUT",
    "message": "Query exceeded 30s timeout"
  }
}

On this page