getTokenAccountsByOwner
Solana node API
getTokenAccountsByOwner | Solana
The Solana getTokenAccountsByOwner method retrieves a list of accounts owned by a specified wallet, filtered by their associated token.
POST
getTokenAccountsByOwner
Not available on the Developer planThe method is available only on the paid plans. Per-method rate limit: 80 RPS across all regions. See Solana method limits.
getTokenAccountsByOwner method retrieves a list of accounts owned by a specified wallet, filtered by their associated token.
This method is useful for identifying all accounts associated with a particular owner and a specific token, allowing for a comprehensive view of token distribution and ownership.
The interactive example fetches the GME tokens owned by an account on Solana mainnet.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
Parameters
ownerPubkey(string, required) — the base-58 encoded public key of the account owner to query.filter(object, required) — filter results by token mint or program ID. Must include exactly one of:mint(string) — the base-58 encoded public key of a specific token mint to limit accounts to.programId(string) — the base-58 encoded public key of the Token program that owns the accounts (TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DAfor SPL Token,TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEbfor Token-2022).
config(object, optional) — configuration object containing:commitment(string) — the level of commitment desired for the query.minContextSlot(integer) — the minimum slot at which the request can be evaluated.dataSlice(object) — request a slice of the account’s data withlengthandoffsetfields. Only available for non-jsonParsedencodings.encoding(string) — the format of the returned account data. Values:base58,base64,base64+zstd,jsonParsed. WithjsonParsed, returns parsed token account data including mint, owner, token amount, delegate, and state.
Response
context— an object containingslot(the slot at which the data was fetched) andapiVersion.value— an array of objects, each containing:pubkey(string) — the token account address as a base-58 encoded string.account— an object with:lamports(u64) — number of lamports assigned to this account.owner(string) — base-58 encoded public key of the program that owns this account.data— account data. WithjsonParsedencoding, returns a{program, parsed, space}object whereparsed.infocontains:mint,owner,tokenAmount(withamount,decimals,uiAmount,uiAmountString),delegate,delegatedAmount,state(initializedorfrozen),isNative,rentExemptReserve,closeAuthority, andextensions(for Token-2022 accounts).executable(boolean) — whether the account contains a program.rentEpoch(u64) — the epoch at which this account will next owe rent.space(u64) — the data size of the account in bytes.
Use Case
A practical use case forgetTokenAccountsByOwner is for wallet interfaces or financial tracking applications to list all accounts associated with a particular owner and token type. This can be especially useful for assessing the distribution of tokens across different accounts and for transaction history analysis.Last modified on May 18, 2026