FAQ & Troubleshooting
Common questions and solutions for the MMT Market Data API.
Common questions and solutions.
Authentication
"INVALID_API_KEY" error
Problem: API returns 401 with INVALID_API_KEY.
Solutions:
- Check your API key is correct (no extra spaces or characters)
- Ensure you're using the
X-API-Keyheader for REST API requests - Verify your API key hasn't been revoked
Rate Limiting
"RATE_LIMITED" error
Problem: API returns 429 with RATE_LIMITED.
Solutions:
- Wait for
retry_afterseconds before retrying - Check
X-RateLimit-Remainingheader to avoid hitting limits - Request larger time ranges instead of many small requests
- Consider upgrading to Pro for higher limits
How do I check my rate limit quota?
Use the /api/v1/usage endpoint to check your current quota without consuming any tokens:
curl "https://eu-central-1.mmt.gg/api/v1/usage" -H "X-API-Key: your-api-key"Response:
{
"limit": 10000,
"remaining": 8500,
"used": 1500,
"reset": 1704067260,
"window_seconds": 60
}limit, remaining, and used are dynamic values returned for your current key and plan.
This endpoint has zero cost and can be called frequently to monitor your usage.
How is weight calculated?
For single-exchange requests:
weight = ceil(points / 1000) x cost_multiplierFor multi-exchange aggregated requests:
weight = ceil(points / 1000) x cost_multiplier x (1 + 0.2 x num_exchanges)Where points = (to - from) / tf_seconds. Each exchange adds 20% to the base cost (e.g., 5 exchanges = 2x cost, 10 exchanges = 3x cost).
Note: Multi-exchange aggregation is only available on Pro plans. Basic plans return AGG_NOT_ALLOWED.
See Rate Limits for cost multipliers and detailed examples.
Data
Missing data points
Problem: Response has fewer points than expected.
Causes:
- No trading activity during that period
- Exchange was down
- Symbol wasn't listed yet
This is normal - gaps indicate no data was recorded.
Data looks delayed
Problem: Real-time data seems behind.
Solutions:
- Check your client clock is synchronized
- WebSocket has minimal latency, REST has some processing delay
- Ensure you're not being rate limited (which adds retry delays)
"TIER_RESTRICTED" error
Problem: API returns 403 with TIER_RESTRICTED.
Solutions:
- You're requesting data older than your tier allows
- Check
max_history_daysfrom/marketsfor your current key - Basic Monthly allows up to 90 days, Basic Yearly up to 365 days
- Pro Monthly allows up to 365 days, Pro Yearly is unlimited (
max_history_days = 0)
WebSocket
How do I use ping/pong for heartbeat?
Send a ping message and the server responds with pong:
// Send ping
ws.send(JSON.stringify({ type: 'ping' }));
// Receive pong
ws.onmessage = (event) => {
const msg = JSON.parse(event.data); // JSON format uses text frames
if (msg.type === 'pong') {
console.log('Connection alive');
}
};This is useful for keeping connections alive through proxies or measuring latency.
How do I list my current subscriptions?
Send a list_subscriptions message:
ws.send(JSON.stringify({ type: 'list_subscriptions' }));Response:
{
"type": "subscriptions",
"count": 3,
"max": 100,
"subscriptions": [...]
}Connection drops unexpectedly
Problem: WebSocket disconnects without warning.
Causes:
- Client too slow (backpressure) - server drops slow clients
- Network issues
- Server maintenance
Solutions:
- Process messages faster, offload heavy work
- Implement reconnection with exponential backoff
- Reduce subscription count or use larger timeframes
Note: The server now sends a disconnecting message with the reason before closing.
Not receiving data after subscribe
Problem: Subscribed but no data messages.
Causes:
- Invalid channel/exchange/symbol (check for error message)
- Market is inactive (no trades occurring)
- Already subscribed (duplicates ignored)
Solutions:
- Check for error messages after subscribe
- Verify exchange/symbol are valid via
/marketsendpoint - Subscribe during active market hours for testing
Message format issues
Problem: Can't parse messages.
Solutions:
- Default format is JSON and is sent as text frames, so parse
event.datadirectly - If using CBOR (
?format=cbor), handle incoming messages as binary frames - Check for error messages (different structure than data messages)
Performance
Requests are slow
Problem: API responses take several seconds.
Solutions:
- Reduce time range or use larger timeframes
- Request fewer exchanges at once
- Avoid heatmap endpoints for large ranges (high cost)
- Check your network connection
"TIMEOUT" error
Problem: API returns 504 after 30 seconds.
Solutions:
- Reduce time range
- Use larger timeframe (1h instead of 1m)
- Request one exchange instead of aggregated
- Avoid HD heatmaps for large ranges
Integration
CORS issues in browser
Problem: Browser blocks requests.
Solutions:
- Do not call MMT directly from the browser with a secret API key
- Move API calls to your backend (proxy/service), then call your backend from the browser
- Ensure your backend sets CORS for your own frontend origins
- Rotate the API key immediately if it was exposed client-side
Using with Python
import requests
headers = {'X-API-Key': 'YOUR_KEY'}
response = requests.get(
'https://eu-central-1.mmt.gg/api/v1/candles',
params={'exchange': 'binancef', 'symbol': 'btc/usd', 'tf': '1m', 'from': 1704067200, 'to': 1704153600},
headers=headers
)
data = response.json()Using with JavaScript
const response = await fetch(
'https://eu-central-1.mmt.gg/api/v1/candles?exchange=binancef&symbol=btc/usd&tf=1m&from=1704067200&to=1704153600',
{ headers: { 'X-API-Key': 'YOUR_KEY' } }
);
const data = await response.json();Request Tracking
How do I track requests with X-Request-ID?
Every API response includes an X-Request-ID header with a unique identifier (ULID format). Use this when contacting support:
curl -v "https://eu-central-1.mmt.gg/api/v1/candles?..." -H "X-API-Key: your-key" 2>&1 | grep X-Request-ID
# X-Request-ID: 01HQXYZ123ABC456DEF789GHIFor INTERNAL_ERROR and TIMEOUT errors, the request_id is also included in the error details.
Data Limits
What are the max points limits per stream?
Each stream type has a maximum number of data points per request:
| Stream | Max Points |
|---|---|
| candles | 100,000 |
| stats | 100,000 |
| oi | 100,000 |
| vd | 100,000 |
| volumes | 20,000 |
| heatmap_sd | 5,000 |
| heatmap_hd | 4,000 |
| flat_heatmap_sd | 5,000 |
| flat_heatmap_hd | 4,000 |
| stop_heatmap | 5,000 |
| tp_heatmap | 5,000 |
| liquidation_heatmap | 5,000 |
If you exceed these limits, you'll receive a MAX_POINTS_EXCEEDED error. Reduce your time range or use a larger timeframe.
Which VD buckets are available per tier?
| Tier | Available Buckets |
|---|---|
| Basic | Bucket 1 only (all trades) |
| Pro | All (1-11) |
The /markets endpoint returns your allowed_buckets in the tier info.
Still Need Help?
If your issue isn't covered here:
- Check the relevant documentation section
- Verify with the
/marketsendpoint that your exchange/symbol exist - Contact support with your request details and the
X-Request-IDfrom the response