Latest
curl --request GET \
--url https://api.amberdata.com/market/defi/ohlcv/{pool}/latest/ \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/market/defi/ohlcv/{pool}/latest/"
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}/latest/', 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}/latest/",
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}/latest/"
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}/latest/")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.amberdata.com/market/defi/ohlcv/{pool}/latest/")
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": {
"0xae461ca67b15dc8dc81ce7615e0320da1a9ab8d5": {
"exchangeName": "uniswapv2",
"exchangeId": "0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f",
"pair": "DAI_USDC",
"pairAddress": "0xae461ca67b15dc8dc81ce7615e0320da1a9ab8d5",
"baseAddress": "0x6b175474e89094c44da98b954eedeac495271d0f",
"baseCurrencyAddress": "",
"baseName": "Dai Stablecoin",
"baseSymbol": "DAI",
"baseDecimals": "18",
"quoteAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"quoteCurrencyAddress": "",
"quoteName": "USD Coin",
"quoteSymbol": "USDC",
"quoteDecimals": "6",
"blockchainNetworkId": "1",
"blockchainId": "1c9c969065fcd1cf",
"timestamp": 1654289760000,
"index": 6,
"poolAddresses": [
""
],
"pairName": null,
"poolNames": null,
"poolSymbols": null,
"poolDecimals": null,
"poolUnderlyingAddresses": null,
"poolUnderlyingNames": null,
"poolUnderlyingSymbols": null,
"poolUnderlyingDecimals": null,
"pairNormalized": "dai_usdc",
"fee": 0.003,
"milliseconds": 1654289760000,
"open": "1.00264698775035179406",
"high": "1.00264698775035179406",
"low": "1.00264698775035179406",
"close": "1.00264698775035179406",
"volume": "56.960215",
"trades": 1
}
}
}DEX - OHLCV
Latest
Retrieves the latest open-high-low-close for the specified pair. Includes data for exchanges depending on where the pair is traded. Asset information is included in the payload. Base & Quote information is using the first and second asset in a pool/pair, which is the represented price.
GET
/
ohlcv
/
{pool}
/
latest
/
Latest
curl --request GET \
--url https://api.amberdata.com/market/defi/ohlcv/{pool}/latest/ \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/market/defi/ohlcv/{pool}/latest/"
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}/latest/', 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}/latest/",
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}/latest/"
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}/latest/")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.amberdata.com/market/defi/ohlcv/{pool}/latest/")
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": {
"0xae461ca67b15dc8dc81ce7615e0320da1a9ab8d5": {
"exchangeName": "uniswapv2",
"exchangeId": "0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f",
"pair": "DAI_USDC",
"pairAddress": "0xae461ca67b15dc8dc81ce7615e0320da1a9ab8d5",
"baseAddress": "0x6b175474e89094c44da98b954eedeac495271d0f",
"baseCurrencyAddress": "",
"baseName": "Dai Stablecoin",
"baseSymbol": "DAI",
"baseDecimals": "18",
"quoteAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"quoteCurrencyAddress": "",
"quoteName": "USD Coin",
"quoteSymbol": "USDC",
"quoteDecimals": "6",
"blockchainNetworkId": "1",
"blockchainId": "1c9c969065fcd1cf",
"timestamp": 1654289760000,
"index": 6,
"poolAddresses": [
""
],
"pairName": null,
"poolNames": null,
"poolSymbols": null,
"poolDecimals": null,
"poolUnderlyingAddresses": null,
"poolUnderlyingNames": null,
"poolUnderlyingSymbols": null,
"poolUnderlyingDecimals": null,
"pairNormalized": "dai_usdc",
"fee": 0.003,
"milliseconds": 1654289760000,
"open": "1.00264698775035179406",
"high": "1.00264698775035179406",
"low": "1.00264698775035179406",
"close": "1.00264698775035179406",
"volume": "56.960215",
"trades": 1
}
}
}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=uniswapv3
[Optional] Time format of the timestamps in the return payload.
[Defaults] milliseconds | ms* | iso | iso8601 | hr | human_readable
Was this page helpful?
⌘I