curl --request GET \
--url https://api.amberdata.com/markets/derivatives/analytics/futures-perpetuals/depth/bid-ask-spread \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/markets/derivatives/analytics/futures-perpetuals/depth/bid-ask-spread"
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.amberdata.com/markets/derivatives/analytics/futures-perpetuals/depth/bid-ask-spread', 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.amberdata.com/markets/derivatives/analytics/futures-perpetuals/depth/bid-ask-spread",
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.amberdata.com/markets/derivatives/analytics/futures-perpetuals/depth/bid-ask-spread"
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.amberdata.com/markets/derivatives/analytics/futures-perpetuals/depth/bid-ask-spread")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.amberdata.com/markets/derivatives/analytics/futures-perpetuals/depth/bid-ask-spread")
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{
"status": 200,
"title": "OK",
"description": "Successful request",
"payload": {
"data": [
{
"bestAskPrice": 96589.6,
"bestBidPrice": 96222.19,
"exchange": "deribit",
"midPrice": 96405.895,
"pair": "BTC-PERPETUAL",
"spread": 367.4100000000035,
"spreadPercent": 0.3811074001232015,
"timestamp": 1746144000000
}
]
}
}{}Bid Ask Spread
This endpoint allows users to explore the bid-ask spread for a specific futures or perpetual assets across one or more exchanges. It provides both the absolute dollar spread (based on the best bid and offer) and the spread as a percentage of the mid-price.
curl --request GET \
--url https://api.amberdata.com/markets/derivatives/analytics/futures-perpetuals/depth/bid-ask-spread \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/markets/derivatives/analytics/futures-perpetuals/depth/bid-ask-spread"
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.amberdata.com/markets/derivatives/analytics/futures-perpetuals/depth/bid-ask-spread', 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.amberdata.com/markets/derivatives/analytics/futures-perpetuals/depth/bid-ask-spread",
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.amberdata.com/markets/derivatives/analytics/futures-perpetuals/depth/bid-ask-spread"
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.amberdata.com/markets/derivatives/analytics/futures-perpetuals/depth/bid-ask-spread")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.amberdata.com/markets/derivatives/analytics/futures-perpetuals/depth/bid-ask-spread")
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{
"status": 200,
"title": "OK",
"description": "Successful request",
"payload": {
"data": [
{
"bestAskPrice": 96589.6,
"bestBidPrice": 96222.19,
"exchange": "deribit",
"midPrice": 96405.895,
"pair": "BTC-PERPETUAL",
"spread": 367.4100000000035,
"spreadPercent": 0.3811074001232015,
"timestamp": 1746144000000
}
]
}
}{}Authorizations
Query Parameters
[Required] The currency for the futures or perpetual instruments.
[Examples] btc | btc-perpetual
[Required] The exchange for the associated bid ask spread.
[Examples] deribit | okex | binance | binanceus
[Optional] Payload only includes data after this date (inclusive).
[Formats] seconds | milliseconds | iso8601
[Examples] 1578531600 | 1578531600000 | 2025-02-27
[Optional] Payload only includes data up to this date (exclusive).
[Formats] seconds | milliseconds | iso8601
[Examples] 1578531600 | 1578531600000 | 2025-02-28
[Optional] Time format of the timestamps in the return payload.
[Defaults] milliseconds | ms* | iso | iso8601 | hr | human_readable
Was this page helpful?