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

# getProgramAccounts

> Runs the Solana RPC `getProgramAccounts` method.

<Tip>
  **⚡ Powered by Solana Ridge DB**

  Get faster Solana account data with **Ridge DB**, our custom-built client designed specifically for high-performance account retrieval on Solana. Unlike standard RPC methods, Ridge DB uses specialized indexes that make querying program accounts significantly faster.

  **What makes it different:**

  Need to track only new accounts? Use `changedSince` to fetch accounts modified after a specific slot, so you do not have to reload everything. Use cursor pagination to retrieve all matching accounts efficiently, up to 10k per request.
</Tip>

<Warning>
  **High Load Considerations**

  This endpoint streams all accounts directly to your client. While this works great for most queries, it can return errors during high load or when querying programs with millions of accounts (like liquidity pools or protocol-owned accounts).

  **Need better reliability?** Use **[getProgramAccountsV2](/solana-rpc/http/getprogramaccountsv2)** instead. The V2 method includes pagination support, making it more efficient and reliable for large programs and high-traffic scenarios.
</Warning>


## OpenAPI

````yaml getprogramaccounts post /
openapi: 3.1.0
info:
  title: Solana RPC
  version: 1.0.0
  description: Solana RPC HTTP method reference.
servers:
  - url: https://rpc-mainnet.solanatracker.io
    description: Mainnet RPC endpoint
