MMTMMT Docs
REST API

Flat Heatmap (High Density)

Retrieve high density heatmap data in a flat format optimized for rendering. Recommended for new integrations.

Recommended for new integrations. This endpoint returns the same heatmap data as /heatmap_hd, but in the flat format optimized for rendering. Use this format unless you need legacy compatibility.

Authentication

API key via X-API-Key header.

Endpoint

GET /api/v1/flat_heatmap_hd

Example Request

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

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)

Rate Limits

Same limits and weight calculation as /heatmap_hd.

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
    }
  ],
  "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 Envelope

FieldTypeDescription
dataFlatHeatmap[]Array of heatmaps
exchangestringExchange ID (or exchange1:exchange2 for aggregated)
symbolstringUnified symbol
tfstringTimeframe string
fromint64Start timestamp (Unix seconds)
toint64End timestamp (Unix seconds)
pointsintNumber of points returned

Response Type: FlatHeatmap

{"t": 1704067200, "pg": 10, "s": [100000, 250000, 500000], "lp": 42050.0, "si": 50, "minp": 41500.0, "maxp": 42500.0, "mins": 10000, "maxs": 1000000}
FieldTypeDescription
tint64Unix timestamp (seconds)
pgfloat64Price grouping/bucket size
s[]float64Size values (dense array)
lpfloat64Last traded price
siint64Split index (divides bids/asks)
minp, maxpfloat64Min/max price in range
mins, maxsfloat64Min/max size value

Price at index i = minp + (i * pg)

See Types for full details.

Using Aggregated Heatmaps

When you request multiple exchanges (e.g., exchange=binancef:bybitf), the server aggregates heatmaps as follows. Aggregated exchange strings must be unique and alphabetically ordered, otherwise the request fails with INVALID_EXCHANGE:

  • Price group (pg): Uses the largest price group among the exchanges.
  • Binning: Each exchange's prices are rounded down to that pg, then sizes are summed per bin.
  • Dense array: s spans every bin from minp to maxp (missing bins are zeros).
  • Last price (lp): The average of the source exchanges' last prices (non-zero only).
  • Split index (si): Derived from lp as floor((lp - minp) / pg), clamped to the array bounds.

To reconstruct price levels:

price[i] = minp + (i * pg)

Then split bids/asks at si:

  • Bids: indices 0 to si - 1
  • Asks: indices si to len(s) - 1

Errors

Same error codes as /heatmap_hd.

On this page