MMTMMT Docs
REST API

Open Interest

Retrieve historical open interest data as OHLC candles showing how open interest changed over time.

Retrieve historical open interest data as OHLC candles showing how open interest changed over time.

Authentication

API key via X-API-Key header.

Endpoint

GET /api/v1/oi

Example Request

curl "https://eu-central-1.mmt.gg/api/v1/oi?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, okxf). 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, 1d)
fromint64YesStart timestamp (Unix seconds, inclusive)
toint64YesEnd timestamp (Unix seconds, exclusive)

Rate Limits

MetricValue
Cost Multiplier1x
Max Points/Request100,000

Weight calculation for single-exchange requests:

base_points = (to - from) / tf_seconds
weight = ceil(base_points / 1000) × 1

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

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

For example, 5 exchanges = 2x cost, 10 exchanges = 3x cost.

Response

Success Response

{
  "data": [
    {
      "t": 1704067200,
      "o": 5000000000,
      "h": 5100000000,
      "l": 4950000000,
      "c": 5050000000,
      "n": 60
    },
    {
      "t": 1704067260,
      "o": 5050000000,
      "h": 5080000000,
      "l": 5020000000,
      "c": 5060000000,
      "n": 58
    }
  ],
  "exchange": "binancef",
  "symbol": "btc/usd",
  "tf": "1m",
  "from": 1704067200,
  "to": 1704070800,
  "points": 60
}

Response Type: OHLC

{"t": 1704067200, "o": 5000000000, "h": 5100000000, "l": 4950000000, "c": 5050000000, "n": 60}
FieldTypeDescription
tint64Unix timestamp (seconds)
o, h, l, cfloat64Open, high, low, close value
nint64Sample count

See Types for full details.

Errors

Validation Errors

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

Tier Restriction Errors

CodeHTTPDescription
TIER_RESTRICTED403Request outside tier's allowed access
AGG_NOT_ALLOWED403Multi-exchange aggregation not allowed on tier
MAX_POINTS_EXCEEDED400Request exceeds maximum datapoints
{
  "error": {
    "code": "MAX_POINTS_EXCEEDED",
    "message": "Request exceeds max datapoints for stream",
    "details": {
      "requested": 150000,
      "max": 100000
    }
  }
}

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

See Errors for the complete error reference.

On this page