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

# getHistoricalAccountInfo

> Read any Solana account as it was at a past slot or right after a specific transaction, with getAccountInfo encodings and the position of the last write.

> [!NOTE]
>
> `getHistoricalAccountInfo` is in Beta. Parameters, pricing, response formats, and data coverage may change.

## Overview

`getHistoricalAccountInfo` returns a Solana account as it was at a past slot, or immediately after a specific transaction in that slot. It's a Helius-exclusive RPC method. Standard `getAccountInfo` only returns current state.

The response has the same account fields as `getAccountInfo`, plus `lastUpdatedAt`: the slot and transaction that last wrote the state you received.

History is available from slot 444,959,999 (September 7, 2026) onward, which is the state at the start of epoch 1030. Requests for earlier slots return error `-32018`.

`getHistoricalAccountInfo` is available on mainnet for Business plans and above, and costs 0 credits per call during the beta period. Pricing is subject to change.

## Choose a position in history

The second parameter is a query object that selects which point in history to read:

| Query | Returns the account |
| - | - |
| Omitted or `{}` | At the latest indexed slot, capped at the requested commitment |
| `{ "slot": 445000000 }` | At the end of slot 445,000,000 |
| `{ "slot": 445000000, "transactionIndex": 10 }` | Immediately after the transaction at index 10 in slot 445,000,000 executed |

`transactionIndex` requires `slot`. To read an account right before the transaction at index `N`, query `transactionIndex: N - 1`. For the first transaction in a slot, query the previous slot with no `transactionIndex`.

Non-transaction writes, such as epoch rewards, are applied at the end of the slot. A query with `transactionIndex` never includes them.

## Example request

```bash theme={"system"}
curl https://mainnet.helius-rpc.com/?api-key=YOUR_API_KEY \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "getHistoricalAccountInfo",
    "params": [
      "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      { "slot": 445000000 },
      { "encoding": "jsonParsed" }
    ]
  }'
```

## Read the response

* **`value`** is the account as it was at the requested position, or `null` if the account didn't exist then: it hadn't been created yet, or it had been closed. A `null` response has no `lastUpdatedAt`.
* **`lastUpdatedAt.slot`** and **`lastUpdatedAt.transactionIndex`** identify the write that produced this state. The write is at or before the position you asked for.
* **`lastUpdatedAt.transactionIndex` is `null`** when the write happened outside a transaction, such as epoch rewards.
* **`lastUpdatedAt.slot` of 444,959,999 with a `null` `transactionIndex`** means the account hasn't changed since history coverage began. It doesn't mean the account was written in that slot.
* **`context.slot`** is the latest slot Helius had indexed when it served the request, not the slot you queried.
* **`jsonParsed` token accounts** use the mint's decimals as of the requested position. If the mint can't be read at that position, the account falls back to base64.

