GoldRush SDK
import { GoldRushClient } from "@covalenthq/client-sdk";
const ApiServices = async () => {
const client = new GoldRushClient("<GOLDRUSH_API_KEY>");
const resp = await client.BalanceService.getHistoricalPortfolioForWalletAddress("eth-mainnet", "demo.eth");
console.log(resp.data);
};
ApiServices();curl --request GET \
--url https://api.covalenthq.com/v1/{chainName}/address/{walletAddress}/portfolio_v2/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.covalenthq.com/v1/{chainName}/address/{walletAddress}/portfolio_v2/"
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}/portfolio_v2/', 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}/portfolio_v2/",
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}/portfolio_v2/"
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}/portfolio_v2/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.covalenthq.com/v1/{chainName}/address/{walletAddress}/portfolio_v2/")
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>",
"items": [
{
"contract_address": "<string>",
"contract_decimals": 123,
"contract_name": "<string>",
"contract_ticker_symbol": "<string>",
"logo_url": "<string>",
"holdings": [
{
"quote_rate": 123,
"timestamp": "2023-11-07T05:31:56Z",
"close": {
"balance": "<string>",
"quote": 123,
"pretty_quote": "<string>"
},
"high": {},
"low": {},
"open": {}
}
]
}
]
}{
"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 Portfolio Value API
Returns a daily portfolio balance for an address, broken down by token. The timeframe is user-configurable and defaults to 30 days.
GET
/
v1
/
{chainName}
/
address
/
{walletAddress}
/
portfolio_v2
/
GoldRush SDK
import { GoldRushClient } from "@covalenthq/client-sdk";
const ApiServices = async () => {
const client = new GoldRushClient("<GOLDRUSH_API_KEY>");
const resp = await client.BalanceService.getHistoricalPortfolioForWalletAddress("eth-mainnet", "demo.eth");
console.log(resp.data);
};
ApiServices();curl --request GET \
--url https://api.covalenthq.com/v1/{chainName}/address/{walletAddress}/portfolio_v2/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.covalenthq.com/v1/{chainName}/address/{walletAddress}/portfolio_v2/"
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}/portfolio_v2/', 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}/portfolio_v2/",
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}/portfolio_v2/"
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}/portfolio_v2/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.covalenthq.com/v1/{chainName}/address/{walletAddress}/portfolio_v2/")
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>",
"items": [
{
"contract_address": "<string>",
"contract_decimals": 123,
"contract_name": "<string>",
"contract_ticker_symbol": "<string>",
"logo_url": "<string>",
"holdings": [
{
"quote_rate": 123,
"timestamp": "2023-11-07T05:31:56Z",
"close": {
"balance": "<string>",
"quote": 123,
"pretty_quote": "<string>"
},
"high": {},
"low": {},
"open": {}
}
]
}
]
}{
"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
2 per 30 days
Processing
Realtime
Estimate your monthly cost for this API using the Pricing Calculator.
Rebasing tokens (e.g. stETH, aTokens, cTokens) are supported on Foundational Chains.
Authorizations
Path Parameters
Query Parameters
Response
Successful response