cURL
curl --request GET \
--url https://test.deribit.com/api/v2/public/get_index_priceimport requests
url = "https://test.deribit.com/api/v2/public/get_index_price"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://test.deribit.com/api/v2/public/get_index_price', 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://test.deribit.com/api/v2/public/get_index_price",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://test.deribit.com/api/v2/public/get_index_price"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://test.deribit.com/api/v2/public/get_index_price")
.asString();require 'uri'
require 'net/http'
url = URI("https://test.deribit.com/api/v2/public/get_index_price")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"result": {
"index_price": 11628.81,
"estimated_delivery_price": 11628.81
},
"id": 123
}Market Data
public/get_index_price
Retrieves the current index price value for a given index name. Index prices are used as reference prices for mark price calculations and settlement.
Use get_index_price_names or get_supported_index_names to retrieve available index names.
cURL
curl --request GET \
--url https://test.deribit.com/api/v2/public/get_index_priceimport requests
url = "https://test.deribit.com/api/v2/public/get_index_price"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://test.deribit.com/api/v2/public/get_index_price', 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://test.deribit.com/api/v2/public/get_index_price",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://test.deribit.com/api/v2/public/get_index_price"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://test.deribit.com/api/v2/public/get_index_price")
.asString();require 'uri'
require 'net/http'
url = URI("https://test.deribit.com/api/v2/public/get_index_price")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"result": {
"index_price": 11628.81,
"estimated_delivery_price": 11628.81
},
"id": 123
}Query Parameters
Index identifier, matches (base) cryptocurrency with quote currency
Available options:
btc_usd, eth_usd, ada_usdc, algo_usdc, avax_usdc, bch_usdc, bnb_usdc, btc_usdc, btcdvol_usdc, buidl_usdc, doge_usdc, dot_usdc, eurr_usdc, eth_usdc, ethdvol_usdc, hype_usdc, link_usdc, ltc_usdc, near_usdc, paxg_usdc, shib_usdc, sol_usdc, steth_usdc, ton_usdc, trump_usdc, trx_usdc, uni_usdc, usde_usdc, usyc_usdc, xrp_usdc, btc_usdt, eth_usdt, eurr_usdt, sol_usdt, steth_usdt, usdc_usdt, usde_usdt, btc_eurr, btc_usde, btc_usyc, eth_btc, eth_eurr, eth_usde, eth_usyc, steth_eth, paxg_btc, drbfix-btc_usdc, drbfix-eth_usdc Response
200 - application/json
Success response
The JSON-RPC version (2.0)
Available options:
2.0 The id that was sent in the request
Was this page helpful?