Open Interest Statistics
Description
Get historical open interest statistics for trading pairs.
HTTP Request
GET /futures/data/openInterestHist
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | STRING | YES | Trading pair |
| period | ENUM | NO | "5m","15m","30m","1h","2h","4h","6h","12h","1d"; Default "5m" |
| limit | INT | NO | Default 30; Max 500 |
| startTime | LONG | NO | Accepted but currently ignored |
| endTime | LONG | NO | Accepted but currently ignored |
sumOpenInterest and sumOpenInterestValue currently both return the same total open interest value in USD.
Response Example
[
{
"symbol": "BTCUSDT",
"sumOpenInterest": "150570701.18", // Total open interest value (USD)
"sumOpenInterestValue": "150570701.18", // Total open interest value (USD, same as sumOpenInterest)
"timestamp": "1583127600000" // Timestamp (string)
}
]
Code Examples
cURL
curl -s "https://api.prex.world/futures/data/openInterestHist?symbol=BTCUSDT&period=1h&limit=5"
Python
import requests
base_url = "https://api.prex.world"
params = {"symbol": "BTCUSDT", "period": "1h", "limit": 5}
response = requests.get(f"{base_url}/futures/data/openInterestHist", params=params)
for record in response.json():
print(f"{record['symbol']}: OI={record['sumOpenInterest']} ts={record['timestamp']}")