List wallet tokens
Every fungible token a wallet holds — with names, symbols, logos, decimals, and USD prices — in one call.
GET /wallets/{address}/tokensThis is the endpoint that usually convinces people. Against raw RPC, the same
result takes getTokenAccountsByOwner twice (the classic SPL Token program
and Token-2022 are separate calls), a metadata lookup per mint, a price feed,
and getBalance for native SOL. Here it's one request.
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
address | path | string | Yes | The wallet's base58 address. |
limit | query | number | No | 1–1000, default 100. |
cursor | query | string | No | Pagination cursor. |
includeZeroBalances | query | boolean | No | Default false. Empty token accounts are noise for most apps. |
Example
curl "https://api.sarg.am/v1/solana/wallets/9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM/tokens" \
-H "Authorization: Bearer $MAINLY_API_KEY"{
"address": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
"native": {
"lamports": 1529000000,
"sol": 1.529,
"price": { "usdPerToken": 152.4, "usdTotal": 233.02 }
},
"items": [
{
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"name": "USD Coin",
"symbol": "USDC",
"logo": "https://cdn.mainly.dev/tokens/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v.png",
"tokenProgram": "spl-token",
"balance": { "raw": "42000000", "decimals": 6, "ui": 42.0, "uiString": "42" },
"price": { "usdPerToken": 1.0, "usdTotal": 42.0 }
},
{
"mint": "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN",
"name": "Jupiter",
"symbol": "JUP",
"logo": "https://cdn.mainly.dev/tokens/JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN.png",
"tokenProgram": "token-2022",
"balance": { "raw": "150000000", "decimals": 6, "ui": 150.0, "uiString": "150" },
"price": { "usdPerToken": 0.82, "usdTotal": 123.0 }
}
],
"nextCursor": null
}Response fields
| Field | Type | Description |
|---|---|---|
native | object | The wallet's SOL position, same shape as balance plus price. |
items[].mint | string | The token's mint address — its unique identifier. |
items[].name / symbol / logo | string | null | Metadata. null when a token has none published. |
items[].tokenProgram | string | spl-token or token-2022. Informational — both are included automatically. |
items[].balance | object | Amount held. See Amounts & units. |
items[].price | object | null | USD estimate. null for tokens without verified market data. |
Ordering: by price.usdTotal descending, unpriced tokens last.
Errors
code | When |
|---|---|
invalid_address | The path parameter isn't valid base58. |
Under the hood
Replaces getTokenAccountsByOwner (× 2 token programs), per-mint metadata
resolution, a price aggregation service, and getBalance — plus the decimals
math to turn raw integer strings into readable amounts.