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

# getAccountInfo | Solana

> The Solana getAccountInfo method returns all the account data for a given public key. Available on Solana via Chainstack JSON-RPC nodes.

The Solana `getAccountInfo` method returns all the account data for a given public key.

This method provides detailed information about the account, including the account's current balance, owner, and executable state. It is useful for retrieving the state of an account at a specific commitment level.

## Parameters

1. `pubkey` (string, required) — the base-58 encoded public key of the account to query.
2. `config` (object, optional) — configuration object containing:
   * `commitment` (string) — 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.
   * `encoding` (string) — encoding for the account data. Values:
     * `base64` — raw bytes as a base64 string (default).
     * `base58` — raw bytes as a base58 string (slow for large data).
     * `base64+zstd` — zstd-compressed base64.
     * `jsonParsed` — returns parsed JSON for known account types (token accounts, nonce accounts, vote accounts, stake accounts, etc.). Falls back to `base64` for unknown programs.
   * `dataSlice` (object) — request a slice of the account's data. Contains `offset` (byte offset) and `length` (number of bytes). Only available for non-`jsonParsed` encodings.
   * `minContextSlot` (integer) — the minimum slot at which the request can be evaluated.

## Response

* `context` — an object containing `slot` and `apiVersion`.
* `value` — the account information (null if the account does not exist):
  * `lamports` (u64) — the account's current balance in lamports.
  * `owner` (string) — the base-58 encoded public key of the program that owns the account.
  * `executable` (boolean) — whether the account is marked as executable.
  * `rentEpoch` (u64) — the epoch at which this account will next owe rent.
  * `data` — the account's data in the requested encoding:
    * Default: `[data, encoding]` tuple (e.g., `["base64data...", "base64"]`).
    * With `jsonParsed`: a `{program, parsed, space}` object. The `program` field identifies the owning program (`spl-token`, `spl-token-2022`, `nonce`, `stake`, `vote`, etc.) and `parsed` contains the decoded account state.
  * `space` (u64) — the data size of the account in bytes.

## Use case

A practical use case for `getAccountInfo` is to retrieve the current state of any Solana account — balances, token account data, program state, or nonce accounts. Using `jsonParsed` encoding is especially useful for token accounts, as it returns the mint, owner, balance, delegate, and state without manual deserialization.


## OpenAPI

````yaml openapi/solana_node_api/getAccountInfo.json POST /9de47db917d4f69168e3fed02217d15b
openapi: 3.0.0
info:
  title: getAccountInfo example
  version: 1.0.0
  description: This is an API example for Solana's getAccountInfo.
servers:
  - url: https://nd-326-444-187.p2pify.com
security: []
paths:
  /9de47db917d4f69168e3fed02217d15b:
    post:
      tags:
        - query
      summary: getAccountInfo
      operationId: getAccountInfo
      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: getAccountInfo
                params:
                  type: array
                  items:
                    anyOf:
                      - type: string
                        description: The public key of the account
                        default: 9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM
                      - type: object
                        properties:
                          encoding:
                            type: string
                            default: jsonParsed
                          commitment:
                            type: string
                            default: finalized
                  default:
                    - 9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM
                    - encoding: jsonParsed
                      commitment: finalized
      responses:
        '200':
          description: Account information
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: object

````