# getAccountInfo

> import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import CreditCost from '@site/src/components/CreditCost/CreditCostPrice.js'

# `getAccountInfo`

Returns information associated with the account of the specified address. <CreditCost network="solana" method="getAccountInfo" />

## Parameters

- `address`: (string) _[required]_ - The `base-58` encoded public key of the account to query.
- `config`: (object) _[optional]_ - Configuration object with the following options:
  - `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
    - `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
      reached maximum lockout, meaning the cluster has recognized this block as finalized.
    - `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
    - `processed` - Queries its most recent block. The block may still be skipped by the cluster.
  - `encoding`: (string) _[optional]_ - The encoding format to use. Can be one of `base58`, `base64`, `base64+zstd`,
    or `jsonParsed`
  - `dataSlice`: (object) _[optional]_ - A slice of the account data to return. Only available for `base58`, `base64`,
    or `base64+zstd` encoding. This is an object with two properties:
    - `offset` - The starting byte offset of the slice.
    - `length` - The length of the slice in bytes.
  - `minContextSlot`: _[optional]_ - The minimum slot to use for the query.

## Returns

`result` - `null` when the account doesn't exist, or an object with the following fields:

- `context` - An object containing the following keys:
  - `slot` - The slot number of the block that was queried.
  - `apiVersion` - The API version used for the query.
- `value` - An object containing the following keys:
  - `data` - The account data, encoded in the specified format.
  - `executable` - A boolean indicating whether the account is executable.
  - `lamports` - The number of lamports in the account.
  - `owner` - The public key of the program that owns the account.
  - `rentEpoch` - The epoch in which the account will next be due for rent.
  - `space` - The size of the account data in bytes.

## Example

Replace `<YOUR-API-KEY>` with your API key.

### Request

<Tabs>
  <TabItem value="curl">

```bash
curl https://solana-mainnet.infura.io/v3/<YOUR-API-KEY> \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "method": "getAccountInfo", "params": ["F5a3ExamplePubkeyABCDEFGH", {"encoding": "jsonParsed"}],"id": 1}'
```

  </TabItem>
</Tabs>

### Response

<Tabs>
  <TabItem value="JSON">

```bash
{
  "jsonrpc": "2.0",
  "result": {
    "context": {
      "apiVersion": "2.2.3",
      "slot": 371626267
    },
    "value": {
      "data": [
        "",
        "base58"
       ],
      "executable": false,
      "lamports": 88859014690252,
      "owner": "11111111111111111111111111111111",
      "rentEpoch": 18446744073709552000,
      "space": 0
    }
  },
  "id": 1
}
```

  </TabItem>
</Tabs>
