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

> Consulta el balance de hasta 100 cuentas de token en cualquier slot o timestamp pasado, con propietario y mint. Parámetros y ejemplos de getHistoricalTokenAccountBalances.

Obtén el balance de hasta 100 cuentas de token en un momento del pasado. Cada entrada incluye el propietario, el mint, el importe y los decimales de la cuenta, además del cambio que fijó ese balance. También funciona con cuentas de token que se han cerrado después.

* Pasa direcciones de cuentas de token, no wallets, y exactamente uno de `slot` o `timestamp` (segundos Unix).
* El balance es el último registrado en ese punto o antes. `lastBalanceChange.slot` y `timestamp` corresponden a ese cambio, no al punto que pediste.
* `balances` mantiene el orden de `accounts`; una cuenta sin balance conocido en ese punto es `null`.
* Los importes son solo unidades del token. No incluyen los lamports de renta de la cuenta; usa `getAccountInfo` con `slot` para obtener la cuenta completa.
* Un balance cero no significa que la cuenta se haya cerrado.
* De 1 a 100 cuentas por petición.

Coste: 2 créditos por llamada, que cuentan para el RPS general.

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 gethistoricaltokenaccountbalances post /
openapi: 3.1.0
info:
  title: Solana RPC
  version: 1.0.0
  description: Solana RPC HTTP method reference.
servers:
  - url: https://rpc-mainnet.solanatracker.io
    description: Mainnet RPC endpoint
