getTokenAccountsByOwner
POST
Returns all SPL Token accounts by token owner.
param[0]
pubkeyOfTokenAccountstringrequired
Pubkey of account owner to query, as base-58 encoded stringparam[1]
programobjectrequired
mintstring
Pubkey of the specific token Mint to limit accounts to, as base-58 encoded stringprogramIdstring
Pubkey of the Token program that owns the accounts, as base-58 encoded stringparam[2]
configurationObjectobjectrequired
commitmentstring
The commitment describes how finalized a block is at that point in time.- finalized - the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized
- confirmed - the node will query the most recent block that has been voted on by supermajority of the cluster.
- processed - the node will query its most recent block. Note that the block may still be skipped by the cluster.
minContextSlotstring
The minimum slot that the request can be evaluated at.dataSliceobject
Request a slice of the account's data. Data slicing is only available for base58, base64, or base64+zstd encodings.offsetinteger
number of bytes to returnlengthinteger
byte offset from which to start readingencodingstring
Encoding format for the returned Account database58is slow and limited to less than 129 bytes of Account data.base64will return base64 encoded data for Account data of any size.base64+zstdcompresses the Account data using Zstandard and base64-encodes the result.jsonParsedencoding attempts to use program-specific state parsers to return more human-readable and explicit account state data.- If
jsonParsedis requested but a parser cannot be found, the field falls back to base64 encoding, detectable when the data field is type <string>.
Responses
idinteger
The request IDjsonrpcstring
The JSON-RPC versionAn object containing metadata about the current state of the Solana network at the time of the request.
apiVersionstring
The API version used for the requestslotinteger
The slot number at which the request was evaluatedpubkeystring
The account Pubkey as base-58 encoded stringdataarray
Data associated with the account, either as encoded binary data or JSON format {<program>: <state>} - depending on encoding parameterexecutableboolean
Boolean indicating if the account contains a program (and is strictly read-only)lamportsinteger
Number of lamports assigned to this accountownerstring
Base-58 encoded Pubkey of the program this account has been assigned torentEpochinteger
The epoch at which this account will next owe rentspaceinteger
The data size of the accountcodestringrequired
Code identifying the cause of the failed request.messagestringrequired
Detailed message including the name and value of the invalid parameter.{"code": "ERROR_CODE","message": "Bad Request"}
cURL
curl -X POST 'https://solana-mainnet.nodit.io' \-H 'Content-Type: application/json' \-H 'X-API-KEY: nodit-demo' \-d '{"jsonrpc": "2.0","id": 1,"method": "getTokenAccountsByOwner","params": ["A1TMhSGzQxMr1TboBKtgixKz1sS6REASMxPo1qsyTSJd",{"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"},{"commitment": "finalized","encoding": "jsonParsed"}]}'