RPC MethodsHTTPgetTokenAccountsByOwner

Token

getTokenAccountsByOwner

Returns all SPL Token accounts by token owner.

Parameters

pubkeystring required

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

filterobject required

Either { mint: "<pubkey>" } or { programId: "<pubkey>" }.

configobject optional

Configuration object.

commitmentstring

Commitment level.

encodingstring

Encoding for account data.

dataSliceobject

Limit the returned account data.

minContextSlotnumber

The minimum slot.

Result

array

Array of JSON objects with pubkey and account information.

Example

Request
JSON
curl "https://eu.fluxrpc.com?key=<your-API-key>" -s -X POST -H "Content-Type: application/json" -d '
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getTokenAccountsByOwner",
  "params": [
    "4Qkev8aNZcqFNSRhQzwyLMFSsi94jHqE8WNVTJzTP99F",
    { "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" },
    { "commitment": "finalized", "encoding": "jsonParsed" }
  ]
}'
Response
JSON
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 1114
},
"value": [
{
"pubkey": "28YTZEwqtMHWrhWcvv34se7pjS7wctgqzCPB3gReCFKp",
"account": {
"data": {
"parsed": {
"info": {
"isNative": false,
"mint": "3wyAj7Rt1TWVPZVteFCPi2bMFn8recJ9eNhWZaBsKFYR"
}
}
},
"executable": false,
"lamports": 1726080,
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
}
}
]
},
"id": 1
}