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

# Historical getAccountInfo RPC Method

> Read a Solana account as it was at any past slot, or step through its updates one at a time. Historical getAccountInfo parameters, limitations and examples.

Read an account as it was in the past with the standard **getAccountInfo** method. Add one of these to the config object:

* `slot`: the account as of the end of that slot.
* `lastUpdateBeforeSlot`: the account as of its last update strictly before that slot.
* `firstUpdateAfterSlot`: the account as of its first update strictly after that slot.

Set exactly one. Without any of them, `getAccountInfo` returns the account as it is now: see [getAccountInfo](https://docs.solanatracker.io/solana-rpc/http/getaccountinfo.md).

## Walk an account's history

With `lastUpdateBeforeSlot` and `firstUpdateAfterSlot`, `context.slot` is the slot of the update returned. Pass it back to step through the account's history one update at a time.

Add `changes` (1 to 20) to also get that many earlier versions in `result.changes`, newest first, each with its `slot`, `blockTime` and `txnSignature`.

## Limitations

* Historical reads return finalized data. `commitment` is ignored, and `minContextSlot` cannot be combined with these options.
* `value` is `null` when the account did not exist or was closed at that point, or when no data is known for it.
* **SPL Token and Token-2022 mint accounts** cannot be read historically: they return error `-32033` with `data.reason: "splTokenMint"`. Stake, vote, config and sysvar accounts also return `-32033`.
* **Token accounts** are rebuilt from their balance history. Balance, mint, owner and rent lamports are returned; Token-2022 extensions, delegate, frozen state, close authority and exact `space` are not.
* A slot after the latest available slot returns `-32030`, one before the earliest returns `-32031`, and a slot with no data available returns `-32034`. A `lastUpdateBeforeSlot` or `firstUpdateAfterSlot` walk past the first or last known update returns `-32020`.
* `dataSlice` is not allowed with `jsonParsed` or `jsonParsedEnhanced`.

A historical read costs 1 credit, the same as the live call. For many accounts at once, use [historical getMultipleAccounts](https://docs.solanatracker.io/solana-rpc/http/historical-getmultipleaccounts.md).

Request setup and error handling: [RPC quickstart](https://docs.solanatracker.io/solana-rpc/quickstart.md). Billing: [credits and limits](https://docs.solanatracker.io/solana-rpc/credits-and-rate-limits.md).


## OpenAPI

````yaml historical-getaccountinfo post /
openapi: 3.1.0
info:
  title: Solana RPC
  version: 1.0.0
  description: Solana JSON RPC API
servers:
  - url: https://rpc-mainnet.solanatracker.io
security: []
paths:
  /:
    post:
      summary: Historical getAccountInfo
      description: >-
        Read an account as it was at a past slot, or step through its updates
        one at a time. Send `getAccountInfo` with `slot`, `lastUpdateBeforeSlot`
        or `firstUpdateAfterSlot` in the config object.
      operationId: historical-getaccountinfo
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetAccountInfoRequest'
            examples:
              historicalAtSlot:
                summary: Historical read at a slot
                value:
                  jsonrpc: '2.0'
                  id: 1
                  method: getAccountInfo
                  params:
                    - 7xK1a6Ut1pCrH9CiMwdEqx7RyhqgUZRux692Sg4m1TTw
                    - encoding: base64
                      slot: 411108200
              historicalLastUpdateBefore:
                summary: Most recent update before a slot, with earlier versions
                value:
                  jsonrpc: '2.0'
                  id: 1
                  method: getAccountInfo
                  params:
                    - 7xK1a6Ut1pCrH9CiMwdEqx7RyhqgUZRux692Sg4m1TTw
                    - encoding: base64
                      lastUpdateBeforeSlot: 411108200
                      changes: 2
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAccountInfoResponse'
              examples:
                historicalAtSlot:
                  summary: Historical read at a slot
                  value:
                    jsonrpc: '2.0'
                    result:
                      context:
                        apiVersion: 4.2.1
                        slot: 411108200
                      value:
                        data:
                          - ''
                          - base64
                        executable: false
                        lamports: 1523847120
                        owner: '11111111111111111111111111111111'
                        rentEpoch: 18446744073709552000
                        space: 0
                    id: 1
                splTokenMint:
                  summary: SPL Token mint (not available historically)
                  value:
                    jsonrpc: '2.0'
                    error:
                      code: -32033
                      message: >-
                        Historic SPL Token mint state is not archived:
                        EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                      data:
                        pubkeys:
                          - EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                        reason: splTokenMint
                    id: 1
      security:
        - ApiKeyQuery: []
components:
  schemas:
    GetAccountInfoRequest:
      type: object
      required:
        - jsonrpc
        - id
        - method
        - params
      properties:
        jsonrpc:
          type: string
          enum:
            - '2.0'
        id:
          type: integer
        method:
          type: string
          enum:
            - getAccountInfo
        params:
          type: array
          minItems: 2
          maxItems: 2
          items:
            - type: string
              description: Pubkey of account to query, as base-58 encoded string
            - type: object
              description: >-
                Required. Set exactly one of `slot`, `lastUpdateBeforeSlot` or
                `firstUpdateAfterSlot`. Historical reads always return finalized
                data.
              properties:
                encoding:
                  type: string
                  enum:
                    - base58
                    - base64
                    - base64+zstd
                    - jsonParsed
                    - jsonParsedEnhanced
                  description: >-
                    Encoding format for account data. `jsonParsedEnhanced` is
                    `jsonParsed` plus Anchor IDL decoding of account data the
                    standard parser leaves unparsed. It costs no extra credits.
                dataSlice:
                  type: object
                  description: >-
                    Request a slice of the account's data. Not allowed with
                    `jsonParsed` or `jsonParsedEnhanced`.
                  properties:
                    offset:
                      type: integer
                      description: Byte offset from which to start reading
                    length:
                      type: integer
                      description: Number of bytes to read
                slot:
                  type: integer
                  description: >-
                    return the account as it was at the end of this slot (the
                    last update at or before it). Set at most one of `slot`,
                    `lastUpdateBeforeSlot` and `firstUpdateAfterSlot`.
                  example: 411108200
                lastUpdateBeforeSlot:
                  type: integer
                  description: >-
                    return the account as of its most recent update strictly
                    before this slot. Set at most one of `slot`,
                    `lastUpdateBeforeSlot` and `firstUpdateAfterSlot`.
                    `context.slot` is the slot of that update, so you can pass
                    it back to walk the account's history.
                  example: 411108200
                firstUpdateAfterSlot:
                  type: integer
                  description: >-
                    return the account as of its first update strictly after
                    this slot. Set at most one of `slot`, `lastUpdateBeforeSlot`
                    and `firstUpdateAfterSlot`. `context.slot` is the slot of
                    that update, so you can pass it back to walk the account's
                    history.
                  example: 411000000
                changes:
                  type: integer
                  minimum: 1
                  maximum: 20
                  description: >-
                    Also return up to this many earlier versions of the account,
                    newest first, strictly before the requested slot, in
                    `result.changes`.
                  example: 5
          default:
            - 7xK1a6Ut1pCrH9CiMwdEqx7RyhqgUZRux692Sg4m1TTw
            - encoding: base64
              slot: 411108200
    GetAccountInfoResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          enum:
            - '2.0'
        result:
          type: object
          properties:
            context:
              type: object
              properties:
                slot:
                  type: integer
                  description: >-
                    The slot at which the data was retrieved. For
                    `lastUpdateBeforeSlot` and `firstUpdateAfterSlot`, the slot
                    of the update returned.
                apiVersion:
                  type: string
                  description: The Solana API version
            value:
              oneOf:
                - type: 'null'
                  description: >-
                    If the account doesn't exist. On a historical read: the
                    account did not exist or was closed at that point, or no
                    data is known for it.
                - type: object
                  properties:
                    data:
                      oneOf:
                        - type: array
                          description: '[data, encoding] pair for base58/base64'
                          items:
                            - type: string
                            - type: string
                        - type: object
                          description: Parsed data object when jsonParsed encoding is used
                    executable:
                      type: boolean
                      description: Boolean indicating if the account contains a program
                    lamports:
                      type: integer
                      description: Number of lamports assigned to this account
                    owner:
                      type: string
                      description: >-
                        Base-58 encoded Pubkey of the program this account has
                        been assigned to
                    rentEpoch:
                      type: integer
                      description: The epoch at which this account will next owe rent
                    space:
                      type: integer
                      description: The data size of the account
            changes:
              type: array
              description: >-
                Only with `changes`: earlier versions of the account, newest
                first. Each is an account object in the requested encoding with
                the update's slot, block time and transaction signature added.
              items:
                type: object
                properties:
                  data:
                    description: Account data in the requested encoding.
                  executable:
                    type: boolean
                  lamports:
                    type: integer
                  owner:
                    type: string
                  rentEpoch:
                    type: integer
                  space:
                    type: integer
                  slot:
                    type: integer
                    description: Slot of the update.
                  blockTime:
                    type: integer
                    description: Block time of the update, in Unix seconds.
                  txnSignature:
                    type: string
                    description: Signature of the transaction that made the update.
        id:
          type: integer
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api_key

````

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