curl --request POST \
--url 'https://rpc-mainnet.solanatracker.io/?api_key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenAccountsByOwnerV2",
"params": [
"5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1",
{
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
},
{
"encoding": "jsonParsed",
"limit": 1000,
"changedSince": 372909702,
"excludeZero": true
}
]
}
'{
"jsonrpc": "2.0",
"id": 1,
"result": {
"context": {
"apiVersion": "3.0.0",
"slot": 372910193
},
"value": {
"accounts": [
{
"account": {
"data": {
"parsed": {
"info": {
"isNative": false,
"mint": "FGf1Us3kqu9AXu2x1yWKfiKE8uSx42ACvRiUrbuAodzq",
"owner": "5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1",
"state": "initialized",
"tokenAmount": {
"amount": "4055486331542675841",
"decimals": 9,
"uiAmount": 4055486331.542676,
"uiAmountString": "4055486331.542675841"
}
},
"type": "account"
},
"program": "spl-token",
"space": 165
},
"executable": false,
"lamports": 2039280,
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"rentEpoch": 18446744073709552000,
"space": 165
},
"pubkey": "AYAmCRPotwZprbNpPQ1hVGSEpbgWUgWHUbjnjt4bfLo1"
}
],
"hasMore": true,
"nextCursor": "p2b9JXwduXpJn7Vz1DXuBLS4iZDxHNQ3pcmfR6f5rwi",
"totalCount": 25655
}
}
}Custom Methods
getTokenAccountsByOwnerV2
Returns all SPL Token accounts owned by the provided wallet address with enhanced pagination support. This V2 method provides efficient querying with cursor-based pagination, filtering by mint or program ID, and incremental updates for portfolio tracking.
POST
/
curl --request POST \
--url 'https://rpc-mainnet.solanatracker.io/?api_key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenAccountsByOwnerV2",
"params": [
"5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1",
{
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
},
{
"encoding": "jsonParsed",
"limit": 1000,
"changedSince": 372909702,
"excludeZero": true
}
]
}
'{
"jsonrpc": "2.0",
"id": 1,
"result": {
"context": {
"apiVersion": "3.0.0",
"slot": 372910193
},
"value": {
"accounts": [
{
"account": {
"data": {
"parsed": {
"info": {
"isNative": false,
"mint": "FGf1Us3kqu9AXu2x1yWKfiKE8uSx42ACvRiUrbuAodzq",
"owner": "5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1",
"state": "initialized",
"tokenAmount": {
"amount": "4055486331542675841",
"decimals": 9,
"uiAmount": 4055486331.542676,
"uiAmountString": "4055486331.542675841"
}
},
"type": "account"
},
"program": "spl-token",
"space": 165
},
"executable": false,
"lamports": 2039280,
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"rentEpoch": 18446744073709552000,
"space": 165
},
"pubkey": "AYAmCRPotwZprbNpPQ1hVGSEpbgWUgWHUbjnjt4bfLo1"
}
],
"hasMore": true,
"nextCursor": "p2b9JXwduXpJn7Vz1DXuBLS4iZDxHNQ3pcmfR6f5rwi",
"totalCount": 25655
}
}
}⚡ Powered by Solana Ridge DBGet faster Solana account data with Ridge DB, our custom-built client designed specifically for high-performance account retrieval on Solana. Unlike standard RPC methods, Ridge DB uses specialized indexes that make wallet token-account lookups significantly faster.What makes it different:Need to track token holdings for one wallet? Use
changedSince to fetch only token accounts modified after a specific slot, so you do not have to reload the full wallet each time. Want to filter out dust? The excludeZero parameter hides empty token accounts, reducing bandwidth and speeding up your queries.
Use cursor pagination to retrieve large token-account lists efficiently, up to 10k accounts per request.Authorizations
Body
application/json
The JSON-RPC protocol version.
Available options:
2.0 Example:
"2.0"
A unique identifier for the request.
Example:
"1"
The name of the RPC method to invoke.
Available options:
getTokenAccountsByOwnerV2 Example:
"getTokenAccountsByOwnerV2"
Parameters for querying paginated token accounts owned by a specific public key.
Solana wallet address (pubkey) of the account owner to query token holdings for, as a base-58 encoded string.
Example:
"A1TMhSGzQxMr1TboBKtgixKz1sS6REASMxPo1qsyTSJd"
Was this page helpful?