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

# getAccountInfo

> Returns all information associated with an account

Returns all information associated with the account of provided public key.

## Parameters

**account** `string` *required*

The public key of the account to query (base-58 encoded string)

**config** `object`

Configuration object containing the following optional fields:

**config fields**

**commitment** `string`

The level of commitment to use for querying the network:

* `processed`: Latest block (unconfirmed)
* `confirmed`: Confirmed by supermajority
* `finalized`: Finalized by supermajority

**encoding** `string` (default: base64)

Encoding format for the account data:

* `base58`
* `base64`
* `base64+zstd`
* `jsonParsed` (limited to certain account types)

**dataSlice** `object`

Request a slice of the account's data:

* `offset`: number - Start position (in bytes)
* `length`: number - Number of bytes to return

**minContextSlot** `number`

The minimum slot that the request can be evaluated at

## Response

**result** `object | null`

If the requested account doesn't exist, returns `null`. Otherwise, returns an object containing:

**result fields**

**context** `object`

**slot** `number`

The slot the request was processed at

**value** `object`

**lamports** `number`

Number of lamports assigned to the account

**owner** `string`

Base-58 encoded public key of the program that owns this account

**executable** `boolean`

Whether this account contains a program

**rentEpoch** `number`

The epoch at which this account will next owe rent

**data** `[string, string] | object`

The account's data. Format depends on the encoding parameter:

* `[string, encoding]` tuple if encoded as base58/base64
* Parsed JSON object if encoding is "jsonParsed"

**space** `number`

The space used by the account's data

## Code Examples

### Basic Request

```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
curl https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getAccountInfo",
  "params": [
    "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
    {
      "encoding": "base58"
    }
  ]
}'
```

### Response

```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
{
  "jsonrpc": "2.0",
  "result": {
    "context": {
      "slot": 430
    },
    "value": {
      "data": ["", "base58"],
      "executable": false,
      "lamports": 5000000000,
      "owner": "11111111111111111111111111111111",
      "rentEpoch": 18446744073709551615,
      "space": 0
    }
  },
  "id": 1
}
```

### Request with Data Slice

```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
curl https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getAccountInfo",
  "params": [
    "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
    {
      "encoding": "base64",
      "dataSlice": {
        "offset": 0,
        "length": 64
      }
    }
  ]
}'
```

### Using web3.js

```typescript theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
import { Connection, PublicKey } from '@solana/web3.js';

const connection = new Connection('https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY');
const publicKey = new PublicKey('vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg');

const accountInfo = await connection.getAccountInfo(
  publicKey,
  'confirmed'
);
```

## Notes

1. The `jsonParsed` encoding is only available for certain account types:
   * Stake account
   * Token account
   * Token mint
   * Token metadata

2. When using `dataSlice`, the data field will be limited to the requested slice only.

3. The account data may be encoded differently based on the program that owns the account.

## Common Errors

| Code | Message | Solution |
| - | - | - |
| -32602 | Invalid param: WrongSize | Verify the public key is valid |
| -32602 | Invalid param: not base58 encoded string | Ensure the public key is base58 encoded |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.