Account Balance Latest
curl --request GET \
--url https://api.amberdata.com/blockchains/addresses/{hash}/account-balances/latest \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/blockchains/addresses/{hash}/account-balances/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/blockchains/addresses/{hash}/account-balances/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/blockchains/addresses/{hash}/account-balances/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/blockchains/addresses/{hash}/account-balances/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/blockchains/addresses/{hash}/account-balances/latest")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.amberdata.com/blockchains/addresses/{hash}/account-balances/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": {
"address": {
"address": "0x06012c8cf97bead5deae237070f9587f8e7a266d"
},
"blockchainId": "1c9c969065fcd1cf",
"blockNumber": "7817499",
"timestamp": 1558635166000,
"timestampNanoseconds": 0,
"value": "59717752721124107170"
}
}"Unauthorized""Unknown address or address is not a contract"Wallet (Address) Balances
Account Balance Latest
Retrieves the current account balance for the specified address.
GET
/
addresses
/
{hash}
/
account-balances
/
latest
Account Balance Latest
curl --request GET \
--url https://api.amberdata.com/blockchains/addresses/{hash}/account-balances/latest \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/blockchains/addresses/{hash}/account-balances/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/blockchains/addresses/{hash}/account-balances/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/blockchains/addresses/{hash}/account-balances/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/blockchains/addresses/{hash}/account-balances/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/blockchains/addresses/{hash}/account-balances/latest")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.amberdata.com/blockchains/addresses/{hash}/account-balances/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": {
"address": {
"address": "0x06012c8cf97bead5deae237070f9587f8e7a266d"
},
"blockchainId": "1c9c969065fcd1cf",
"blockNumber": "7817499",
"timestamp": 1558635166000,
"timestampNanoseconds": 0,
"value": "59717752721124107170"
}
}"Unauthorized""Unknown address or address is not a contract"Authorizations
Headers
The id of the blockchain
Available options:
bitcoin-mainnet, bitcoin-abc-mainnet, ethereum-mainnet, litecoin-mainnet, polygon-mainnet Path Parameters
address to retrieve the account balance for
Query Parameters
Indicates whether or not to include price data with the results. Options: true, false.
The currency of the price information. Options: usd, btc. Only used in conjunction with includePrice.
[Optional] Indicates whether or not to pull data from blockchain via RCP call. Options: true, false
[Defaults] false
Was this page helpful?