Skip to main content
POST
/
getTokenAccountsByOwner
curl --request POST \
  --url https://rpc-mainnet.solanatracker.io/ \
  --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
        }
      }
    ]
  }
}
⚡ Powered by Solana Ridge DBGet faster Solana token account data with Ridge DB, our custom-built client designed for high-performance token account retrieval. Ridge DB uses specialized indexes that make fetching wallet token holdings significantly faster than standard RPC methods.What makes it different:Need to track only new tokens? Use 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.
High Load ConsiderationsThis endpoint streams all token accounts directly to your client. While this works great for most wallets, it can return errors during high load or when querying wallets with millions of token accounts (like liquidity pools or protocol-owned accounts).Need better reliability? Use getTokenAccountsByOwnerV2 instead. The V2 method includes pagination support, making it more efficient and reliable for large wallets and high-traffic scenarios.

Authorizations

api-key
string
query
required

Body

application/json
jsonrpc
enum<string>
required

The JSON-RPC protocol version.

Available options:
2.0
Example:

"2.0"

id
string
required

A unique identifier for the request.

Example:

"1"

method
enum<string>
default:getTokenAccountsByOwner
required

The name of the RPC method to invoke.

Available options:
getTokenAccountsByOwner
Example:

"getTokenAccountsByOwner"

params
array
required

Parameters for querying token accounts owned by a specific public key.

Response

Successfully retrieved token accounts by owner.

jsonrpc
enum<string>

The JSON-RPC protocol version.

Available options:
2.0
Example:

"2.0"

id
string

Identifier matching the request.

Example:

"1"

result
object

Context and account details.

I