getProgramAccounts | Solana

The example uses Pyth Network Oracle program address.

Solana getProgramAccounts method

The Solana getProgramAccounts method returns all accounts owned by the provided program.

This method provides detailed information about each account owned by a specific program, including the account's current balance and data. It is useful for retrieving the state of all accounts associated with a specific program.


Get you own node endpoint today

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


  • programId β€” the public key of the program to retrieve accounts for.
  • commitment β€” (optional) the level of commitment desired:
    • processed β€” the node has processed the block and the block may be on a fork.
    • confirmed β€” the block is confirmed by the cluster as not being on a fork.
    • finalized β€” the block is finalized by the cluster.


  • value β€” an array of account information objects, each containing:
    • pubkey β€” the public key of the account.
    • account β€” the account information:
      • lamports β€” the account's current balance.
      • owner β€” the public key of the program that owns the account.
      • executable β€” whether the account is marked as executable.
      • rentEpoch β€” the epoch at which this account will next owe rent.
      • data β€” the account's data, represented as a base64 string.

Use case

A practical use case for getProgramAccounts is to retrieve the current state of all accounts associated with a specific Solana program. This can be useful for wallets or other applications that need to display or make use of this information.

Try the getProgramAccounts RPC method yourself

Click Try It! to start a request and see the response here!