> ## 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.

# getProgramAccounts

> 指定されたプログラムのPubkeyに属するすべてのアカウントを返します。

<Info>
  **新機能**: `getProgramAccounts`がINCREMENTAL\_CODE\_PLACEHOLDER\_af0d2091e6af4b9f\_ENDパラメータでの増分更新をサポートするようになりました。指定すると、メソッドは指定されたスロット番号以降に変更されたアカウントのみを返します。これはリアルタイムのインデックス作成とデータ同期ワークフローに最適です。
</Info>

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

<ParamField body="address" type="string" required>
  ベース58エンコードされた文字列として、クエリアカウントするSolanaプログラムの公開鍵（アドレス）。
</ParamField>

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

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

<ParamField body="minContextSlot" type="number">
  リクエストが評価される最小スロット。
</ParamField>

<ParamField body="withContext" type="boolean">
  結果をRpcResponse JSONオブジェクトにラップします。
</ParamField>

<ParamField body="encoding" type="string">
  返されるアカウントデータのエンコード形式。

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

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

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

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

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

<ParamField body="filters" type="array">
  特定のSolanaアカウントデータパターンを効率的にクエリする強力なフィルタリングシステム。
</ParamField>


## OpenAPI

````yaml ja/openapi/rpc-http/getProgramAccounts.yaml POST /
openapi: 3.1.0
info:
  title: Solana RPC API
  version: 1.0.0
  description: >-
    特定のプログラムが所有するアカウントをクエリおよびフィルタリングするための高度な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: デブネットRPCエンドポイント
security: []
paths:
  /:
    post:
      tags:
        - RPC
      summary: getProgramAccounts
      description: >
        特定のSolanaプログラムが所有するすべてのアカウントを強力なフィルタリング機能で取得します。

        この重要なAPIは、開発者が任意のプログラムが使用するオンチェーンデータ構造を効率的にクエリするのを可能にし、アカウントサイズ、メモリ内容、その他の基準による高度なフィルタリングを提供します。

        NFTコレクション、DEX流動性プール、貸付ポジション、ガバナンス提案、およびSolanaブロックチェーン上に保存された他のプロトコル固有データのインデックス作成に最適です。

        最適な解析効率のために複数のデータエンコーディング形式をサポートします。
      operationId: getProgramAccounts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              properties:
                jsonrpc:
                  type: string
                  description: JSON-RPCプロトコルバージョン。
                  enum:
                    - '2.0'
                  example: '2.0'
                  default: '2.0'
                id:
                  type: string
                  description: リクエストの一意の識別子。
                  example: '1'
                  default: '1'
                method:
                  type: string
                  description: 呼び出すRPCメソッドの名前。
                  enum:
                    - getProgramAccounts
                  example: getProgramAccounts
                  default: getProgramAccounts
                params:
                  type: array
                  description: メソッドのパラメータ。
                  default:
                    - 4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T
                  items:
                    oneOf:
                      - type: string
                        description: >-
                          クエリアカウントのためのSolanaプログラム公開鍵（アドレス）を、base-58でエンコードした文字列として指定します。
                        example: 4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T
                      - type: object
                        description: プログラムアカウントクエリを最適化するための高度な設定オプション。
                        properties:
                          commitment:
                            type: string
                            description: リクエストのコミットメントレベル。
                            enum:
                              - confirmed
                              - finalized
                              - processed
                            example: finalized
                          minContextSlot:
                            type: integer
                            description: リクエストが評価されることができる最小スロット。
                            example: 1000
                          withContext:
                            type: boolean
                            description: 結果をRpcResponse JSONオブジェクトでラップします。
                            example: true
                          encoding:
                            type: string
                            description: 返されたアカウントデータのエンコーディング形式。
                            enum:
                              - jsonParsed
                              - base58
                              - base64
                              - base64+zstd
                            example: jsonParsed
                          dataSlice:
                            type: object
                            description: アカウントのデータの一部を要求します。
                            properties:
                              length:
                                type: integer
                                description: 返すバイト数。
                                example: 50
                              offset:
                                type: integer
                                description: 読み始めるバイトオフセット。
                                example: 0
                          changedSinceSlot:
                            type: integer
                            description: このスロット番号以降に変更されたアカウントのみを返します。インクリメンタル更新に便利です。
                            example: 464175999
                          filters:
                            type: array
                            description: 特定のSolanaアカウントデータパターンを効率的にクエリするための強力なフィルタリングシステム。
                            items:
                              oneOf:
                                - type: object
                                  description: バイト単位の正確なデータサイズでSolanaアカウントをフィルタリングします。
                                  properties:
                                    dataSize:
                                      type: integer
                                      description: フィルタリングのためのアカウントデータの正確なサイズ（バイト単位）。
                                      example: 17
                                - type: object
                                  description: >-
                                    特定のメモリオフセットでのデータを比較してSolanaアカウントをフィルタリングします（最強力なフィルター）。
                                  properties:
                                    memcmp:
                                      type: object
                                      description: 特定のデータパターンを持つアカウントを見つけるためのメモリ比較フィルター。
                                      properties:
                                        offset:
                                          type: integer
                                          description: 比較を行うアカウントのデータ内のバイトオフセット。
                                          example: 4
                                        bytes:
                                          type: string
                                          description: 指定されたオフセット位置で比較するbase-58エンコードされたデータ。
                                          example: 3Mc6vR
      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:
                    oneOf:
                      - type: array
                        description: プログラムアカウントのリスト。
                        items:
                          type: object
                          properties:
                            pubkey:
                              type: string
                              description: アカウントのPubkeyをbase-58でエンコードした文字列。
                              example: CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY
                            account:
                              type: object
                              description: アカウントの詳細。
                              properties:
                                lamports:
                                  type: integer
                                  description: このアカウントに割り当てられたラメポートの数。
                                  example: 15298080
                                owner:
                                  type: string
                                  description: >-
                                    このアカウントに割り当てられているプログラムのbase-58エンコードされたPubkey。
                                  example: 4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T
                                data:
                                  type: array
                                  description: エンコードされたバイナリまたはJSON形式としてのアカウントデータ。
                                  items:
                                    type: string
                                  example:
                                    - 2R9jLfiAQ9bgdcw6h8s44439
                                    - base58
                                executable:
                                  type: boolean
                                  description: アカウントがプログラムを含むかどうかを示します。
                                  example: false
                                rentEpoch:
                                  type: integer
                                  description: このアカウントが次回に家賃を支払う時点のエポック。
                                  example: 28
                                space:
                                  type: integer
                                  description: アカウントのデータサイズ。
                                  example: 42
        '400':
          description: 不正なリクエスト - 無効なリクエストパラメータまたは不正な形式のリクエストです。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32602
                  message: 無効なパラメータ
                  data: {}
                id: '1'
        '401':
          description: 無許可 - 無効または欠落しているAPIキーです。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32001
                  message: 無許可
                  data: {}
                id: '1'
        '429':
          description: リクエストが多すぎます - レート制限を超えました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32005
                  message: リクエストが多すぎます
                  data: {}
                id: '1'
        '500':
          description: 内部サーバーエラー - サーバーでエラーが発生しました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32603
                  message: 内部エラー
                  data: {}
                id: '1'
        '503':
          description: サービス利用不可 - サービスが一時的に利用できません。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32002
                  message: サービス利用不可
                  data: {}
                id: '1'
        '504':
          description: ゲートウェイタイムアウト - リクエストがタイムアウトしました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32003
                  message: ゲートウェイタイムアウト
                  data: {}
                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)です。

````