curl --request POST \
--url 'https://rpc-mainnet.solanatracker.io/?api_key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenAccountsByOwner",
"params": [
"A1TMhSGzQxMr1TboBKtgixKz1sS6REASMxPo1qsyTSJd",
{
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
},
{
"encoding": "jsonParsed"
}
]
}
'{
"jsonrpc": "2.0",
"id": 1,
"result": {
"context": {
"apiVersion": "2.0.15",
"slot": 341197933
},
"value": [
{
"pubkey": "BGocb4GEpbTFm8UFV2VsDSaBXHELPfAXrvd4vtt8QWrA",
"account": {
"lamports": 2039280,
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"data": {
"program": "spl-token",
"parsed": {
"info": {
"isNative": false,
"mint": "2cHr7QS3xfuSV8wdxo3ztuF4xbiarF6Nrgx3qpx3HzXR",
"owner": "A1TMhSGzQxMr1TboBKtgixKz1sS6REASMxPo1qsyTSJd",
"state": "initialized",
"tokenAmount": {
"amount": "420000000000000",
"decimals": 6,
"uiAmount": 420000000,
"uiAmountString": "420000000"
}
}
},
"space": 165
},
"executable": false,
"rentEpoch": 18446744073709552000,
"space": 165
}
}
]
}
}Returns all SPL Token accounts owned by the specified wallet address. This method allows you to retrieve a complete list of token holdings for any Solana wallet, useful for portfolio tracking and token balance queries.
curl --request POST \
--url 'https://rpc-mainnet.solanatracker.io/?api_key=' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenAccountsByOwner",
"params": [
"A1TMhSGzQxMr1TboBKtgixKz1sS6REASMxPo1qsyTSJd",
{
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
},
{
"encoding": "jsonParsed"
}
]
}
'{
"jsonrpc": "2.0",
"id": 1,
"result": {
"context": {
"apiVersion": "2.0.15",
"slot": 341197933
},
"value": [
{
"pubkey": "BGocb4GEpbTFm8UFV2VsDSaBXHELPfAXrvd4vtt8QWrA",
"account": {
"lamports": 2039280,
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"data": {
"program": "spl-token",
"parsed": {
"info": {
"isNative": false,
"mint": "2cHr7QS3xfuSV8wdxo3ztuF4xbiarF6Nrgx3qpx3HzXR",
"owner": "A1TMhSGzQxMr1TboBKtgixKz1sS6REASMxPo1qsyTSJd",
"state": "initialized",
"tokenAmount": {
"amount": "420000000000000",
"decimals": 6,
"uiAmount": 420000000,
"uiAmountString": "420000000"
}
}
},
"space": 165
},
"executable": false,
"rentEpoch": 18446744073709552000,
"space": 165
}
}
]
}
}changedSince to fetch accounts modified after a specific slot, perfect for incremental portfolio updates. Want to filter out dust? The excludeZero parameter automatically hides empty token accounts, keeping your results clean and reducing bandwidth.The JSON-RPC protocol version.
2.0 "2.0"
A unique identifier for the request.
"1"
The name of the RPC method to invoke.
getTokenAccountsByOwner "getTokenAccountsByOwner"
Parameters for querying 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 token accounts by owner.
The JSON-RPC protocol version.
2.0 "2.0"
Identifier matching the request.
"1"
Context and account details.
Show child attributes
List of token accounts.
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
Was this page helpful?