curl --request GET \
--url https://api.amberdata.com/market/tokens/prices/{symbol}/historical \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/market/tokens/prices/{symbol}/historical"
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/market/tokens/prices/{symbol}/historical', 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/market/tokens/prices/{symbol}/historical",
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/market/tokens/prices/{symbol}/historical"
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/market/tokens/prices/{symbol}/historical")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.amberdata.com/market/tokens/prices/{symbol}/historical")
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": {
"metadata": {
"columns": [
"timestamp",
"priceUSD",
"hourlyPercentChangeUSD",
"dailyPercentChangeUSD",
"dailyVolumeUSD",
"weeklyPercentChangeUSD",
"circulatingSupply",
"totalSupply",
"marketCapUSD"
],
"startDate": 1573257600000,
"endDate": 1575849600000,
"decimals": "18"
},
"data": [
[
1573257600000,
664.99,
-0.49156410160487823,
-0.06386991576685226,
2838.994792207,
26.020258298037653,
"999999.9999999000000000",
"3619999.99999963800000000000000000000000",
"664990000.00000000000000000000000000000000"
],
[
1573344000000,
664.99,
1.3271774242701286,
-0.42973078190039826,
2123.3865779946,
25.263009182952672,
"999999.9999999000000000",
"1000000.0000000000000000",
"664990000.00000000000000000000000000000000"
]
]
}
}{}Historical
Retrieves the historical prices (and other market information) for the specified token from October 2019 forward.
Note: This endpoint returns a max of 6 months of historical data. In order to get more than 6 months you must use the startDate & endDate parameters to move the time frame window to get the next n days/months of data.
curl --request GET \
--url https://api.amberdata.com/market/tokens/prices/{symbol}/historical \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/market/tokens/prices/{symbol}/historical"
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/market/tokens/prices/{symbol}/historical', 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/market/tokens/prices/{symbol}/historical",
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/market/tokens/prices/{symbol}/historical"
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/market/tokens/prices/{symbol}/historical")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.amberdata.com/market/tokens/prices/{symbol}/historical")
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": {
"metadata": {
"columns": [
"timestamp",
"priceUSD",
"hourlyPercentChangeUSD",
"dailyPercentChangeUSD",
"dailyVolumeUSD",
"weeklyPercentChangeUSD",
"circulatingSupply",
"totalSupply",
"marketCapUSD"
],
"startDate": 1573257600000,
"endDate": 1575849600000,
"decimals": "18"
},
"data": [
[
1573257600000,
664.99,
-0.49156410160487823,
-0.06386991576685226,
2838.994792207,
26.020258298037653,
"999999.9999999000000000",
"3619999.99999963800000000000000000000000",
"664990000.00000000000000000000000000000000"
],
[
1573344000000,
664.99,
1.3271774242701286,
-0.42973078190039826,
2123.3865779946,
25.263009182952672,
"999999.9999999000000000",
"1000000.0000000000000000",
"664990000.00000000000000000000000000000000"
]
]
}
}{}Authorizations
Path Parameters
The symbol of the token for which to retrieve prices.
Query Parameters
Filter by prices after this date (expressed as milliseconds, for example 1590969600000). Note that the interval can not exceed 6 months (d), 30 days (h) or 24 hours (m).
Filter by prices before this date (expressed as milliseconds, for example 1593561600000). Note that the interval can not exceed 6 months (d), 30 days (h) or 24 hours (m).
The time interval to return the historical data in: by day (d), by hour (h), or by minute (m).
[Optional] Time format of the timestamps in the return payload.
[Defaults] milliseconds | ms* | iso | iso8601 | hr | human_readable
Response
200
Was this page helpful?