GoldRush SDK
import { GoldRushClient } from "@covalenthq/client-sdk";
const ApiServices = async () => {
const client = new GoldRushClient("<GOLDRUSH_API_KEY>");
const resp = await client.BalanceService.getHistoricalTokenBalancesForWalletAddress("eth-mainnet", "demo.eth");
console.log(resp.data);
};
ApiServices();curl --request GET \
--url https://api.covalenthq.com/v1/{chainName}/address/{walletAddress}/historical_balances/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.covalenthq.com/v1/{chainName}/address/{walletAddress}/historical_balances/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.covalenthq.com/v1/{chainName}/address/{walletAddress}/historical_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.covalenthq.com/v1/{chainName}/address/{walletAddress}/historical_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 => [
"Authorization: Bearer <token>"
],
]);
$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.covalenthq.com/v1/{chainName}/address/{walletAddress}/historical_balances/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.covalenthq.com/v1/{chainName}/address/{walletAddress}/historical_balances/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.covalenthq.com/v1/{chainName}/address/{walletAddress}/historical_balances/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"address": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"quote_currency": "<string>",
"chain_id": 123,
"chain_name": "<string>",
"chain_tip_height": 123,
"chain_tip_signed_at": "2023-11-07T05:31:56Z",
"items": [
{
"contract_decimals": 123,
"contract_name": "<string>",
"contract_ticker_symbol": "<string>",
"contract_address": "<string>",
"supports_erc": [
"<string>"
],
"logo_url": "<string>",
"block_height": 123,
"last_transferred_block_height": 123,
"contract_display_name": "<string>",
"last_transferred_at": "2023-11-07T05:31:56Z",
"is_native_token": true,
"type": "<string>",
"is_spam": true,
"balance": "<string>",
"quote_rate": 123,
"quote": 123,
"pretty_quote": "<string>"
}
]
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "Chain nosuchchain-mainnet not supported.",
"error_code": 501
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "Too many concurrent database requests",
"error_code": 556
}Balances
Historical Token Balance API
Fetches the historical native and fungible (ERC20) tokens held by an address at a given block height or date.
GET
/
v1
/
{chainName}
/
address
/
{walletAddress}
/
historical_balances
/
GoldRush SDK
import { GoldRushClient } from "@covalenthq/client-sdk";
const ApiServices = async () => {
const client = new GoldRushClient("<GOLDRUSH_API_KEY>");
const resp = await client.BalanceService.getHistoricalTokenBalancesForWalletAddress("eth-mainnet", "demo.eth");
console.log(resp.data);
};
ApiServices();curl --request GET \
--url https://api.covalenthq.com/v1/{chainName}/address/{walletAddress}/historical_balances/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.covalenthq.com/v1/{chainName}/address/{walletAddress}/historical_balances/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.covalenthq.com/v1/{chainName}/address/{walletAddress}/historical_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.covalenthq.com/v1/{chainName}/address/{walletAddress}/historical_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 => [
"Authorization: Bearer <token>"
],
]);
$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.covalenthq.com/v1/{chainName}/address/{walletAddress}/historical_balances/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.covalenthq.com/v1/{chainName}/address/{walletAddress}/historical_balances/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.covalenthq.com/v1/{chainName}/address/{walletAddress}/historical_balances/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"address": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"quote_currency": "<string>",
"chain_id": 123,
"chain_name": "<string>",
"chain_tip_height": 123,
"chain_tip_signed_at": "2023-11-07T05:31:56Z",
"items": [
{
"contract_decimals": 123,
"contract_name": "<string>",
"contract_ticker_symbol": "<string>",
"contract_address": "<string>",
"supports_erc": [
"<string>"
],
"logo_url": "<string>",
"block_height": 123,
"last_transferred_block_height": 123,
"contract_display_name": "<string>",
"last_transferred_at": "2023-11-07T05:31:56Z",
"is_native_token": true,
"type": "<string>",
"is_spam": true,
"balance": "<string>",
"quote_rate": 123,
"quote": 123,
"pretty_quote": "<string>"
}
]
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "Chain nosuchchain-mainnet not supported.",
"error_code": 501
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "Too many concurrent database requests",
"error_code": 556
}Credit Cost
1 per call
Processing
Realtime
Estimate your monthly cost for this API using the Pricing Calculator.
Endpoint only supported on all Foundational Chains.Rebasing tokens (e.g. stETH, aTokens, cTokens) also supported on Foundational Chains.
Authorizations
Path Parameters
Query Parameters
Response
Successful response