To list every past state of an account, use `lastUpdatedAt` as a cursor. See [Walk back through account history](https://www.helius.dev/docs/rpc/historical-accounts.md#walk-back-through-account-history).

## Errors

| Code | Meaning |
| - | - |
| `-32018` | The slot is before history coverage begins (slot 444,959,999) |
| `-32004` | The slot is newer than the requested commitment allows. Use `confirmed` or query an older slot |
| `-32602` | Invalid parameters, such as `transactionIndex` without `slot`, `base58` encoding, or an unknown configuration field |
| `-32601` | Method not found. Call your Helius mainnet or Gatekeeper endpoint; the method isn't available on devnet |

## Related methods

> [card] [Historical Accounts Guide](https://www.helius.dev/docs/rpc/historical-accounts.md)
>
> How positions, coverage, and lastUpdatedAt work for historical account methods

> [card] [getHistoricalTokenAccountsByOwner](https://www.helius.dev/docs/api-reference/rpc/http/gethistoricaltokenaccountsbyowner.md)
>
> List a wallet's token accounts at a past slot

> [card] [getTransactionsForAddress](https://www.helius.dev/docs/rpc/gettransactionsforaddress.md)
>
> Find the slot and transactionIndex of the transactions you want to inspect

> [card] [getAccountInfo](https://www.helius.dev/docs/api-reference/rpc/http/getaccountinfo.md)
>
> Read an account's current state

## Request Parameters

**pubkey** `string` *required*

Base-58 encoded address of the account to read.

**slot** `number`

Slot to read state at. Returns the account as of the end of this slot. The earliest supported slot is 444959999, the state at the start of epoch 1030. When omitted, reads the latest indexed slot, capped at the requested commitment.

**transactionIndex** `number`

Position of a transaction within the slot. Returns the account state immediately after that transaction executed, instead of at the end of the slot. Requires slot.

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

Encoding format for account data. base58 and binary are not supported.

* `base64`
* `base64+zstd`
* `jsonParsed`

**dataSlice** `object`

Return only a slice of each account's data. Applies to base64 and base64+zstd encodings.

**dataSlice.offset** `number` *required*

Byte offset from which to start reading.

**dataSlice.length** `number` *required*

Number of bytes to return.

**commitment** `string` (default: finalized)

Commitment level. processed is not supported.

* `finalized`
* `confirmed`

**minContextSlot** `number`

The minimum slot that the request can be evaluated at.


## OpenAPI

````yaml openapi/rpc-http/getHistoricalAccountInfo.yaml POST /
openapi: 3.1.0
info:
  title: Solana RPC API
  version: 1.0.0
  description: >-
    Historical Solana account state API for reading any account as it was at a
    past slot, or immediately after a specific transaction within a slot.
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://mainnet.helius-rpc.com
    description: Mainnet RPC endpoint
security: []
paths:
  /:
    post:
      tags:
        - RPC
      summary: getHistoricalAccountInfo
      description: >
        **Beta.** Parameters, response formats, and data coverage may change.


        Returns a Solana account as it was at a past slot, or immediately after
        a specific

        transaction within that slot. This Helius RPC method takes the same
        address and

        encoding options as getAccountInfo, plus a query object that selects the
        position in

        history to read.


        History covers slot 444959999 (the start of epoch 1030) onward. Each
        returned account

        includes lastUpdatedAt, the slot and transaction that last wrote the
        state you

        received.
      operationId: getHistoricalAccountInfo
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  example: '2.0'
                  description: The JSON-RPC protocol version.
                  default: '2.0'
                id:
                  type: string
                  example: '1'
                  description: A unique identifier for the request.
                  default: '1'
                method:
                  type: string
                  enum:
                    - getHistoricalAccountInfo
                  example: getHistoricalAccountInfo
                  description: The name of the RPC method to invoke.
                  default: getHistoricalAccountInfo
                params:
                  type: array
                  description: >-
                    Array containing the account address, an optional query
                    object that selects the position in history, and an optional
                    configuration object.
                  minItems: 1
                  maxItems: 3
                  default:
                    - EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                    - slot: 445000000
                    - encoding: jsonParsed
                  items:
                    oneOf:
                      - type: string
                        title: Pubkey
                        description: Base-58 encoded address of the account to read.
                        example: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                      - $ref: '#/components/schemas/HistoricalAccountQuery'
                        title: Query
                      - type: object
                        title: Configuration
                        description: Optional configuration object.
                        properties:
                          encoding:
                            type: string
                            description: >-
                              Encoding format for account data. base58 and
                              binary are not supported.
                            enum:
                              - base64
                              - base64+zstd
                              - jsonParsed
                            default: base64
                            example: jsonParsed
                          dataSlice:
                            $ref: '#/components/schemas/DataSliceConfig'
                          commitment:
                            type: string
                            description: Commitment level. processed is not supported.
                            enum:
                              - finalized
                              - confirmed
                            default: finalized
                            example: finalized
                          minContextSlot:
                            type: integer
                            description: >-
                              The minimum slot that the request can be evaluated
                              at.
                            example: 445000000
                        additionalProperties: false
      responses:
        '200':
          description: Successfully retrieved the historical account state.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    description: The JSON-RPC protocol version.
                    enum:
                      - '2.0'
                    example: '2.0'
                  id:
                    type: string
                    description: Identifier matching the request.
                    example: '1'
                  result:
                    type: object
                    properties:
                      context:
                        $ref: '#/components/schemas/HistoricalContext'
                      value:
                        oneOf:
                          - $ref: '#/components/schemas/HistoricalAccount'
                          - type: 'null'
                        description: >-
                          The account at the requested position, or null if it
                          did not exist then.
        '400':
          description: Bad Request - Invalid request parameters or malformed request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32602
                  message: Invalid params
                id: '1'
        '401':
          description: Unauthorized - Invalid or missing API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32001
                  message: Unauthorized
                id: '1'
        '429':
          description: Too Many Requests - Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32005
                  message: Too many requests
                id: '1'
        '500':
          description: Internal Server Error - An error occurred on the server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32603
                  message: Internal error
                id: '1'
        '503':
          description: Service Unavailable - The service is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32002
                  message: Service unavailable
                id: '1'
        '504':
          description: Gateway Timeout - The request timed out.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32003
                  message: Gateway timeout
                id: '1'
      security:
        - ApiKeyQuery: []
components:
  schemas:
    HistoricalAccountQuery:
      type: object
      description: >-
        The position in history to read. Omit it, or send an empty object, to
        read the latest indexed slot.
      properties:
        slot:
          type: integer
          description: >-
            Slot to read state at. Returns the account as of the end of this
            slot. The earliest supported slot is 444959999, the state at the
            start of epoch 1030. When omitted, reads the latest indexed slot,
            capped at the requested commitment.
          minimum: 444959999
          example: 445000000
        transactionIndex:
          type: integer
          description: >-
            Position of a transaction within the slot. Returns the account state
            immediately after that transaction executed, instead of at the end
            of the slot. Requires slot.
          minimum: 0
          maximum: 16777214
          example: 10
      additionalProperties: false
    DataSliceConfig:
      type: object
      description: >-
        Return only a slice of each account's data. Applies to base64 and
        base64+zstd encodings.
      properties:
        offset:
          type: integer
          description: Byte offset from which to start reading.
          example: 0
        length:
          type: integer
          description: Number of bytes to return.
          example: 8
      required:
        - offset
        - length
    HistoricalContext:
      type: object
      description: Response metadata.
      properties:
        slot:
          type: integer
          description: >-
            The latest slot the history store had indexed when it served the
            request. This is not the slot you queried.
          example: 468129571
    HistoricalAccount:
      type: object
      description: >-
        The account as it was at the requested position, plus where that state
        was last written.
      properties:
        lamports:
          type: integer
          description: Number of lamports assigned to this account.
          example: 531589475273
        owner:
          type: string
          description: Base-58 encoded pubkey of the program this account was assigned to.
          example: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
        data:
          description: >-
            Account data. With base64 or base64+zstd, a two-item array of the
            encoded data and the encoding. With jsonParsed, an object with
            program, parsed, and space. Accounts that can't be parsed fall back
            to the base64 array.
          oneOf:
            - type: array
              items:
                type: string
            - type: object
              properties:
                program:
                  type: string
                  description: Name of the program that owns the account.
                  example: spl-token
                parsed:
                  type: object
                  description: Program-specific parsed account state.
                space:
                  type: integer
                  description: Data size of the account.
                  example: 82
        executable:
          type: boolean
          description: Whether the account contains a program.
          example: false
        rentEpoch:
          type: integer
          description: >-
            The epoch at which this account will next owe rent. Rent-exempt
            accounts report the maximum u64 value.
        space:
          type: integer
          description: Data size of the account in bytes.
          example: 82
        lastUpdatedAt:
          $ref: '#/components/schemas/AccountWritePosition'
      required:
        - lamports
        - owner
        - data
        - executable
        - rentEpoch
        - space
        - lastUpdatedAt
    ErrorResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          description: The JSON-RPC protocol version.
          enum:
            - '2.0'
          example: '2.0'
        error:
          type: object
          properties:
            code:
              type: integer
              description: The error code.
              example: -32602
            message:
              type: string
              description: The error message.
            data:
              type: object
              description: Additional data about the error.
        id:
          type: string
          description: Identifier matching the request.
          example: '1'
    AccountWritePosition:
      type: object
      description: >-
        Where the returned state was last written, at or before the requested
        position.
      properties:
        slot:
          type: integer
          description: >-
            Slot of the last write. A value of 444959999 with a null
            transactionIndex means the account has not changed since history
            coverage began.
          example: 444999837
        transactionIndex:
          oneOf:
            - type: integer
            - type: 'null'
          description: >-
            Position of the transaction that made the last write. Null when the
            write happened outside a transaction (for example, epoch rewards),
            or when the account has not changed since history coverage began.
          example: 700
      required:
        - slot
        - transactionIndex
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: >-
        Your Helius API key. You can get one for free in the
        [dashboard](https://dashboard.helius.dev/api-keys).

````

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