HTTP Methods
getTokenAccountsByOwner Solana RPC Method
API Reference
Solana RPC APIs
- HTTP Methods
- Overview
- POSTgetAccountInfo
- POSTgetBalance
- POSTgetBlock
- POSTgetBlockCommitment
- POSTgetBlockHeight
- POSTgetBlockProduction
- POSTgetBlocks
- POSTgetBlocksWithLimit
- POSTgetBlockTime
- POSTgetClusterNodes
- POSTgetEpochInfo
- POSTgetEpochSchedule
- POSTgetFeeForMessage
- POSTgetFirstAvailableBlock
- POSTgetGenesisHash
- POSTgetHealth
- POSTgetHighestSnapshotSlot
- POSTgetIdentity
- POSTgetInflationGovernor
- POSTgetInflationRate
- POSTgetInflationReward
- POSTgetLargestAccounts
- POSTgetLatestBlockhash
- POSTgetLeaderSchedule
- POSTgetMaxRetransmitSlot
- POSTgetMaxShredInsertSlot
- POSTgetMinimumBalanceForRentExemption
- POSTgetMultipleAccounts
- POSTgetProgramAccounts
- POSTgetRecentPerformanceSamples
- POSTgetRecentPrioritizationFees
- POSTgetSignaturesForAddress
- POSTgetSignatureStatuses
- POSTgetSlot
- POSTgetSlotLeader
- POSTgetSlotLeaders
- POSTgetStakeMinimumDelegation
- POSTgetSupply
- POSTgetTokenAccountBalance
- POSTgetTokenAccountsByDelegate
- POSTgetTokenAccountsByOwner
- POSTgetTokenLargestAccounts
- POSTgetTokenSupply
- POSTgetTransaction
- POSTgetTransactionCount
- POSTgetVersion
- POSTgetVoteAccounts
- POSTisBlockhashValid
- POSTminimumLedgerSlot
- POSTrequestAirdrop
- POSTsendTransaction
- POSTsimulateTransaction
- WebSocket Methods
Solana APIs
- Digital Asset Standard (DAS)
- Priority Fee
- Enhanced Transactions
- ZK Compression
Data Streaming APIs
- LaserStream gRPC
Event Listening APIs
- Webhooks
Deprecated APIs
- Token Metadata
- Mint
HTTP Methods
getTokenAccountsByOwner Solana RPC Method
Returns all SPL Token accounts by token owner.
POST
curl --request POST \
--url https://mainnet.helius-rpc.com/ \
--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
}
}
]
}
}
Authorizations
Body
application/json
Response
200
application/json
Successfully retrieved token accounts by owner.
The response is of type object
.
curl --request POST \
--url https://mainnet.helius-rpc.com/ \
--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
}
}
]
}
}