Account and Token Balance - Wallet Portfolio
curl --request GET \
--url https://api.amberdata.com/blockchains/addresses/{address}/portfolio \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/blockchains/addresses/{address}/portfolio"
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/{address}/portfolio', 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/{address}/portfolio",
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/{address}/portfolio"
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/{address}/portfolio")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.amberdata.com/blockchains/addresses/{address}/portfolio")
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{
"description": "Successful request",
"payload": {
"data": [
{
"address": "0xe7804c37c13166ff0b37f5ae0bb07a3aebb6e245",
"blockchain": "ethereum-mainnet",
"networkBalance": "0.0482364260664873",
"networkBalanceBlockNumber": 20544276,
"networkBalanceRaw": "48236426066487319",
"tokens": [
{
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"balance": "363.8256",
"balanceRaw": "363825600",
"blockNumber": 20668075,
"decimals": 6,
"name": "Tether USD",
"symbol": "USDT",
"timestamp": "2024-09-03T05:51:23Z"
}
]
}
],
"metadata": {}
},
"status": 200,
"title": "OK"
}"{\n \"description\": \"Invalid parameters: invalid address\",\n \"status\": 400,\n \"title\": \"Bad Request\"\n}"Wallet (Address) Balances
Account and Token Balance - Wallet Portfolio
Shows the last known portfolio composition of an address, including native and token holdings.
GET
/
addresses
/
{address}
/
portfolio
Account and Token Balance - Wallet Portfolio
curl --request GET \
--url https://api.amberdata.com/blockchains/addresses/{address}/portfolio \
--header 'x-api-key: <api-key>'import requests
url = "https://api.amberdata.com/blockchains/addresses/{address}/portfolio"
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/{address}/portfolio', 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/{address}/portfolio",
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/{address}/portfolio"
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/{address}/portfolio")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.amberdata.com/blockchains/addresses/{address}/portfolio")
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{
"description": "Successful request",
"payload": {
"data": [
{
"address": "0xe7804c37c13166ff0b37f5ae0bb07a3aebb6e245",
"blockchain": "ethereum-mainnet",
"networkBalance": "0.0482364260664873",
"networkBalanceBlockNumber": 20544276,
"networkBalanceRaw": "48236426066487319",
"tokens": [
{
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"balance": "363.8256",
"balanceRaw": "363825600",
"blockNumber": 20668075,
"decimals": 6,
"name": "Tether USD",
"symbol": "USDT",
"timestamp": "2024-09-03T05:51:23Z"
}
]
}
],
"metadata": {}
},
"status": 200,
"title": "OK"
}"{\n \"description\": \"Invalid parameters: invalid address\",\n \"status\": 400,\n \"title\": \"Bad Request\"\n}"Authorizations
Path Parameters
The address to retrieve holdings for
Query Parameters
[required] The blockchain to retrieve portfolio holdings for
Available options:
ethereum-mainnet, polygon-mainnet, bnb-mainnet, arb-one-mainnet, bitcoin-mainnet, litecoin-mainnet, bitcoin-abc-mainnet, solana-mainnet Time format of the timestamps in the return payload
Was this page helpful?
⌘I