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

# getTokenAccountsByOwner

> トークン所有者ごとにすべてのSPLトークンアカウントを返します。

<Info>
  **新機能**: `getTokenAccountsByOwner`は増分更新のために`changedSinceSlot`パラメータをサポートするようになりました。指定された場合、このメソッドは指定したスロット番号以降に変更されたトークンアカウントのみを返します。これはトークン残高の変動やポートフォリオの更新を追跡するのに理想的です。
</Info>

## リクエストパラメータ

<ParamField body="address" type="string" required>
  トークン保有を照会するアカウントオーナーのSolanaウォレットアドレス（pubkey）をbase-58エンコードされた文字列として指定します。
</ParamField>

<ParamField body="mint" type="string">
  特定のトークンまたはNFTのアカウントのみを取得するための特定のSolanaトークンミントアドレス。
</ParamField>

<ParamField body="programId" type="string">
  トークンアカウントを作成した特定のSolanaトークンプログラムID（通常はSPLトークンプログラム）。
</ParamField>

<ParamField body="commitment" type="string">
  リクエストのコミットメントレベル。

  * `confirmed`
  * `finalized`
  * `processed`
</ParamField>

<ParamField body="minContextSlot" type="number">
  リクエストが評価可能な最小スロット。
</ParamField>

<ParamField body="dataSlice" type="object">
  アカウントデータのスライスをリクエストします。
</ParamField>

<ParamField body="dataSlice.length" type="number">
  返すバイト数。
</ParamField>

<ParamField body="dataSlice.offset" type="number">
  読み取りを開始するバイトオフセット。
</ParamField>

<ParamField body="encoding" type="string">
  アカウントデータのエンコーディング形式。

  * `base58`
  * `base64`
  * `base64+zstd`
  * `jsonParsed`
</ParamField>

<ParamField body="changedSinceSlot" type="number">
  指定したスロット番号以降に変更されたアカウントのみを返します。増分更新に便利です。
</ParamField>


## OpenAPI

````yaml ja/openapi/rpc-http/getTokenAccountsByOwner.yaml POST /
openapi: 3.1.0
info:
  title: Solana RPC API
  version: 1.0.0
  description: >-
    Solana ブロックチェーン上の任意のウォレットアドレスに関連する SPL トークンの残高、NFT、およびその他のトークン保有を取得するための包括的な
    Solana トークンアカウント発見 API。
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://mainnet.helius-rpc.com
    description: メインネット RPC エンドポイント
  - url: https://devnet.helius-rpc.com
    description: Devnet RPC エンドポイント
