跳转到主要内容
POST
Run `getTokenAccountsByOwner`
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
        }
      }
    ]
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.solanatracker.io/llms.txt

Use this file to discover all available pages before exploring further.

⚡ 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 owners with millions of token accounts, such as 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.

授权

api_key
string
query
必填

请求体

application/json
jsonrpc
enum<string>
必填

The JSON-RPC protocol version.

可用选项:
2.0
示例:

"2.0"

id
string
必填

A unique identifier for the request.

示例:

"1"

method
enum<string>
默认值:getTokenAccountsByOwner
必填

The name of the RPC method to invoke.

可用选项:
getTokenAccountsByOwner
示例:

"getTokenAccountsByOwner"

params
string · object · object[]
必填

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.

jsonrpc
enum<string>

The JSON-RPC protocol version.

可用选项:
2.0
示例:

"2.0"

id
string

Identifier matching the request.

示例:

"1"

result
object

Context and account details.