Historical
curl --request GET \
--url https://api.amberdata.com/markets/spot/tickers/{instrument} \
--compressed \
--header 'Accept-Encoding: <accept-encoding>' \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/markets/spot/tickers/{instrument}"
headers = {
"Accept-Encoding": "<accept-encoding>",
"x-api-key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Accept-Encoding': '<accept-encoding>', 'x-api-key': '<api-key>'}
};
fetch('https://api.amberdata.com/markets/spot/tickers/{instrument}', 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/tickers/{instrument}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept-Encoding: <accept-encoding>",
"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/tickers/{instrument}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept-Encoding", "<accept-encoding>")
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/tickers/{instrument}")
.header("Accept-Encoding", "<accept-encoding>")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.amberdata.com/markets/spot/tickers/{instrument}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Accept-Encoding"] = '<accept-encoding>'
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": 200,
"title": "OK",
"description": "Successful request",
"payload": {
"metadata": {
"next": "https://api.amberdata.com/markets/spot/tickers/eth_usdt?cursor=N4IgpgHgxgFghgOwOZhALhAIwJYMVVAGhCgFcAnAZwHtz0FSAbR4ygFznLYBE43U0ARgDsIgKyCxYgMwAOAJwAWWcTAIAJr37oRIgGwAGQfIBMJ6YeK4ojUurABVBJVIAHV7X7qAotHjIwSnQAMzhGSjBiNmwAWzAAMVoYvnQQGOxmbAioag0g4mCklIwAKxoEEFZPAGkwAE9U3WEJKTklWQB9QVlBA0VpDpw8BAIO6WkReVFBQz0OsDYYDtJKdTYQAF8gA",
"api-version": "2023-09-30"
},
"data": [
{
"instrument": "eth_usdt",
"exchange": "binance",
"exchangeTimestamp": 1717515522361,
"exchangeTimestampNanoseconds": 21307,
"bid": 3797.2,
"ask": 3797.21,
"mid": 3797.205,
"last": null,
"bidVolume": 38.2898,
"askVolume": 13.422,
"sequence": "33179708313",
"askTimestamp": null,
"bidTimestamp": null,
"askTimestampNanoseconds": null,
"bidTimestampNanoseconds": null
},
{
"instrument": "eth_usdt",
"exchange": "binance",
"exchangeTimestamp": 1717515522361,
"exchangeTimestampNanoseconds": 169012,
"bid": 3797.2,
"ask": 3797.21,
"mid": 3797.205,
"last": null,
"bidVolume": 38.2898,
"askVolume": 11.8419,
"sequence": "33179708314",
"askTimestamp": null,
"bidTimestamp": null,
"askTimestampNanoseconds": null,
"bidTimestampNanoseconds": null
}
]
}
}Tickers
Historical
Delivers historical ticker data for Spot market trading pairs, providing bid, ask, mid, and last prices, along with respective volumes, timestamps, and sequencing for tracking market price changes over time.
GET
/
spot
/
tickers
/
{instrument}
Historical
curl --request GET \
--url https://api.amberdata.com/markets/spot/tickers/{instrument} \
--compressed \
--header 'Accept-Encoding: <accept-encoding>' \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/markets/spot/tickers/{instrument}"
headers = {
"Accept-Encoding": "<accept-encoding>",
"x-api-key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Accept-Encoding': '<accept-encoding>', 'x-api-key': '<api-key>'}
};
fetch('https://api.amberdata.com/markets/spot/tickers/{instrument}', 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/tickers/{instrument}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept-Encoding: <accept-encoding>",
"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/tickers/{instrument}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Accept-Encoding", "<accept-encoding>")
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/tickers/{instrument}")
.header("Accept-Encoding", "<accept-encoding>")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.amberdata.com/markets/spot/tickers/{instrument}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Accept-Encoding"] = '<accept-encoding>'
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": 200,
"title": "OK",
"description": "Successful request",
"payload": {
"metadata": {
"next": "https://api.amberdata.com/markets/spot/tickers/eth_usdt?cursor=N4IgpgHgxgFghgOwOZhALhAIwJYMVVAGhCgFcAnAZwHtz0FSAbR4ygFznLYBE43U0ARgDsIgKyCxYgMwAOAJwAWWcTAIAJr37oRIgGwAGQfIBMJ6YeK4ojUurABVBJVIAHV7X7qAotHjIwSnQAMzhGSjBiNmwAWzAAMVoYvnQQGOxmbAioag0g4mCklIwAKxoEEFZPAGkwAE9U3WEJKTklWQB9QVlBA0VpDpw8BAIO6WkReVFBQz0OsDYYDtJKdTYQAF8gA",
"api-version": "2023-09-30"
},
"data": [
{
"instrument": "eth_usdt",
"exchange": "binance",
"exchangeTimestamp": 1717515522361,
"exchangeTimestampNanoseconds": 21307,
"bid": 3797.2,
"ask": 3797.21,
"mid": 3797.205,
"last": null,
"bidVolume": 38.2898,
"askVolume": 13.422,
"sequence": "33179708313",
"askTimestamp": null,
"bidTimestamp": null,
"askTimestampNanoseconds": null,
"bidTimestampNanoseconds": null
},
{
"instrument": "eth_usdt",
"exchange": "binance",
"exchangeTimestamp": 1717515522361,
"exchangeTimestampNanoseconds": 169012,
"bid": 3797.2,
"ask": 3797.21,
"mid": 3797.205,
"last": null,
"bidVolume": 38.2898,
"askVolume": 11.8419,
"sequence": "33179708314",
"askTimestamp": null,
"bidTimestamp": null,
"askTimestampNanoseconds": null,
"bidTimestampNanoseconds": null
}
]
}
}The maximum time range (difference between
startDate and endDate) is 731 days (2 years).If the
startDate and endDate query parameters are not provided, the API will return the data from the previous 24 hours.Path Parameters
Query Parameters
[Optional] Specifies the direction in which the data is sorted (by timestamp). [Defaults] asc (ascending order). [Usage Conditions] This parameter can only be used if the startDate and endDate timeframe is within the most recent 24 hours, or if the startDate and endDate parameters are not used at all. [Examples] ascending | descending | asc | desc
Was this page helpful?