security: []
paths:
  /:
    post:
      tags:
        - RPC
      summary: getTokenAccountsByOwner
      description: >-
        特定の Solana ウォレットアドレスが所有するすべての SPL トークンアカウントを強力なフィルタリングオプションを使用して取得します。

        この重要な API は、開発者がファンジブルトークンや NFT
        を含む完全なトークン保有を発見できるようにし、特定のトークンミントや特定のトークンプログラムによって作成されたアカウントに制限することができます。

        残高、小数点、所有権ステータスを含む人間が読みやすいトークン情報の解析データをサポートします。

        ウォレット、ポートフォリオトラッカー、および包括的なトークン保有データを必要とする DeFi アプリケーションにとって重要です。
      operationId: getTokenAccountsByOwner
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  description: JSON-RPC プロトコルのバージョン。
                  example: '2.0'
                  default: '2.0'
                id:
                  type: string
                  description: リクエストの一意識別子。
                  example: '1'
                  default: '1'
                method:
                  type: string
                  enum:
                    - getTokenAccountsByOwner
                  description: 呼び出す RPC メソッドの名前。
                  example: getTokenAccountsByOwner
                  default: getTokenAccountsByOwner
                params:
                  type: array
                  description: 特定の公開鍵が所有するトークンアカウントをクエリするためのパラメータ。
                  default:
                    - A1TMhSGzQxMr1TboBKtgixKz1sS6REASMxPo1qsyTSJd
                    - programId: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
                    - encoding: jsonParsed
                  items:
                    oneOf:
                      - type: string
                        description: >-
                          トークン保有をクエリするアカウント所有者の Solana ウォレットアドレス (pubkey) の
                          base-58 エンコードされた文字列。
                        example: A1TMhSGzQxMr1TboBKtgixKz1sS6REASMxPo1qsyTSJd
                      - type: object
                        description: ミントアドレスやプログラム ID によってトークンアカウントを絞り込むためのフィルター設定。
                        properties:
                          mint:
                            type: string
                            description: >-
                              特定のトークンまたは NFT のアカウントのみを取得するための特定の Solana
                              トークンミントアドレス。
                            example: 2cHr7QS3xfuSV8wdxo3ztuF4xbiarF6Nrgx3qpx3HzXR
                          programId:
                            type: string
                            description: >-
                              トークンアカウントを作成した特定の Solana トークンプログラム ID (通常は SPL
                              トークンプログラム)。
                            example: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
                      - type: object
                        description: オプションフィールドを含む設定オブジェクト。
                        properties:
                          commitment:
                            type: string
                            description: リクエストのコミットメントレベル。
                            enum:
                              - confirmed
                              - finalized
                              - processed
                            example: finalized
                          minContextSlot:
                            type: integer
                            description: >-
                              The minimum slot that the request can be evaluated
                              at.
                            example: 1000
                          dataSlice:
                            type: object
                            description: Request a slice of the account's data.
                            properties:
                              length:
                                type: integer
                                description: Number of bytes to return.
                                example: 10
                              offset:
                                type: integer
                                description: Byte offset from which to start reading.
                                example: 0
                          encoding:
                            type: string
                            description: Encoding format for Account data.
                            enum:
                              - base58
                              - base64
                              - base64+zstd
                              - jsonParsed
                            example: jsonParsed
                          changedSinceSlot:
                            type: integer
                            description: >-
                              Only return accounts that were modified at or
                              after this slot number. Useful for incremental
                              updates.
                            example: 464175999
      responses:
        '200':
          description: 所有者によるトークンアカウントの取得に成功しました。
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    description: JSON-RPC プロトコルのバージョン。
                    enum:
                      - '2.0'
                    example: '2.0'
                  id:
                    type: string
                    description: リクエストに一致する識別子。
                    example: '1'
                  result:
                    type: object
                    description: コンテキストとアカウントの詳細。
                    properties:
                      context:
                        type: object
                        description: レスポンスのコンテキスト。
                        properties:
                          apiVersion:
                            type: string
                            description: API バージョン。
                            example: 2.0.15
                          slot:
                            type: integer
                            description: データが取得されたスロット。
                            example: 341197933
                      value:
                        type: array
                        description: トークンアカウントのリスト。
                        items:
                          type: object
                          properties:
                            pubkey:
                              type: string
                              description: base-58 エンコードされた文字列としてのアカウント Pubkey。
                              example: BGocb4GEpbTFm8UFV2VsDSaBXHELPfAXrvd4vtt8QWrA
                            account:
                              type: object
                              description: トークンアカウントの詳細。
                              properties:
                                lamports:
                                  type: integer
                                  description: アカウントに割り当てられた lamports の数。
                                  example: 2039280
                                owner:
                                  type: string
                                  description: このアカウントが割り当てられたプログラムの Pubkey。
                                  example: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
                                data:
                                  type: object
                                  description: アカウントに関連付けられたトークン状態データ。
                                  properties:
                                    program:
                                      type: string
                                      description: プログラム名。
                                      example: spl-token
                                    parsed:
                                      type: object
                                      description: 解析されたトークンデータ。
                                      properties:
                                        info:
                                          type: object
                                          description: トークンアカウント情報。
                                          properties:
                                            isNative:
                                              type: boolean
                                              description: アカウントがネイティブ SOL を保持しているかどうかを示します。
                                              example: false
                                            mint:
                                              type: string
                                              description: トークンミントの Pubkey。
                                              example: >-
                                                2cHr7QS3xfuSV8wdxo3ztuF4xbiarF6Nrgx3qpx3HzXR
                                            owner:
                                              type: string
                                              description: アカウント所有者の Pubkey。
                                              example: >-
                                                A1TMhSGzQxMr1TboBKtgixKz1sS6REASMxPo1qsyTSJd
                                            state:
                                              type: string
                                              description: トークンアカウントの状態。
                                              example: initialized
                                            tokenAmount:
                                              type: object
                                              description: トークン量の詳細。
                                              properties:
                                                amount:
                                                  type: string
                                                  description: 小数なしの生バランス。
                                                  example: '420000000000000'
                                                decimals:
                                                  type: integer
                                                  description: 小数点の数。
                                                  example: 6
                                                uiAmount:
                                                  type: number
                                                  description: ユーザーフレンドリーな形式での残高。
                                                  example: 420000000
                                                uiAmountString:
                                                  type: string
                                                  description: 文字列形式の残高。
                                                  example: '420000000'
                                    space:
                                      type: integer
                                      description: アカウントのために割り当てられたスペース。
                                      example: 165
                                executable:
                                  type: boolean
                                  description: アカウントにプログラムが含まれているかどうかを示します。
                                  example: false
                                rentEpoch:
                                  type: integer
                                  description: アカウントが次に賃料を支払うべきエポック。
                                  example: 18446744073709552000
                                space:
                                  type: integer
                                  description: アカウントのデータサイズ。
                                  example: 165
              example:
                jsonrpc: '2.0'
                id: '1'
                result:
                  context:
                    apiVersion: 2.0.15
                    slot: 341197933
                  value:
                    - pubkey: BGocb4GEpbTFm8UFV2VsDSaBXHELPfAXrvd4vtt8QWrA
                      account:
                        lamports: 2039280
                        owner: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
                        data:
                          program: spl-token
                          parsed:
                            info:
                              isNative: false
                              mint: 2cHr7QS3xfuSV8wdxo3ztuF4xbiarF6Nrgx3qpx3HzXR
                              owner: A1TMhSGzQxMr1TboBKtgixKz1sS6REASMxPo1qsyTSJd
                              state: initialized
                              tokenAmount:
                                amount: '420000000000000'
                                decimals: 6
                                uiAmount: 420000000
                                uiAmountString: '420000000'
                          space: 165
                        executable: false
                        rentEpoch: 18446744073709552000
                        space: 165
        '400':
          description: Bad Request - 無効なリクエストパラメータまたは不正なリクエスト。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32602
                  message: Invalid params
                id: '1'
        '401':
          description: Unauthorized - 無効または不足している API キー。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32001
                  message: Unauthorized
                id: '1'
        '429':
          description: Too Many Requests - レート制限を超過しました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32005
                  message: Too many requests
                id: '1'
        '500':
          description: Internal Server Error - サーバーでエラーが発生しました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32603
                  message: Internal error
                id: '1'
        '503':
          description: Service Unavailable - サービスが一時的に利用できません。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32002
                  message: Service unavailable
                id: '1'
        '504':
          description: Gateway Timeout - リクエストがタイムアウトしました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32003
                  message: Gateway timeout
                id: '1'
      security:
        - ApiKeyQuery: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          description: JSON-RPC プロトコルのバージョン。
          enum:
            - '2.0'
          example: '2.0'
        error:
          type: object
          properties:
            code:
              type: integer
              description: エラーコード。
              example: -32602
            message:
              type: string
              description: エラーメッセージ。
            data:
              type: object
              description: エラーに関する追加データ。
        id:
          type: string
          description: リクエストに一致する識別子。
          example: '1'
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: >-
        あなたの Helius API
        キー。無料で[ダッシュボード](https://dashboard.helius.dev/api-keys)から取得できます。

````