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
}
}
}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.
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
}
}
}changedSince to fetch accounts modified after a specific slot, perfect for incremental updates without re-fetching everything. Want to filter out dust? The excludeZero parameter automatically hides empty token accounts, reducing bandwidth and speeding up your queries.
Use cursor pagination to efficiently retrieve all accounts (up to 10k per request.)The JSON-RPC protocol version.
2.0 "2.0"
A unique identifier for the request.
"1"
The name of the RPC method to invoke.
getTokenAccountsByOwnerV2 "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.
"A1TMhSGzQxMr1TboBKtgixKz1sS6REASMxPo1qsyTSJd"
Was this page helpful?