Get Portfolio
GET /portfolio | Auth: Required
Get token balances and total USD value for a wallet address. Supports both EVM and Solana wallets.
Request
Parameters
Query string parameters:
| Field | Type | Required | Description |
|---|---|---|---|
wallet_address | string | Yes | Wallet address. 0x-prefixed hex for EVM chains, or base58-encoded for Solana. |
chain | string | No | Filter to a specific chain key (e.g., "base", "solana"). If omitted, returns balances across all supported chains. |
Example
GET /portfolio?wallet_address=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&chain=ethereum
Response
Status: 200 OKFields
| Field | Type | Description |
|---|---|---|
success | boolean | Always true. |
wallet_address | string | The queried wallet address. |
total_usd | number | Total portfolio value in USD across all returned balances. |
balances | array | List of token balances with non-zero amounts. |
balances[].symbol | string | Token symbol. |
balances[].chain | string | Chain key where this balance exists. |
balances[].balance | string | Human-readable token balance (decimal string). |
balances[].usd_value | number | Current USD value of this balance. |
Example
{
"hl-key">"success": true,
"hl-key">"wallet_address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"hl-key">"total_usd": 48250.75,
"hl-key">"balances": [
{
"hl-key">"symbol": "ETH",
"hl-key">"chain": "ethereum",
"hl-key">"balance": "12.5",
"hl-key">"usd_value": 43755.25
},
{
"hl-key">"symbol": "USDC",
"hl-key">"chain": "ethereum",
"hl-key">"balance": "3200.00",
"hl-key">"usd_value": 3200.00
},
{
"hl-key">"symbol": "DAI",
"hl-key">"chain": "ethereum",
"hl-key">"balance": "1295.50",
"hl-key">"usd_value": 1295.50
}
]
}
Solana Example
GET /portfolio?wallet_address=7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU&chain=solana
{
"hl-key">"success": true,
"hl-key">"wallet_address": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"hl-key">"total_usd": 2180.40,
"hl-key">"balances": [
{
"hl-key">"symbol": "SOL",
"hl-key">"chain": "solana",
"hl-key">"balance": "14.2",
"hl-key">"usd_value": 2070.36
},
{
"hl-key">"symbol": "USDC",
"hl-key">"chain": "solana",
"hl-key">"balance": "110.04",
"hl-key">"usd_value": 110.04
}
]
}
Errors
| Status | Error | Description |
|---|---|---|
| 400 | "wallet_address is required" | The wallet_address query parameter is missing. |
| 400 | "Invalid wallet address format" | The address is not a valid EVM or Solana address. |
| 400 | "Unknown chain 'xyz'" | The provided chain key does not match any supported chain. |
| 401 | "Invalid or missing API key" | The API key is missing, malformed, or revoked. |
Code Examples
curl
-str">"hl-comment"># EVM wallet on all chains
-kw">curl -str">"https://api.suwappu.bot/v1/agent/portfolio?wallet_address=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" \
-H -str">"Authorization: Bearer suwappu_sk_your_api_key"
-str">"hl-comment"># Solana wallet
-kw">curl -str">"https://api.suwappu.bot/v1/agent/portfolio?wallet_address=7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU&chain=solana" \
-H -str">"Authorization: Bearer suwappu_sk_your_api_key"
Python
import requests
response = requests.get(
class="hl-str">"https:class="hl-commentclass="hl-str">">//api.suwappu.bot/v1/agent/portfolio",
headers={class="hl-str">"Authorization": class="hl-str">"Bearer suwappu_sk_your_api_key"},
params={
class="hl-str">"wallet_address": class="hl-str">"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
class="hl-str">"chain": class="hl-str">"ethereum",
},
)
data = response.json()
print(fclass="hl-str">"Total value: ${data[class="hl-str">'total_usd']:.2f}")
for balance in data[class="hl-str">"balances"]:
print(fclass="hl-str">" {balance[class="hl-str">'symbol']}: {balance[class="hl-str">'balance']} (${balance[class="hl-str">'usd_value']:.2f})")
TypeScript
const params = new URLSearchParams({
wallet_address: class="hl-str">"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
chain: class="hl-str">"ethereum",
});
const response = await fetch(
https:class=class="hl-str">"hl-comment">//api.suwappu.bot/v1/agent/portfolio?${params},
{
headers: { Authorization: class="hl-str">"Bearer suwappu_sk_your_api_key" },
}
);
const { total_usd, balances } = await response.json();
console.log(Total value: $${total_usd.toFixed(2)});
balances.forEach((b) => {
console.log( ${b.symbol}: ${b.balance} ($${b.usd_value.toFixed(2)}));
});