List SPL tokens on a wallet
https://api.triport.io/v1/sol/wallet/tokens/So11111111111111111111111111111111111111112?include_zero=falseReturns every SPL token account held by a Solana address, with balances, mint decimals, and (when cached) token metadata.
Lists the token accounts owned by a single Solana wallet. For each holding you
get the SPL mint, the raw amount (a u64 rendered as a string to avoid
precision loss), the mint's decimals, and a convenience ui_amount
(amount scaled by decimals). When token metadata has been cached, the
response also carries the human-readable name, symbol, and logo_uri.
Use this to render a wallet's portfolio or to check a specific token balance.
By default, accounts with a zero balance are omitted; pass include_zero=true
to include closed-out or empty token accounts as well.
Gotchas:
amountis a string, not a number. Parse it as a big integer and divide by10 ** decimalsyourself if you need exact arithmetic —ui_amountis adoubleand is lossy for large balances.name,symbol, andlogo_uriare optional and only present for mints whose metadata is cached. Treat them as best-effort, not guaranteed.- This endpoint covers SPL tokens only. For native SOL use wallet balance; for NFTs use wallet NFTs.
Parameters
Path parameters
addressstringrequired^[1-9A-HJ-NP-Za-km-z]+$.Query parametersobjectinclude_zerobooleanoptionalfalse.Response
Response fields
| Field | Type | Description |
|---|---|---|
address | string | The wallet address that was queried (echoes the path param). |
tokens | array | List of SolTokenBalance objects, one per token account. |
tokens[].mint | string | SPL token mint address. Required. |
tokens[].amount | string | Raw balance as a u64 rendered as a decimal string. Required. |
tokens[].decimals | integer | Mint decimals (0–18). Required. |
tokens[].ui_amount | number (double) | amount scaled by decimals. Convenience only; lossy for large values. |
tokens[].owner_program | string | Token program that owns the account (e.g. SPL Token or Token-2022). |
tokens[].name | string | Token name, when metadata is cached. |
tokens[].symbol | string | Token symbol, when metadata is cached. |
tokens[].logo_uri | string (uri) | Token logo URL, when metadata is cached. |
Errors
| Code | Meaning | When it happens |
|---|---|---|
401 | unauthorized / trial_expired / subscription_expired | Missing or invalid credentials, or the API key's trial/subscription has lapsed. |
403 | tier_insufficient / method_unknown | The key's tier is below what this method requires, or the method isn't part of the key's product. |
429 | rate_limited | Sustained RPS for the sol_read_rpc category exceeded. Honor the Retry-After header. |
On a 429, the response carries Retry-After, X-RateLimit-Limit,
X-RateLimit-Remaining, X-RateLimit-Reset, and X-RateLimit-Category
headers. There is no daily quota — limiting is RPS-per-tier with burst only.
See the shared errors reference for the full error envelope.
Examples
JavaScript (fetch)
const address = "So11111111111111111111111111111111111111112";
const res = await fetch(
`https://api.triport.io/v1/sol/wallet/tokens/${address}?include_zero=false`,
{
headers: {
Authorization: `Bearer ${process.env.TRIPORT_API_KEY}`,
"Content-Type": "application/json",
},
}
);
if (!res.ok) throw new Error(`triport: ${res.status}`);
const { tokens } = await res.json();
for (const t of tokens) {
console.log(`${t.symbol ?? t.mint}: ${t.ui_amount}`);
}TypeScript SDK (@triport/sdk)
import { TriportClient } from "@triport/sdk";
const client = new TriportClient({ apiKey: process.env.TRIPORT_API_KEY! });
const { tokens } = await client.sol.wallet.tokens(
"So11111111111111111111111111111111111111112",
{ includeZero: false }
);
tokens.forEach((t) => console.log(t.symbol ?? t.mint, t.uiAmount));Python (triport-sdk)
import os
from triport import TriportClient
client = TriportClient(api_key=os.environ["TRIPORT_API_KEY"])
result = client.sol.wallet.tokens(
"So11111111111111111111111111111111111111112",
include_zero=False,
)
for t in result.tokens:
print(t.symbol or t.mint, t.ui_amount)Notes
- Zero balances: omitted by default. Set
include_zero=trueto surface empty token accounts (useful when you need to detect and close rent-bearing accounts). - Precision: always read
amount+decimalsfor exact math;ui_amountis for display only. - Related endpoints: wallet balance (native SOL), wallet history (transactions), wallet NFTs (DAS-backed NFT holdings).