Mainly

List wallet tokens

Every fungible token a wallet holds — with names, symbols, logos, decimals, and USD prices — in one call.

GET /wallets/{address}/tokens

This 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

ParameterInTypeRequiredDescription
addresspathstringYesThe wallet's base58 address.
limitquerynumberNo1–1000, default 100.
cursorquerystringNoPagination cursor.
includeZeroBalancesquerybooleanNoDefault 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

FieldTypeDescription
nativeobjectThe wallet's SOL position, same shape as balance plus price.
items[].mintstringThe token's mint address — its unique identifier.
items[].name / symbol / logostring | nullMetadata. null when a token has none published.
items[].tokenProgramstringspl-token or token-2022. Informational — both are included automatically.
items[].balanceobjectAmount held. See Amounts & units.
items[].priceobject | nullUSD estimate. null for tokens without verified market data.

Ordering: by price.usdTotal descending, unpriced tokens last.

Errors

codeWhen
invalid_addressThe 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.

On this page