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_hdExample 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
| Parameter | Type | Required | Description |
|---|---|---|---|
exchange | string | Yes | Exchange ID (e.g., binancef, bybitf). Aggregated format: colon-separated, unique, alphabetically ordered IDs (e.g., binancef:bybitf). Invalid aggregate strings return INVALID_EXCHANGE. |
symbol | string | Yes | Trading pair with slash separator (e.g., btc/usd, eth/usd) |
tf | string | Yes | Timeframe (e.g., 1m, 5m, 1h) |
from | int64 | Yes | Start timestamp (Unix seconds, inclusive) |
to | int64 | Yes | End 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
| Field | Type | Description |
|---|---|---|
data | FlatHeatmap[] | Array of heatmaps |
exchange | string | Exchange ID (or exchange1:exchange2 for aggregated) |
symbol | string | Unified symbol |
tf | string | Timeframe string |
from | int64 | Start timestamp (Unix seconds) |
to | int64 | End timestamp (Unix seconds) |
points | int | Number 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}| Field | Type | Description |
|---|---|---|
t | int64 | Unix timestamp (seconds) |
pg | float64 | Price grouping/bucket size |
s | []float64 | Size values (dense array) |
lp | float64 | Last traded price |
si | int64 | Split index (divides bids/asks) |
minp, maxp | float64 | Min/max price in range |
mins, maxs | float64 | Min/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:
sspans every bin fromminptomaxp(missing bins are zeros). - Last price (
lp): The average of the source exchanges' last prices (non-zero only). - Split index (
si): Derived fromlpasfloor((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
0tosi - 1 - Asks: indices
sitolen(s) - 1
Errors
Same error codes as /heatmap_hd.