curl --request GET \
--url https://api.amberdata.com/markets/spot/analytics/depth/bid-ask-spread \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/markets/spot/analytics/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/spot/analytics/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/spot/analytics/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/spot/analytics/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/spot/analytics/depth/bid-ask-spread")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.amberdata.com/markets/spot/analytics/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": "binanceus",
"midPrice": 96405.895,
"pair": "btc_usd",
"spread": 367.4100000000035,
"spreadPercent": 0.3811074001232015,
"timestamp": 1746144000000
},
{
"bestAskPrice": 96524.98,
"bestBidPrice": 96523.62,
"exchange": "gdax",
"midPrice": 96524.29999999999,
"pair": "btc_usd",
"spread": 1.360000000000582,
"spreadPercent": 0.0014089716268344678,
"timestamp": 1746144000000
},
{
"bestAskPrice": 96469.9,
"bestBidPrice": 96469.8,
"exchange": "kraken",
"midPrice": 96469.85,
"pair": "btc_usd",
"spread": 0.09999999999126885,
"spreadPercent": 0.00010365932982301604,
"timestamp": 1746144000000
},
{
"bestAskPrice": 96504.1,
"bestBidPrice": 96486.8,
"exchange": "okex",
"midPrice": 96495.45000000001,
"pair": "btc_usd",
"spread": 17.30000000000291,
"spreadPercent": 0.017928306464193813,
"timestamp": 1746144000000
},
{
"bestAskPrice": 96589.61,
"bestBidPrice": 96222.19,
"exchange": "binanceus",
"midPrice": 96405.9,
"pair": "btc_usd",
"spread": 367.41999999999825,
"spreadPercent": 0.3811177531665575,
"timestamp": 1746143940000
},
{
"bestAskPrice": 96537.56,
"bestBidPrice": 96537.55,
"exchange": "gdax",
"midPrice": 96537.555,
"pair": "btc_usd",
"spread": 0.00999999999476131,
"spreadPercent": 0.000010358663004010523,
"timestamp": 1746143940000
}
]
}
}{}Bid Ask Spread
This endpoint allows users to explore the bid-ask spread for a specific trading pair or underlying asset 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/spot/analytics/depth/bid-ask-spread \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/markets/spot/analytics/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/spot/analytics/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/spot/analytics/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/spot/analytics/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/spot/analytics/depth/bid-ask-spread")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.amberdata.com/markets/spot/analytics/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": "binanceus",
"midPrice": 96405.895,
"pair": "btc_usd",
"spread": 367.4100000000035,
"spreadPercent": 0.3811074001232015,
"timestamp": 1746144000000
},
{
"bestAskPrice": 96524.98,
"bestBidPrice": 96523.62,
"exchange": "gdax",
"midPrice": 96524.29999999999,
"pair": "btc_usd",
"spread": 1.360000000000582,
"spreadPercent": 0.0014089716268344678,
"timestamp": 1746144000000
},
{
"bestAskPrice": 96469.9,
"bestBidPrice": 96469.8,
"exchange": "kraken",
"midPrice": 96469.85,
"pair": "btc_usd",
"spread": 0.09999999999126885,
"spreadPercent": 0.00010365932982301604,
"timestamp": 1746144000000
},
{
"bestAskPrice": 96504.1,
"bestBidPrice": 96486.8,
"exchange": "okex",
"midPrice": 96495.45000000001,
"pair": "btc_usd",
"spread": 17.30000000000291,
"spreadPercent": 0.017928306464193813,
"timestamp": 1746144000000
},
{
"bestAskPrice": 96589.61,
"bestBidPrice": 96222.19,
"exchange": "binanceus",
"midPrice": 96405.9,
"pair": "btc_usd",
"spread": 367.41999999999825,
"spreadPercent": 0.3811177531665575,
"timestamp": 1746143940000
},
{
"bestAskPrice": 96537.56,
"bestBidPrice": 96537.55,
"exchange": "gdax",
"midPrice": 96537.555,
"pair": "btc_usd",
"spread": 0.00999999999476131,
"spreadPercent": 0.000010358663004010523,
"timestamp": 1746143940000
}
]
}
}{}Authorizations
Query Parameters
[Required] The currency pair for the spot instrument.
[Examples] btc_usd | btc_usdc | eth_usd
[Required] This parameter controls how the provided trading pair symbol is interpreted. When set to FALSE, it returns data only for the exact pair specified (e.g., btc_usd). When set to TRUE, it enables fuzzy matching—users can then pass just the base asset (e.g., btc) returns all pairs with that base (e.g., btc_eur, btc_usd, btc_usdt, etc.), while passing a full pair like btc_usd returns all pairs with the same base and similar USD-related quote assets (e.g., btc_usd, btc_usdt, btc_usdc, etc.).
[Optional] The exchange for the associated bid ask spread.
[Examples] gdax | 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?