Get open interest
curl --request GET \
--url https://api.allium.so/api/v1/markets/{market_id}/perps/open_interest \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.allium.so/api/v1/markets/{market_id}/perps/open_interest"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.allium.so/api/v1/markets/{market_id}/perps/open_interest', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.allium.so/api/v1/markets/{market_id}/perps/open_interest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.allium.so/api/v1/markets/{market_id}/perps/open_interest"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.allium.so/api/v1/markets/{market_id}/perps/open_interest")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.allium.so/api/v1/markets/{market_id}/perps/open_interest")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"items": [
{
"market_id": "hl:perp:BTC-USDC",
"ts": "2026-05-01T01:00:00.000000+00:00",
"oi_base": "12483.50",
"oi_quote_usd": "1308734500.00"
}
]
}Market Data
Get open interest
Historical open interest timeseries for a perpetual market.
GET
/
api
/
v1
/
markets
/
{market_id}
/
perps
/
open_interest
Get open interest
curl --request GET \
--url https://api.allium.so/api/v1/markets/{market_id}/perps/open_interest \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.allium.so/api/v1/markets/{market_id}/perps/open_interest"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.allium.so/api/v1/markets/{market_id}/perps/open_interest', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.allium.so/api/v1/markets/{market_id}/perps/open_interest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.allium.so/api/v1/markets/{market_id}/perps/open_interest"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.allium.so/api/v1/markets/{market_id}/perps/open_interest")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.allium.so/api/v1/markets/{market_id}/perps/open_interest")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"items": [
{
"market_id": "hl:perp:BTC-USDC",
"ts": "2026-05-01T01:00:00.000000+00:00",
"oi_base": "12483.50",
"oi_quote_usd": "1308734500.00"
}
]
}Alpha — The Market Data API is in alpha. Schema and response format may change. To request access, contact us or reach out to your account manager.
The query window is currently capped at 7 days per request.
Authorizations
Path Parameters
Canonical market slug, {venue}:{instrument_type}:{pair}.
Query Parameters
Bucket interval.
Available options:
1m, 5m, 15m, 1h, 4h, 1d Start of the window (ISO 8601; naive datetimes treated as UTC).
End of the window (ISO 8601).
Maximum rows to return (1–5000).
Required range:
1 <= x <= 5000Response
200 - application/json
Open interest samples.
Show child attributes
Show child attributes
Was this page helpful?