> ## 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.

# Método RPC getAccountInfo histórico

> Lee una cuenta de Solana tal como estaba en cualquier slot pasado o recorre sus actualizaciones una a una. Parámetros, limitaciones y ejemplos de getAccountInfo histórico.

Lee una cuenta tal como estaba en el pasado con el método estándar **getAccountInfo**. Añade una de estas opciones al objeto de configuración:

* `slot`: la cuenta al final de ese slot.
* `lastUpdateBeforeSlot`: la cuenta tras su última actualización estrictamente anterior a ese slot.
* `firstUpdateAfterSlot`: la cuenta tras su primera actualización estrictamente posterior a ese slot.

Indica solo una. Sin ninguna, `getAccountInfo` devuelve la cuenta tal como está ahora: consulta [getAccountInfo](https://docs.solanatracker.io/es/solana-rpc/http/getaccountinfo.md).

## Recorre el historial de una cuenta

Con `lastUpdateBeforeSlot` y `firstUpdateAfterSlot`, `context.slot` es el slot de la actualización devuelta. Pásalo de nuevo para recorrer el historial de la cuenta actualización a actualización.

Añade `changes` (de 1 a 20) para obtener también ese número de versiones anteriores en `result.changes`, de la más reciente a la más antigua, cada una con su `slot`, `blockTime` y `txnSignature`.

## Limitaciones

* Las lecturas históricas devuelven datos finalized. `commitment` se ignora y `minContextSlot` no se puede combinar con estas opciones.
* `value` es `null` cuando la cuenta no existía o estaba cerrada en ese momento, o cuando no hay datos de ella.
* **Las cuentas mint de SPL Token y Token-2022** no se pueden leer de forma histórica: devuelven el error `-32033` con `data.reason: "splTokenMint"`. Las cuentas stake, vote, config y sysvar también devuelven `-32033`.
* **Las cuentas de tokens** se reconstruyen a partir de su historial de saldo. Se devuelven el saldo, el mint, el propietario y los lamports de renta; no se devuelven las extensiones de Token-2022, el delegado, el estado congelado, la autoridad de cierre ni el `space` exacto.
* Un slot posterior al último disponible devuelve `-32030`, uno anterior al primero devuelve `-32031` y un slot sin datos disponibles devuelve `-32034`. Un recorrido con `lastUpdateBeforeSlot` o `firstUpdateAfterSlot` que pasa de la primera o la última actualización conocida devuelve `-32020`.
* `dataSlice` no se admite con `jsonParsed` ni `jsonParsedEnhanced`.

Una lectura histórica cuesta 1 crédito, igual que la llamada en tiempo real. Para muchas cuentas a la vez, usa [getMultipleAccounts histórico](https://docs.solanatracker.io/es/solana-rpc/http/historical-getmultipleaccounts.md).

Configuración y errores: [inicio rápido RPC](https://docs.solanatracker.io/es/solana-rpc/quickstart.md). Facturación: [créditos y límites](https://docs.solanatracker.io/es/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.