Account and Token Balance Latest
curl --request GET \
--url https://api.amberdata.com/blockchains/addresses/{hash}/balances \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/blockchains/addresses/{hash}/balances"
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/blockchains/addresses/{hash}/balances', 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/blockchains/addresses/{hash}/balances",
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/blockchains/addresses/{hash}/balances"
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/blockchains/addresses/{hash}/balances")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.amberdata.com/blockchains/addresses/{hash}/balances")
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": {
"balance": "5.4777658867801856271744e+22",
"balanceIn": "5.5265160095722306803399618e+25",
"balanceOut": "5.5210382436854504947127874e+25",
"tokens": [
{
"address": "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
"decimals": 18,
"milliseconds": 1559665587000,
"name": "Maker",
"symbol": "MKR",
"amount": "187720361680000000000",
"timestamp": 1559665587000,
"price": {
"amount": {
"currency": "usd",
"quote": "680.815866247",
"total": "127803.0006493693442149600000000"
}
}
}
]
}
}"Unauthorized""Unknown address or address is not a contract"Wallet (Address) Balances
Account and Token Balance Latest
Retrieves the latest account and token balances for the specified address.
GET
/
addresses
/
{hash}
/
balances
Account and Token Balance Latest
curl --request GET \
--url https://api.amberdata.com/blockchains/addresses/{hash}/balances \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/blockchains/addresses/{hash}/balances"
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/blockchains/addresses/{hash}/balances', 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/blockchains/addresses/{hash}/balances",
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/blockchains/addresses/{hash}/balances"
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/blockchains/addresses/{hash}/balances")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.amberdata.com/blockchains/addresses/{hash}/balances")
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": {
"balance": "5.4777658867801856271744e+22",
"balanceIn": "5.5265160095722306803399618e+25",
"balanceOut": "5.5210382436854504947127874e+25",
"tokens": [
{
"address": "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
"decimals": 18,
"milliseconds": 1559665587000,
"name": "Maker",
"symbol": "MKR",
"amount": "187720361680000000000",
"timestamp": 1559665587000,
"price": {
"amount": {
"currency": "usd",
"quote": "680.815866247",
"total": "127803.0006493693442149600000000"
}
}
}
]
}
}"Unauthorized""Unknown address or address is not a contract"Authorizations
Headers
The id of the blockchain
Available options:
ethereum-mainnet, solana-mainnet Path Parameters
The address for which to retrieve balances.
Query Parameters
Indicates whether or not to include price data with the results. Options: true, false.
The currency of the price information (usd or btc.) - only used in conjunction with includePrice.
[Optional] Time format of the timestamps in the return payload.
[Defaults] milliseconds | ms* | iso | iso8601 | hr | human_readable
Was this page helpful?