POSTgetTokenAccountsByOwner

Returns all SPL Token accounts by token owner.

Request Body
jsonrpcstringrequired
idintegerrequired
methodstringrequired
paramsoneOf[]required

It contains following items:

  1. Pubkey of Token Account (required)
  2. Program (required)
  3. ConfigurationObject (optional)
params[0]string

Pubkey of account owner to query, as base-58 encoded string

Responses
idinteger

The request ID

jsonrpcstring

The JSON-RPC version

contextobject

An object containing metadata about the current state of the Solana network at the time of the request.

apiVersionstring

The API version used for the request

slotinteger

The slot number at which the request was evaluated

valueobject
pubkeystring

The account Pubkey as base-58 encoded string

accountobject
dataany[]

Data associated with the account, either as encoded binary data or JSON format {: } - depending on encoding parameter

executableboolean

Boolean indicating if the account contains a program (and is strictly read-only)

lamportsinteger (uint64)

Number of lamports assigned to this account

ownerstring

Base-58 encoded Pubkey of the program this account has been assigned to

rentEpochinteger (uint64)

The epoch at which this account will next owe rent

spaceinteger (uint64)

The data size of the account

X-API-KEY
RequestCU150
cURL
curl -X POST "https://solana-mainnet.nodit.io/" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getTokenAccountsByOwner",
  "params": [
    "A1TMhSGzQxMr1TboBKtgixKz1sS6REASMxPo1qsyTSJd",
    {
      "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
    },
    {
      "commitment": "finalized",
      "encoding": "jsonParsed"
    }
  ]
}'
Response
Example · 200
{
  "jsonrpc": "2.0",
  "result": {
    "context": {
      "apiVersion": "2.0.15",
      "slot": 341197933
    },
    "value": [
      {
        "pubkey": "BGocb4GEpbTFm8UFV2VsDSaBXHELPfAXrvd4vtt8QWrA",
        "account": {
          "data": {
            "program": "spl-token",
            "parsed": {
              "info": {
                "isNative": false,
                "mint": "2cHr7QS3xfuSV8wdxo3ztuF4xbiarF6Nrgx3qpx3HzXR",
                "owner": "A1TMhSGzQxMr1TboBKtgixKz1sS6REASMxPo1qsyTSJd",
                "state": "initialized",
                "tokenAmount": {
                  "amount": "420000000000000",
                  "decimals": 6,
                  "uiAmount": 420000000,
                  "uiAmountString": "420000000"
                }
              },
              "type": "account"
            },
            "space": 165
          },
          "executable": false,
          "lamports": 2039280,
          "owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
          "rentEpoch": 18446744073709552000,
          "space": 165
        }
      }
    ]
  },
  "id": 1
}