# getAccountInfo

> Returns all information associated with a single account, including its data, owner and balance.

Source: https://docs.constant-k.com/rpc/http/getaccountinfo/

`getAccountInfo` returns an account's lamport balance, owning program, executable flag, and data.

`encoding: jsonParsed` returns structured JSON when the node has a parser for the account's owner program (System, Token, Token-2022, Stake, Vote and others); other accounts return as `base64`, decodable with the program's own account schema.

- Transport: HTTP, JSON-RPC 2.0 `POST` to `https://rpc-newyork.constant-k.com/?api-key=YOUR_API_KEY` (New York) or `https://rpc-frankfurt.constant-k.com/?api-key=YOUR_API_KEY` (Frankfurt) or `https://rpc-amsterdam.constant-k.com/?api-key=YOUR_API_KEY` (Amsterdam). The key also works as an `x-api-key` header.
- Category: Accounts
- Availability: All plans
- Rate limits: Free 5/s · Operator 50/s · Blade Runner 200/s · Nexus 500/s

## Parameters

`params` is a positional JSON array, in this order:

- `pubkey` (string, required): Address of the account to look up, base-58 encoded.
- `config` (object, optional): Optional configuration.
  - `commitment` (string, optional, one of `finalized`, `confirmed`, `processed`, default `"finalized"`): Bank state to read the account from.
  - `encoding` (string, optional, one of `base58`, `base64`, `base64+zstd`, `jsonParsed`, default `"base58"`): How to encode `data`. `jsonParsed` returns structured fields when the node has a parser for the account's owner program and falls back to `base64` otherwise; `base58` fails for accounts larger than 129 bytes.
  - `dataSlice` (object, optional): Returns only a byte range of `data` instead of the whole thing. Rejected when encoding is `jsonParsed`.
    - `offset` (integer, required): Byte offset to start the slice at.
    - `length` (integer, required): Number of bytes to return.
  - `minContextSlot` (integer, optional): Minimum slot the node must have processed before answering.

## Result

- `result` (object, optional): The account, wrapped with context, or a null value if the account doesn't exist.
  - `context` (object, required)
    - `slot` (integer, optional)
    - `apiVersion` (string, optional)
  - `value` (object | null, required)
    - `option 1` (object, optional)
      - `lamports` (integer, required): Balance, in lamports.
      - `owner` (string, required): Base-58 address of the program that owns this account.
      - `executable` (boolean, required): Whether the account's data contains a loaded program (and is read-only at runtime).
      - `rentEpoch` (integer, required): Legacy rent-collection field. Rent collection is disabled network-wide; this is retained for backward compatibility and is not meaningful for current accounts.
      - `space` (integer, required): Size of the account's data, in bytes.
      - `data` (any, required): Account data. A `[base64String, encoding]` 2-tuple for base58/base64/base64+zstd, or a parsed object (`{program, parsed, space}`) for jsonParsed.
    - `option 2` (null, optional)

## Example: Get the USDC mint account (jsonParsed)

Request:

```bash
curl "https://rpc-newyork.constant-k.com/?api-key=YOUR_API_KEY" \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getAccountInfo",
    "params": [
      "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      { "encoding": "jsonParsed" }
    ]
  }'
```

Response:

```json
{
  "jsonrpc": "2.0",
  "result": {
    "context": {
      "apiVersion": "4.3.0-rc.0",
      "slot": 447947003
    },
    "value": {
      "data": {
        "parsed": {
          "info": {
            "decimals": 6,
            "freezeAuthority": "7dGbd2QZcCKcTndnHcTL8q7SMVXAkp688NTQYwrRCrar",
            "isInitialized": true,
            "mintAuthority": "BJE5MMbqXjVwjAF7oxwPYXnTXDyspzZyt4vwenNw5ruG",
            "supply": "7684484927720180"
          },
          "type": "mint"
        },
        "program": "spl-token",
        "space": 82
      },
      "executable": false,
      "lamports": 534633977876,
      "owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
      "rentEpoch": 18446744073709552000,
      "space": 82
    }
  },
  "id": 1
}
```

## Example: Get the same account as raw base64

Request:

```bash
curl "https://rpc-newyork.constant-k.com/?api-key=YOUR_API_KEY" \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getAccountInfo",
    "params": [
      "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      { "encoding": "base64" }
    ]
  }'
```

Response:

```json
{
  "jsonrpc": "2.0",
  "result": {
    "context": {
      "apiVersion": "4.3.0-rc.0",
      "slot": 447947006
    },
    "value": {
      "data": [
        "AQAAAJj+huiNm+Lqi8HMpIeLKYjCQPUrhCS/tA7Rot3LXhmb9Apmkv9MGwAGAQEAAABicKqKWcWUBbRShshncubNEm6bil06OFNtN/e0FOi2Zw==",
        "base64"
      ],
      "executable": false,
      "lamports": 534633977876,
      "owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
      "rentEpoch": 18446744073709552000,
      "space": 82
    }
  },
  "id": 1
}
```

## Notes

- `rentEpoch` shows `18446744073709551615` (u64::MAX) on most accounts, the sentinel value meaning rent collection does not apply, not a real epoch number.
- `jsonParsed` falls back silently to `base64` when the node has no parser for the account's owner program, so `data.parsed` is not always present.
- `dataSlice` returns a byte range instead of the full account payload, useful when only a few fields are needed.

