Exchanges Latest
curl --request GET \
--url https://api.amberdata.com/market/defi/metrics/exchanges/{exchange}/latest \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/market/defi/metrics/exchanges/{exchange}/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/metrics/exchanges/{exchange}/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/metrics/exchanges/{exchange}/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/metrics/exchanges/{exchange}/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/metrics/exchanges/{exchange}/latest")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.amberdata.com/market/defi/metrics/exchanges/{exchange}/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": [
{
"exchangeId": "0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f",
"timestamp": "2020-12-29T07:00:00.000Z",
"liquidityTotalWETH": "696597.309479738872001810",
"liquidityTotalUSD": "493048636.201664275395561830",
"pairsTradedTotal": 52,
"pairsCumulativeTotal": 27293,
"tradesTotal": 85
}
]
}DEX - Metrics
Exchanges Latest
Retrieves the latest exchange daily metrics for the specified decentralized exchange.
GET
/
metrics
/
exchanges
/
{exchange}
/
latest
Exchanges Latest
curl --request GET \
--url https://api.amberdata.com/market/defi/metrics/exchanges/{exchange}/latest \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/market/defi/metrics/exchanges/{exchange}/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/metrics/exchanges/{exchange}/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/metrics/exchanges/{exchange}/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/metrics/exchanges/{exchange}/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/metrics/exchanges/{exchange}/latest")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.amberdata.com/market/defi/metrics/exchanges/{exchange}/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": [
{
"exchangeId": "0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f",
"timestamp": "2020-12-29T07:00:00.000Z",
"liquidityTotalWETH": "696597.309479738872001810",
"liquidityTotalUSD": "493048636.201664275395561830",
"pairsTradedTotal": 52,
"pairsCumulativeTotal": 27293,
"tradesTotal": 85
}
]
}Authorizations
Path Parameters
Exchange for which to return the global metrics - can be specified as:
- a name: uniswapv2
- an id: 0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f
Query Parameters
[Optional] Time format of the timestamps in the return payload.
[Defaults] milliseconds | ms* | iso | iso8601 | hr | human_readable
Was this page helpful?
⌘I