> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# getTokenAccountsByOwner | Solana

> The Solana getTokenAccountsByOwner method retrieves a list of accounts owned by a specified wallet, filtered by their associated token.

<Note>
  **Not available on the Developer plan**

  The method is available only on the [paid plans](https://chainstack.com/pricing/). Per-method rate limit: 80 RPS across all regions. See [Solana method limits](/docs/limits#solana-method-limits).
</Note>

The Solana `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.

<Note>
  The interactive example fetches the [GME tokens](https://solscan.io/token/8wXtPeU6557ETkp9WHFY1n1EcU6NxDvbAggHGsMYiHsB#holders) owned by an [account on Solana mainnet](https://solscan.io/account/CEXq1uy9y15PL2Wb4vDQwQfcJakBGjaAjeuR2nKLj8dk).
</Note>

## Parameters

1. `ownerPubkey` (string, required) — the base-58 encoded public key of the account owner to query.
2. `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 (`TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA` for SPL Token, `TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb` for Token-2022).
3. `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 with `length` and `offset` fields. Only available for non-`jsonParsed` encodings.
   * `encoding` (string) — the format of the returned account data. Values: `base58`, `base64`, `base64+zstd`, `jsonParsed`. With `jsonParsed`, returns parsed token account data including mint, owner, token amount, delegate, and state.

## Response

* `context` — an object containing `slot` (the slot at which the data was fetched) and `apiVersion`.
* `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. With `jsonParsed` encoding, returns a `{program, parsed, space}` object where `parsed.info` contains: `mint`, `owner`, `tokenAmount` (with `amount`, `decimals`, `uiAmount`, `uiAmountString`), `delegate`, `delegatedAmount`, `state` (`initialized` or `frozen`), `isNative`, `rentExemptReserve`, `closeAuthority`, and `extensions` (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 for `getTokenAccountsByOwner` 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.


## OpenAPI

````yaml openapi/solana_node_api/getTokenAccountsByOwner.json POST /9de47db917d4f69168e3fed02217d15b
openapi: 3.0.0
info:
  title: getTokenAccountsByOwner example
  version: 1.0.0
  description: This is an API example for Solana's getTokenAccountsByOwner.
servers:
  - url: https://nd-326-444-187.p2pify.com
security: []
paths:
  /9de47db917d4f69168e3fed02217d15b:
    post:
      tags:
        - query
      summary: getTokenAccountsByOwner
      operationId: getTokenAccountsByOwner
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  default: 1
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: getTokenAccountsByOwner
                params:
                  type: array
                  default:
                    - CEXq1uy9y15PL2Wb4vDQwQfcJakBGjaAjeuR2nKLj8dk
                    - mint: 8wXtPeU6557ETkp9WHFY1n1EcU6NxDvbAggHGsMYiHsB
                    - encoding: jsonParsed
      responses:
        '200':
          description: Token accounts by owner details
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: object

````