security: []
paths:
  /:
    post:
      summary: getHistoricalTokenAccountBalances
      description: >-
        Read the balance of up to 100 token accounts at a past slot or
        timestamp, with owner, mint and the change that set each balance.
      operationId: gethistoricaltokenaccountbalances
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  allOf:
                    - type: string
                      enum:
                        - '2.0'
                      description: The JSON-RPC protocol version.
                      example: '2.0'
                id:
                  allOf:
                    - type: string
                      description: A unique identifier for the request.
                      example: '1'
                method:
                  allOf:
                    - type: string
                      enum:
                        - getHistoricalTokenAccountBalances
                      description: The name of the RPC method to invoke.
                      example: getHistoricalTokenAccountBalances
                      default: getHistoricalTokenAccountBalances
                params:
                  allOf:
                    - type: array
                      description: >-
                        A single configuration object with the token accounts
                        and one point in time.
                      default:
                        - accounts:
                            - CSBvQkExysKY55vCQbrrQYCTpdkeGbYNx3ir42SmdhyK
                          slot: 411108200
                      items:
                        type: object
                        description: Token accounts and the point in time to read them at.
                        required:
                          - accounts
                        properties:
                          accounts:
                            type: array
                            description: >-
                              Token account addresses to read, 1 to 100. Pass
                              token accounts, not wallet addresses.
                            minItems: 1
                            maxItems: 100
                            items:
                              type: string
                            example:
                              - CSBvQkExysKY55vCQbrrQYCTpdkeGbYNx3ir42SmdhyK
                          slot:
                            type: integer
                            description: >-
                              Read balances as of this slot. Set exactly one of
                              `slot` or `timestamp`.
                            example: 411108200
                          timestamp:
                            type: integer
                            description: >-
                              Read balances as of this time, in Unix seconds
                              (milliseconds are also accepted). Set exactly one
                              of `slot` or `timestamp`.
                            example: 1775359465
              required:
                - jsonrpc
                - id
                - method
                - params
            examples:
              bySlot:
                summary: Balances at a slot
                value:
                  jsonrpc: '2.0'
                  id: 1
                  method: getHistoricalTokenAccountBalances
                  params:
                    - accounts:
                        - CSBvQkExysKY55vCQbrrQYCTpdkeGbYNx3ir42SmdhyK
                        - BGocb4GEpbTFm8UFV2VsDSaBXHELPfAXrvd4vtt8QWrA
                      slot: 411108200
              byTimestamp:
                summary: Balances at a Unix timestamp
                value:
                  jsonrpc: '2.0'
                  id: 1
                  method: getHistoricalTokenAccountBalances
                  params:
                    - accounts:
                        - CSBvQkExysKY55vCQbrrQYCTpdkeGbYNx3ir42SmdhyK
                      timestamp: 1767225600
      responses:
        '200':
          description: Historical token account balances in request order.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        enum:
                          - '2.0'
                        description: The JSON-RPC protocol version.
                        example: '2.0'
                  id:
                    allOf:
                      - type: string
                        description: Identifier matching the request.
                        example: '1'
                  result:
                    allOf:
                      - type: object
                        description: Balances in request order.
                        properties:
                          balances:
                            type: array
                            description: >-
                              One entry per requested account, in the same
                              order. `null` when no balance is known for that
                              account at that point.
                            items:
                              oneOf:
                                - type: 'null'
                                  description: >-
                                    No balance found for this account at or
                                    before the point.
                                - type: object
                                  description: Token balance of one token account.
                                  properties:
                                    account:
                                      type: string
                                      description: Token account address.
                                      example: >-
                                        CSBvQkExysKY55vCQbrrQYCTpdkeGbYNx3ir42SmdhyK
                                    owner:
                                      type: string
                                      description: Wallet that owns the token account.
                                      example: >-
                                        7xK1a6Ut1pCrH9CiMwdEqx7RyhqgUZRux692Sg4m1TTw
                                    mint:
                                      type: string
                                      description: Token mint address.
                                      example: >-
                                        EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                                    amount:
                                      type: object
                                      description: >-
                                        Token balance at the requested point.
                                        Token units only; the account's rent
                                        lamports are not included.
                                      properties:
                                        raw:
                                          type: string
                                          description: >-
                                            Amount in base units (lamports for SOL),
                                            as a decimal string.
                                          example: '1523847120'
                                        decimals:
                                          type: integer
                                          description: Decimals of the token (9 for SOL).
                                          example: 9
                                        uiAmount:
                                          type: number
                                          description: >-
                                            Amount with decimals applied, as a
                                            number.
                                          example: 1.52384712
                                        uiAmountString:
                                          type: string
                                          description: >-
                                            Amount with decimals applied, as a
                                            string.
                                          example: '1.52384712'
                                    lastBalanceChange:
                                      type: object
                                      description: >-
                                        The balance change that produced this
                                        balance: the last change at or before
                                        the requested point. Its slot and
                                        timestamp are those of the change, not
                                        the point you asked for.
                                      properties:
                                        slot:
                                          type: integer
                                          description: Slot of the change.
                                          example: 411107934
                                        timestamp:
                                          type: integer
                                          description: >-
                                            Block time of the change, in Unix
                                            seconds.
                                          example: 1775359359
                                        previousAmount:
                                          type: object
                                          description: >-
                                            Balance before the change. Omitted when
                                            it is not known.
                                          properties:
                                            raw:
                                              type: string
                                              description: >-
                                                Amount in base units (lamports for SOL),
                                                as a decimal string.
                                              example: '1523847120'
                                            decimals:
                                              type: integer
                                              description: Decimals of the token (9 for SOL).
                                              example: 9
                                            uiAmount:
                                              type: number
                                              description: >-
                                                Amount with decimals applied, as a
                                                number.
                                              example: 1.52384712
                                            uiAmountString:
                                              type: string
                                              description: >-
                                                Amount with decimals applied, as a
                                                string.
                                              example: '1.52384712'
                                        amount:
                                          type: object
                                          description: >-
                                            Balance after the change. Same as the
                                            top-level `amount`.
                                          properties:
                                            raw:
                                              type: string
                                              description: >-
                                                Amount in base units (lamports for SOL),
                                                as a decimal string.
                                              example: '1523847120'
                                            decimals:
                                              type: integer
                                              description: Decimals of the token (9 for SOL).
                                              example: 9
                                            uiAmount:
                                              type: number
                                              description: >-
                                                Amount with decimals applied, as a
                                                number.
                                              example: 1.52384712
                                            uiAmountString:
                                              type: string
                                              description: >-
                                                Amount with decimals applied, as a
                                                string.
                                              example: '1.52384712'
                                        delta:
                                          type: object
                                          description: >-
                                            Signed change (`amount` minus
                                            `previousAmount`). Omitted when
                                            `previousAmount` is not known.
                                          properties:
                                            raw:
                                              type: string
                                              description: >-
                                                Signed amount in base units, as a
                                                decimal string; starts with `-` when the
                                                balance went down.
                                              example: '-5000'
                                            decimals:
                                              type: integer
                                              description: Decimals of the token (9 for SOL).
                                              example: 9
                                            uiAmount:
                                              type: number
                                              description: >-
                                                Amount with decimals applied, as a
                                                number.
                                              example: -0.000005
                                            uiAmountString:
                                              type: string
                                              description: >-
                                                Amount with decimals applied, as a
                                                string.
                                              example: '-0.000005'
                          found:
                            type: integer
                            description: Number of non-null entries in `balances`.
                            example: 1
              examples:
                bySlot:
                  summary: Balances at a slot
                  value:
                    jsonrpc: '2.0'
                    id: 1
                    result:
                      balances:
                        - account: CSBvQkExysKY55vCQbrrQYCTpdkeGbYNx3ir42SmdhyK
                          owner: 7xK1a6Ut1pCrH9CiMwdEqx7RyhqgUZRux692Sg4m1TTw
                          mint: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                          amount:
                            raw: '2500000000'
                            decimals: 6
                            uiAmount: 2500
                            uiAmountString: '2500'
                          lastBalanceChange:
                            slot: 411106512
                            timestamp: 1775358702
                            previousAmount:
                              raw: '1250000000'
                              decimals: 6
                              uiAmount: 1250
                              uiAmountString: '1250'
                            amount:
                              raw: '2500000000'
                              decimals: 6
                              uiAmount: 2500
                              uiAmountString: '2500'
                            delta:
                              raw: '1250000000'
                              decimals: 6
                              uiAmount: 1250
                              uiAmountString: '1250'
                        - null
                      found: 1
        '400':
          description: Bad Request - Invalid request parameters or malformed request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        enum:
                          - '2.0'
                        description: The JSON-RPC protocol version.
                        example: '2.0'
                  error:
                    allOf:
                      - 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:
                    allOf:
                      - type: string
                        description: Identifier matching the request.
                        example: '1'
                refIdentifier: '#/components/schemas/ErrorResponse'
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    error:
                      code: -32602
                      message: Invalid params
                    id: 1
        '401':
          description: Unauthorized - Invalid or missing API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        enum:
                          - '2.0'
                        description: The JSON-RPC protocol version.
                        example: '2.0'
                  error:
                    allOf:
                      - 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:
                    allOf:
                      - type: string
                        description: Identifier matching the request.
                        example: '1'
                refIdentifier: '#/components/schemas/ErrorResponse'
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    error:
                      code: -32001
                      message: Unauthorized
                    id: 1
        '429':
          description: Too Many Requests - Rate limit exceeded.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        enum:
                          - '2.0'
                        description: The JSON-RPC protocol version.
                        example: '2.0'
                  error:
                    allOf:
                      - 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:
                    allOf:
                      - type: string
                        description: Identifier matching the request.
                        example: '1'
                refIdentifier: '#/components/schemas/ErrorResponse'
              examples:
                example:
                  value:
                    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:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        enum:
                          - '2.0'
                        description: The JSON-RPC protocol version.
                        example: '2.0'
                  error:
                    allOf:
                      - 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:
                    allOf:
                      - type: string
                        description: Identifier matching the request.
                        example: '1'
                refIdentifier: '#/components/schemas/ErrorResponse'
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    error:
                      code: -32603
                      message: Internal error
                    id: 1
        '503':
          description: Service Unavailable - The service is temporarily unavailable.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        enum:
                          - '2.0'
                        description: The JSON-RPC protocol version.
                        example: '2.0'
                  error:
                    allOf:
                      - 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:
                    allOf:
                      - type: string
                        description: Identifier matching the request.
                        example: '1'
                refIdentifier: '#/components/schemas/ErrorResponse'
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    error:
                      code: -32002
                      message: Service unavailable
                    id: 1
        '504':
          description: Gateway Timeout - The request timed out.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        enum:
                          - '2.0'
                        description: The JSON-RPC protocol version.
                        example: '2.0'
                  error:
                    allOf:
                      - 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:
                    allOf:
                      - type: string
                        description: Identifier matching the request.
                        example: '1'
                refIdentifier: '#/components/schemas/ErrorResponse'
              examples:
                example:
                  value:
                    jsonrpc: '2.0'
                    error:
                      code: -32003
                      message: Gateway timeout
                    id: 1
      security:
        - ApiKeyQuery: []
components:
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api_key

````

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