getTokenAccountsByOwnerV2

A wallet’s token accounts, paged with a cursor, with an exact total.

1 credit a call. Free plan includes 500,000 credits a month.

What it returns

Same arguments as getTokenAccountsByOwner, plus pages of up to 10,000, a cursor, totalCount, changedSince and excludeZero.

Wallets with thousands of token accounts, like pool authorities and market makers, load in pages instead of one huge reply.

What you can build

  • Large portfolios

    Load wallets with thousands of positions a page at a time.

  • Portfolio sync

    Refresh only accounts changed since your last slot.

  • Clean balances

    Drop dust and empty accounts with excludeZero.

  • Position counts

    Read how many tokens a wallet holds from totalCount.

Call it

Replace the URL with your endpoint from the dashboard.

getTokenAccountsByOwnerV21 credit

Request

curl "$SOLANA_RPC_URL" \
  -H "Content-Type: application/json" \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getTokenAccountsByOwnerV2",
  "params": [
    "5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1",
    {
      "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
    },
    {
      "encoding": "jsonParsed",
      "limit": 1000,
      "excludeZero": true
    }
  ]
}'

Response shape

{
  "accounts": [
    {
      "pubkey": "…",
      "account": {
        "data": {
          "program": "spl-token",
          "parsed": {
            "type": "account",
            "info": {
              "mint": "…",
              "owner": "5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1",
              "tokenAmount": {
                "amount": "…",
                "decimals": 9,
                "uiAmountString": "…"
              }
            }
          }
        }
      }
    }
  ],
  "cursor": "…",
  "totalCount": "…"
}

Parameters

ownerstring
The wallet. First positional parameter.
mint | programIdobject
Second parameter, as in getTokenAccountsByOwner.
limitnumber
1 to 10,000 a page.
cursorstring
From the previous page, with the same filter.
changedSincenumber
Only accounts modified at or after this slot.
excludeZeroboolean
Skip empty accounts.

Start calling getTokenAccountsByOwnerV2.

Free to start. Paid plans from €39 a month.