Skip to main content

Open Interest Statistics

Description

Get historical open interest statistics for trading pairs.

HTTP Request

GET /futures/data/openInterestHist

Request Parameters

NameTypeRequiredDescription
symbolSTRINGYESTrading pair
periodENUMNO"5m","15m","30m","1h","2h","4h","6h","12h","1d"; Default "5m"
limitINTNODefault 30; Max 500
startTimeLONGNOAccepted but currently ignored
endTimeLONGNOAccepted 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']}")