curl --request GET \
--url https://api.amberdata.com/markets/spot/reference-rates/{assetId} \
--compressed \
--header 'Accept-Encoding: <accept-encoding>' \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/markets/spot/reference-rates/{assetId}"
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/reference-rates/{assetId}', 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/reference-rates/{assetId}",
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/reference-rates/{assetId}"
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/reference-rates/{assetId}")
.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/reference-rates/{assetId}")
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": {
"timeInterval": "hours",
"api-version": "2023-09-30"
},
"data": {
"assetARCID": "eth",
"assetSymbol": "eth",
"assetName": "Ether",
"currency": "usd",
"referenceRates": [
{
"timestamp": "2023-11-05 18:00:00 000",
"unitPrice": 1896.2722539256226
},
{
"timestamp": "2023-11-05 19:00:00 000",
"unitPrice": 1892.070741279808
},
{
"timestamp": "2023-11-05 20:00:00 000",
"unitPrice": 1888.6184732343843
},
{
"timestamp": "2023-11-05 21:00:00 000",
"unitPrice": 1870.1300714429476
},
{
"timestamp": "2023-11-05 22:00:00 000",
"unitPrice": 1881.8808731384033
}
]
}
}
}Hourly & Daily Reference Rates
Retrieve the historical (time series) hourly and daily reference rates for a specific asset.
curl --request GET \
--url https://api.amberdata.com/markets/spot/reference-rates/{assetId} \
--compressed \
--header 'Accept-Encoding: <accept-encoding>' \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/markets/spot/reference-rates/{assetId}"
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/reference-rates/{assetId}', 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/reference-rates/{assetId}",
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/reference-rates/{assetId}"
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/reference-rates/{assetId}")
.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/reference-rates/{assetId}")
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": {
"timeInterval": "hours",
"api-version": "2023-09-30"
},
"data": {
"assetARCID": "eth",
"assetSymbol": "eth",
"assetName": "Ether",
"currency": "usd",
"referenceRates": [
{
"timestamp": "2023-11-05 18:00:00 000",
"unitPrice": 1896.2722539256226
},
{
"timestamp": "2023-11-05 19:00:00 000",
"unitPrice": 1892.070741279808
},
{
"timestamp": "2023-11-05 20:00:00 000",
"unitPrice": 1888.6184732343843
},
{
"timestamp": "2023-11-05 21:00:00 000",
"unitPrice": 1870.1300714429476
},
{
"timestamp": "2023-11-05 22:00:00 000",
"unitPrice": 1881.8808731384033
}
]
}
}
}Authorizations
Path Parameters
The id of the asset for which reference rates are needed.
btc, eth Query Parameters
[Optional] Payload only includes data after this date (inclusive). [Formats] seconds | milliseconds | iso8601 [Examples] 1578531600 | 1578531600000 | 2020-09-01T01:00:00
[Optional] Payload only includes data before this date (exclusive). [Formats] seconds | milliseconds | iso8601 [Examples] 1578531600 | 1578531600000 | 2020-09-01T01:00:00
[Optional] Time format of the timestamps in the return payload.
milliseconds, ms*, iso, iso8601, hr, human_readable Specify the granularity of the desired reference rate.
hours, days Use with timeInterval=days. Filter for the asset's daily reference rate at 16:00 hours for a specific timezone. [Examples] dailyTime=T16:00+08:00 is 16:00 Singapore & Hong Kong
T16:00-05:00, T16:00-04:00, T16:00+00:00, T16:00+01:00, T16:00+04:00, T16:00+08:00, T16:00+09:00 The order in which to return the results (ascending or descending). By default, records are returned in descending order, so the most recent records are returned first.
desc, asc Was this page helpful?