Skip to main content
GET
/
addresses
/
{hash}
/
token-balances
/
historical
Token Balances Historical
curl --request GET \
  --url https://api.amberdata.com/blockchains/addresses/{hash}/token-balances/historical \
  --header 'x-api-key: <api-key>'
import requests

url = "https://api.amberdata.com/blockchains/addresses/{hash}/token-balances/historical"

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}/token-balances/historical', 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}/token-balances/historical",
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}/token-balances/historical"

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}/token-balances/historical")
.header("x-api-key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.amberdata.com/blockchains/addresses/{hash}/token-balances/historical")

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": {
    "totalRecords": 804219,
    "records": [
      {
        "blockchainId": "1c9c969065fcd1cf",
        "amount": "1341",
        "address": "0x06012c8cf97bead5deae237070f9587f8e7a266d",
        "holder": "0xbae25a69a6eb7341ee834be7635e247e22a1e57a",
        "decimals": "0",
        "name": "CryptoKitties",
        "symbol": "CK",
        "isERC20": false,
        "isERC721": true,
        "isERC777": false,
        "isERC884": false,
        "isERC998": false
      }
    ]
  }
}
"{}"

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,
polygon-mainnet

Path Parameters

hash
string
default:0x19bf56fca395a600c20f732b05757f30ad24a719
required

The address to retrieve tokens for

Query Parameters

amount
integer<int32>

Filters by token balances which value is equal to this amount

amountGt
integer<int32>

Filter by token balances which value is greater than this amount

amountGte
integer<int32>

Filter by token balances which value is greater than or equal to this amount

amountLt
integer<int32>

Filter by token balances which value is less than this amount

amountLte
integer<int32>

Filter by token balances which value is less than or equal to this amount

blockNumber
integer<int32>

Filter by blockNumber

startDate
string<date-time>

Get balance after a start date (Requires endDate)

endDate
string<date-time>

Get balances before the specified date (Requires startDate)

tokenAddress
string

Filter by the specified token address.

page
integer<int32>
default:0

The page number to return.

size
integer<int32>
default:50

Number of records per page

Response

200

status
integer
default:0
Example:

200

title
string
Example:

"OK"

description
string
Example:

"Successful request"

payload
object