Historical
curl --request GET \
--url https://api.amberdata.com/market/defi/ohlcv/{pool}/historical/ \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/market/defi/ohlcv/{pool}/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/defi/ohlcv/{pool}/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/defi/ohlcv/{pool}/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/defi/ohlcv/{pool}/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/defi/ohlcv/{pool}/historical/")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.amberdata.com/market/defi/ohlcv/{pool}/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",
"open",
"high",
"low",
"close",
"volume",
"quoteVolume",
"trades",
"exchangeId",
"pairAddress",
"baseAddress",
"quoteAddress"
],
"startDate": 1727904832187,
"endDate": 1759527232187
},
"data": {
"0x10d05e057cb1ee7eac0559aa7f09bf06f44fd718": [
[
1727913600000,
"0.0004105818335350145800011301445552145",
"0.0004105818335350145800011301445552145",
"0.0004105818335350145800011301445552145",
"0.0004105818335350145800011301445552145",
"6.3820423846392694",
"0.0026203506639833680000000000000000002340430932402863",
"1",
"0x10d05e057cb1ee7eac0559aa7f09bf06f44fd718",
"0x05f4e094c8f77d001a05dc7ffef208ccbea47079",
"0x6b175474e89094c44da98b954eedeac495271d0f",
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
]
]
}
}
}DEX - OHLCV
Historical
Retrieves the historical (time series) open-high-low-close for the specified pair. Includes data for exchanges depending on where the pair is traded. Base & Quote information is using the first and second asset in a pool/pair, which is the represented price.
GET
/
ohlcv
/
{pool}
/
historical
/
Historical
curl --request GET \
--url https://api.amberdata.com/market/defi/ohlcv/{pool}/historical/ \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/market/defi/ohlcv/{pool}/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/defi/ohlcv/{pool}/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/defi/ohlcv/{pool}/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/defi/ohlcv/{pool}/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/defi/ohlcv/{pool}/historical/")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.amberdata.com/market/defi/ohlcv/{pool}/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",
"open",
"high",
"low",
"close",
"volume",
"quoteVolume",
"trades",
"exchangeId",
"pairAddress",
"baseAddress",
"quoteAddress"
],
"startDate": 1727904832187,
"endDate": 1759527232187
},
"data": {
"0x10d05e057cb1ee7eac0559aa7f09bf06f44fd718": [
[
1727913600000,
"0.0004105818335350145800011301445552145",
"0.0004105818335350145800011301445552145",
"0.0004105818335350145800011301445552145",
"0.0004105818335350145800011301445552145",
"6.3820423846392694",
"0.0026203506639833680000000000000000002340430932402863",
"1",
"0x10d05e057cb1ee7eac0559aa7f09bf06f44fd718",
"0x05f4e094c8f77d001a05dc7ffef208ccbea47079",
"0x6b175474e89094c44da98b954eedeac495271d0f",
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
]
]
}
}
}Authorizations
Path Parameters
The pool to retrieve the most current data. Can be the pool/pair symbols or address.
Query Parameters
The exchange(s) for which to retrieve OHLCV. Example: exchange=uniswapv2, uniswapv3
FIlter by pairs after this date.
FIlter by pairs before this date.
[Optional] Time interval.
[Defaults] minutes | hours | days*
[Optional] Time format of the timestamps in the return payload.
[Defaults] milliseconds | ms* | iso | iso8601 | hr | human_readable
Was this page helpful?