MMTMMT Docs
REST API

Orderbook

Retrieve a real-time orderbook snapshot with bid and ask price levels for a trading pair.

Returns a real-time orderbook snapshot for a trading pair. The snapshot includes bid and ask price levels with their corresponding sizes.

Authentication

API key via X-API-Key header.

Endpoint

GET /api/v1/orderbook

Parameters

ParameterTypeRequiredDescription
exchangestringYesExchange ID (e.g., binancef, bybitf)
symbolstringYesTrading pair with slash separator (e.g., btc/usd)
levelsstringNoNumber of price levels: 100, 1000, 5000, or full (default: full)

Note: This endpoint does not support aggregated exchanges. Use a single exchange ID.

Rate Limits

MetricValue
Cost1 weight

This endpoint has a fixed cost of 1 weight per request regardless of the number of levels.

Response

Response Type: Orderbook

{"t": 1704067200, "exchange": "binancef", "symbol": "btc/usd", "a": [[42100.10, 1.5], [42100.20, 2.3]], "b": [[42099.90, 2.1], [42099.80, 1.8]], "lp": 42100.00, "snapshot": true, "seq": 123456, "levels": 1000}
FieldTypeDescription
tint64Unix timestamp (seconds)
exchange, symbolstringExchange ID and trading pair
a[][2]float64Asks as [price, size] pairs (ascending)
b[][2]float64Bids as [price, size] pairs (descending)
lpfloat64Last traded price
snapshotboolFull snapshot flag
seqint64Sequence number
levelsint64Number of levels returned

See Types for full details.

Level Options

ValueDescription
100Top 100 price levels on each side
1000Top 1,000 price levels on each side
5000Top 5,000 price levels on each side
fullAll available price levels (default)

Tip: Use smaller level counts for faster responses when you only need top-of-book data. The full option returns the complete orderbook which may be large for liquid markets.

Errors

CodeHTTPDescription
INVALID_API_KEY401Missing or invalid API key
INVALID_PARAMS400Missing or invalid parameters
INVALID_EXCHANGE400Unknown exchange ID
INVALID_SYMBOL400Unknown trading symbol
RATE_LIMITED429Rate limit exceeded
TIMEOUT504Request exceeded timeout (10s for NATS fetch; error message says "30s")
INTERNAL_ERROR500Internal server error

Example Error Response

{
  "error": {
    "code": "INVALID_PARAMS",
    "message": "levels must be one of: 100, 1000, 5000, full"
  }
}

Examples

Basic Request

curl "https://eu-central-1.mmt.gg/api/v1/orderbook?exchange=binancef&symbol=btc/usd" \
  -H "X-API-Key: your-api-key"

With Level Limit

curl "https://eu-central-1.mmt.gg/api/v1/orderbook?exchange=binancef&symbol=btc/usd&levels=100" \
  -H "X-API-Key: your-api-key"

Python Example

import requests

response = requests.get(
    "https://eu-central-1.mmt.gg/api/v1/orderbook",
    params={
        "exchange": "binancef",
        "symbol": "btc/usd",
        "levels": "1000"
    },
    headers={"X-API-Key": "your-api-key"}
)

data = response.json()
best_bid = data["b"][0][0]  # first bid price
best_ask = data["a"][0][0]  # first ask price
spread = best_ask - best_bid

print(f"Best bid: {best_bid}, Best ask: {best_ask}, Spread: {spread}")

On this page