security: []
paths:
  /:
    post:
      summary: Run `getProgramAccounts`
      description: Runs the Solana RPC `getProgramAccounts` method.
      operationId: getprogramaccounts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  allOf:
                    - type: string
                      description: The JSON-RPC protocol version.
                      enum:
                        - '2.0'
                      example: '2.0'
                      default: '2.0'
                id:
                  allOf:
                    - type: string
                      description: A unique identifier for the request.
                      example: '1'
                      default: '1'
                method:
                  allOf:
                    - type: string
                      description: The name of the RPC method to invoke.
                      enum:
                        - getProgramAccounts
                      example: getProgramAccounts
                      default: getProgramAccounts
                params:
                  allOf:
                    - type: array
                      description: Parameters for the method.
                      default:
                        - 4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T
                      items:
                        oneOf:
                          - type: string
                            description: >-
                              The Solana program public key (address) to query
                              accounts for, as a base-58 encoded string.
                            example: 4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T
                          - type: object
                            description: >-
                              Advanced configuration options for optimizing
                              program account queries.
                            properties:
                              commitment:
                                type: string
                                description: The commitment level for the request.
                                enum:
                                  - confirmed
                                  - finalized
                                  - processed
                                example: finalized
                              minContextSlot:
                                type: integer
                                description: >-
                                  The minimum slot that the request can be
                                  evaluated at.
                                example: 1000
                              withContext:
                                type: boolean
                                description: Wrap the result in an RpcResponse JSON object.
                                example: true
                              encoding:
                                type: string
                                description: Encoding format for the returned account data.
                                enum:
                                  - jsonParsed
                                  - base58
                                  - base64
                                  - base64+zstd
                                example: jsonParsed
                              dataSlice:
                                type: object
                                description: Request a slice of the account's data.
                                properties:
                                  length:
                                    type: integer
                                    description: Number of bytes to return.
                                    example: 50
                                  offset:
                                    type: integer
                                    description: Byte offset from which to start reading.
                                    example: 0
                              changedSinceSlot:
                                type: integer
                                description: >-
                                  Only return accounts that were modified at or
                                  after this slot number. Useful for incremental
                                  updates.
                                example: 464175999
                              filters:
                                type: array
                                description: >-
                                  Powerful filtering system to efficiently query
                                  specific Solana account data patterns.
                                items:
                                  oneOf:
                                    - type: object
                                      description: >-
                                        Filter Solana accounts by their exact
                                        data size in bytes.
                                      properties:
                                        dataSize:
                                          type: integer
                                          description: >-
                                            The exact size of the account data in
                                            bytes for filtering.
                                          example: 17
                                    - type: object
                                      description: >-
                                        Filter Solana accounts by comparing data
                                        at specific memory offsets (most
                                        powerful filter).
                                      properties:
                                        memcmp:
                                          type: object
                                          description: >-
                                            Memory comparison filter for finding
                                            accounts with specific data patterns.
                                          properties:
                                            offset:
                                              type: integer
                                              description: >-
                                                Byte offset within account data to
                                                perform the comparison.
                                              example: 4
                                            bytes:
                                              type: string
                                              description: >-
                                                Base-58 encoded data to compare at the
                                                specified offset position.
                                              example: 3Mc6vR
              required:
                - jsonrpc
                - id
                - method
                - params
            examples:
              example:
                value:
                  jsonrpc: '2.0'
                  id: db16f277-1a22-41ff-9f85-f37e2cd77900
                  method: getProgramAccounts
                  params:
                    - 4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T
      responses:
        '200':
          description: Successfully retrieved program accounts.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        description: The JSON-RPC protocol version.
                        enum:
                          - '2.0'
                        example: '2.0'
                  id:
                    allOf:
                      - type: string
                        description: Identifier matching the request.
                        example: '1'
                  result:
                    allOf:
                      - oneOf:
                          - type: array
                            description: List of program accounts.
                            items:
                              type: object
                              properties:
                                pubkey:
                                  type: string
                                  description: >-
                                    The account Pubkey as a base-58 encoded
                                    string.
                                  example: CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY
                                account:
                                  type: object
                                  description: Details about the account.
                                  properties:
                                    lamports:
                                      type: integer
                                      description: >-
                                        Number of lamports assigned to this
                                        account.
                                      example: 15298080
                                    owner:
                                      type: string
                                      description: >-
                                        Base-58 encoded Pubkey of the program
                                        this account is assigned to.
                                      example: >-
                                        4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T
                                    data:
                                      type: array
                                      description: >-
                                        Account data as encoded binary or JSON
                                        format.
                                      items:
                                        type: string
                                      example:
                                        - 2R9jLfiAQ9bgdcw6h8s44439
                                        - base58
                                    executable:
                                      type: boolean
                                      description: >-
                                        Indicates if the account contains a
                                        program.
                                      example: false
                                    rentEpoch:
                                      type: integer
                                      description: >-
                                        The epoch at which this account will
                                        next owe rent.
                                      example: 28
                                    space:
                                      type: integer
                                      description: The data size of the account.
                                      example: 42
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    id: db16f277-1a22-41ff-9f85-f37e2cd77900
                    result:
                      - pubkey: CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY
                        account:
                          lamports: 15298080
                          owner: 4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T
                          data:
                            - 2R9jLfiAQ9bgdcw6h8s44439
                            - base58
                          executable: false
                          rentEpoch: 28
                          space: 42
        '400':
          description: Bad Request - Invalid request parameters or malformed request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        description: The JSON-RPC protocol version.
                        enum:
                          - '2.0'
                        example: '2.0'
                  error:
                    allOf:
                      - type: object
                        properties:
                          code:
                            type: integer
                            description: The error code.
                            example: -32602
                          message:
                            type: string
                            description: The error message.
                          data:
                            type: object
                            description: Additional data about the error.
                  id:
                    allOf:
                      - type: string
                        description: Identifier matching the request.
                        example: '1'
                refIdentifier: '#/components/schemas/ErrorResponse'
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    error:
                      code: -32602
                      message: Invalid params
                      data: {}
                    id: db16f277-1a22-41ff-9f85-f37e2cd77900
        '401':
          description: Unauthorized - Invalid or missing API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        description: The JSON-RPC protocol version.
                        enum:
                          - '2.0'
                        example: '2.0'
                  error:
                    allOf:
                      - type: object
                        properties:
                          code:
                            type: integer
                            description: The error code.
                            example: -32602
                          message:
                            type: string
                            description: The error message.
                          data:
                            type: object
                            description: Additional data about the error.
                  id:
                    allOf:
                      - type: string
                        description: Identifier matching the request.
                        example: '1'
                refIdentifier: '#/components/schemas/ErrorResponse'
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    error:
                      code: -32001
                      message: Unauthorized
                      data: {}
                    id: db16f277-1a22-41ff-9f85-f37e2cd77900
        '429':
          description: Too Many Requests - Rate limit exceeded.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        description: The JSON-RPC protocol version.
                        enum:
                          - '2.0'
                        example: '2.0'
                  error:
                    allOf:
                      - type: object
                        properties:
                          code:
                            type: integer
                            description: The error code.
                            example: -32602
                          message:
                            type: string
                            description: The error message.
                          data:
                            type: object
                            description: Additional data about the error.
                  id:
                    allOf:
                      - type: string
                        description: Identifier matching the request.
                        example: '1'
                refIdentifier: '#/components/schemas/ErrorResponse'
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    error:
                      code: -32005
                      message: Too many requests
                      data: {}
                    id: db16f277-1a22-41ff-9f85-f37e2cd77900
        '500':
          description: Internal Server Error - An error occurred on the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        description: The JSON-RPC protocol version.
                        enum:
                          - '2.0'
                        example: '2.0'
                  error:
                    allOf:
                      - type: object
                        properties:
                          code:
                            type: integer
                            description: The error code.
                            example: -32602
                          message:
                            type: string
                            description: The error message.
                          data:
                            type: object
                            description: Additional data about the error.
                  id:
                    allOf:
                      - type: string
                        description: Identifier matching the request.
                        example: '1'
                refIdentifier: '#/components/schemas/ErrorResponse'
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    error:
                      code: -32603
                      message: Internal error
                      data: {}
                    id: db16f277-1a22-41ff-9f85-f37e2cd77900
        '503':
          description: Service Unavailable - The service is temporarily unavailable.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        description: The JSON-RPC protocol version.
                        enum:
                          - '2.0'
                        example: '2.0'
                  error:
                    allOf:
                      - type: object
                        properties:
                          code:
                            type: integer
                            description: The error code.
                            example: -32602
                          message:
                            type: string
                            description: The error message.
                          data:
                            type: object
                            description: Additional data about the error.
                  id:
                    allOf:
                      - type: string
                        description: Identifier matching the request.
                        example: '1'
                refIdentifier: '#/components/schemas/ErrorResponse'
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    error:
                      code: -32002
                      message: Service unavailable
                      data: {}
                    id: db16f277-1a22-41ff-9f85-f37e2cd77900
        '504':
          description: Gateway Timeout - The request timed out.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        description: The JSON-RPC protocol version.
                        enum:
                          - '2.0'
                        example: '2.0'
                  error:
                    allOf:
                      - type: object
                        properties:
                          code:
                            type: integer
                            description: The error code.
                            example: -32602
                          message:
                            type: string
                            description: The error message.
                          data:
                            type: object
                            description: Additional data about the error.
                  id:
                    allOf:
                      - type: string
                        description: Identifier matching the request.
                        example: '1'
                refIdentifier: '#/components/schemas/ErrorResponse'
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    error:
                      code: -32003
                      message: Gateway timeout
                      data: {}
                    id: db16f277-1a22-41ff-9f85-f37e2cd77900
      security:
        - ApiKeyQuery: []
components:
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api_key

````