Open interest history
curl --request POST \
--url 'https://api.hypedexer.com/info#openInterestHistory' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "openInterestHistory",
"coin": "BTC",
"limit": 2
}
'import requests
url = "https://api.hypedexer.com/info#openInterestHistory"
payload = {
"type": "openInterestHistory",
"coin": "BTC",
"limit": 2
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: 'openInterestHistory', coin: 'BTC', limit: 2})
};
fetch('https://api.hypedexer.com/info#openInterestHistory', 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.hypedexer.com/info#openInterestHistory",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'openInterestHistory',
'coin' => 'BTC',
'limit' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hypedexer.com/info#openInterestHistory"
payload := strings.NewReader("{\n \"type\": \"openInterestHistory\",\n \"coin\": \"BTC\",\n \"limit\": 2\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hypedexer.com/info#openInterestHistory")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"openInterestHistory\",\n \"coin\": \"BTC\",\n \"limit\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hypedexer.com/info#openInterestHistory")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"openInterestHistory\",\n \"coin\": \"BTC\",\n \"limit\": 2\n}"
response = http.request(request)
puts response.read_body{
"coin": "BTC",
"history": [
{
"time": 1793449616000,
"openInterest": "41034.9304",
"dayNtlVlm": "2408469008.2558503",
"funding": "1.25e-05",
"premium": "0.0002566414",
"markPx": "77556.0"
},
{
"time": 1793449646000,
"openInterest": "41018.59544",
"dayNtlVlm": "2410148955.323849",
"funding": "1.25e-05",
"premium": "0.00021672110000000002",
"markPx": "77535.0"
}
]
}{
"error": "Invalid API key"
}Market History
Open interest history
Open interest of one perp market sampled from our own node about every 30 seconds, with the mark price, 24h notional volume, funding and premium of each sample.
Window and limit: limit returns the newest limit samples inside [startTime, endTime], oldest first in history. startTime does not set the first sample: to read a past period, set endTime (and startTime) around it.
Retention: about the last 7 days. A window older than that returns an empty history.
POST
/
info#openInterestHistory
Open interest history
curl --request POST \
--url 'https://api.hypedexer.com/info#openInterestHistory' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "openInterestHistory",
"coin": "BTC",
"limit": 2
}
'import requests
url = "https://api.hypedexer.com/info#openInterestHistory"
payload = {
"type": "openInterestHistory",
"coin": "BTC",
"limit": 2
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: 'openInterestHistory', coin: 'BTC', limit: 2})
};
fetch('https://api.hypedexer.com/info#openInterestHistory', 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.hypedexer.com/info#openInterestHistory",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'openInterestHistory',
'coin' => 'BTC',
'limit' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hypedexer.com/info#openInterestHistory"
payload := strings.NewReader("{\n \"type\": \"openInterestHistory\",\n \"coin\": \"BTC\",\n \"limit\": 2\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hypedexer.com/info#openInterestHistory")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"openInterestHistory\",\n \"coin\": \"BTC\",\n \"limit\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hypedexer.com/info#openInterestHistory")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"openInterestHistory\",\n \"coin\": \"BTC\",\n \"limit\": 2\n}"
response = http.request(request)
puts response.read_body{
"coin": "BTC",
"history": [
{
"time": 1793449616000,
"openInterest": "41034.9304",
"dayNtlVlm": "2408469008.2558503",
"funding": "1.25e-05",
"premium": "0.0002566414",
"markPx": "77556.0"
},
{
"time": 1793449646000,
"openInterest": "41018.59544",
"dayNtlVlm": "2410148955.323849",
"funding": "1.25e-05",
"premium": "0.00021672110000000002",
"markPx": "77535.0"
}
]
}{
"error": "Invalid API key"
}Authorizations
Your Hypedexer API key, sent as Authorization: Bearer <key>. The X-API-Key: <key> header and the api_key query parameter are accepted as well.
Body
application/json