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/oiExample 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
| Parameter | Type | Required | Description |
|---|---|---|---|
exchange | string | Yes | Exchange ID (e.g., binancef, bybitf, okxf). 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, 1d) |
from | int64 | Yes | Start timestamp (Unix seconds, inclusive) |
to | int64 | Yes | End timestamp (Unix seconds, exclusive) |
Rate Limits
| Metric | Value |
|---|---|
| Cost Multiplier | 1x |
| Max Points/Request | 100,000 |
Weight calculation for single-exchange requests:
base_points = (to - from) / tf_seconds
weight = ceil(base_points / 1000) × 1For 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}| Field | Type | Description |
|---|---|---|
t | int64 | Unix timestamp (seconds) |
o, h, l, c | float64 | Open, high, low, close value |
n | int64 | Sample count |
See Types for full details.
Errors
Validation Errors
| Code | HTTP | Description |
|---|---|---|
INVALID_PARAMS | 400 | Missing or invalid parameters |
INVALID_EXCHANGE | 400 | Unknown/unsupported exchange ID, duplicate exchange in aggregate string, or non-alphabetical aggregate ordering |
INVALID_SYMBOL | 400 | Unknown or unsupported trading symbol |
INVALID_TIMEFRAME | 400 | Invalid timeframe format or outside allowed range |
{
"error": {
"code": "INVALID_PARAMS",
"message": "Invalid request parameters",
"details": {
"message": "from and to are required"
}
}
}Tier Restriction Errors
| Code | HTTP | Description |
|---|---|---|
TIER_RESTRICTED | 403 | Request outside tier's allowed access |
AGG_NOT_ALLOWED | 403 | Multi-exchange aggregation not allowed on tier |
MAX_POINTS_EXCEEDED | 400 | Request exceeds maximum datapoints |
{
"error": {
"code": "MAX_POINTS_EXCEEDED",
"message": "Request exceeds max datapoints for stream",
"details": {
"requested": 150000,
"max": 100000
}
}
}Rate Limit Errors
| Code | HTTP | Description |
|---|---|---|
RATE_LIMITED | 429 | Rate limit exceeded |
{
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded",
"details": {
"retry_after": 45
}
}
}Server Errors
| Code | HTTP | Description |
|---|---|---|
TIMEOUT | 504 | Query exceeded 30 second timeout |
INTERNAL_ERROR | 500 | Internal server error |
See Errors for the complete error reference.