Skip to main content
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

x-api-key
string
header
required

Headers

x-amberdata-blockchain-id
enum<string>
default:ethereum-mainnet

The id of the blockchain

Available options:
ethereum-mainnet,
solana-mainnet

Path Parameters

hash
string
default:0x3f5ce5fbfe3e9af3971dd833d26ba9b5c936f0be
required

The address for which to retrieve balances.

Query Parameters

includePrice
boolean

Indicates whether or not to include price data with the results. Options: true, false.

currency
string

The currency of the price information (usd or btc.) - only used in conjunction with includePrice.

timeFormat
string

[Optional] Time format of the timestamps in the return payload.
[Defaults] milliseconds | ms* | iso | iso8601 | hr | human_readable

Response

OK

status
integer
default:0
Example:

200

title
string
Example:

"OK"

description
string
Example:

"Successful request"

payload
object