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"
Successfully retrieved paginated token accounts by owner.
The JSON-RPC protocol version.
2.0 "2.0"
Identifier matching the request.
"1"
Paginated token accounts with navigation metadata.
Show child attributes
List of token accounts for the current page.
Show child attributes
Account Pubkey as a base-58 encoded string.
"BGocb4GEpbTFm8UFV2VsDSaBXHELPfAXrvd4vtt8QWrA"
Token account details.
Show child attributes
Number of lamports assigned to the account.
2039280
Pubkey of the program this account has been assigned to.
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
Token state data associated with the account.
Show child attributes
Program name.
"spl-token"
Parsed token data.
Show child attributes
Token account information.
Show child attributes
Indicates if the account holds native SOL.
false
Pubkey of the token mint.
"2cHr7QS3xfuSV8wdxo3ztuF4xbiarF6Nrgx3qpx3HzXR"
Pubkey of the account owner.
"A1TMhSGzQxMr1TboBKtgixKz1sS6REASMxPo1qsyTSJd"
Token account state.
"initialized"
Token amount details.
Show child attributes
Raw balance without decimals.
"420000000000000"
Number of decimals.
6
Balance in user-friendly format.
420000000
Balance as a string.
"420000000"
Space allocated for the account.
165
Indicates if the account contains a program.
false
Epoch at which the account will next owe rent.
18446744073709552000
Data size of the account.
165
Cursor for the next page. Empty if no more pages are available.
"8WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"
Total number of accounts matching the query.
25000
Was this page helpful?