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

> Lista todas las cuentas de token que tenía una wallet en un slot o timestamp pasado, con sus balances, en páginas de hasta 500. Parámetros y ejemplos de getHistoricalTokenAccountsByOwner.

Obtén los tokens que tenía una wallet en un slot o timestamp pasado. Cada cuenta de token se devuelve con su mint, su importe y el cambio que lo fijó. Omite tanto `slot` como `timestamp` para obtener los tokens actuales.

* Define como máximo uno de `slot` o `timestamp` (segundos Unix).
* Filtra por un token con `mint` y omite las cuentas vacías con `excludeZeroBalance: true`.
* Las páginas contienen hasta 500 cuentas (`limit`, 100 por defecto). Pasa el `paginationToken` devuelto para obtener la página siguiente, con los mismos `owner`, `mint`, momento y `excludeZeroBalance`. La última página no incluye `paginationToken`.
* Una cuenta de token cerrada hace mucho tiempo puede no aparecer en esta lista. Consúltala directamente con [getHistoricalTokenAccountBalances](https://docs.solanatracker.io/es/solana-rpc/http/gethistoricaltokenaccountbalances.md).
* Los importes son solo unidades del token; no incluyen los lamports de renta.

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 gethistoricaltokenaccountsbyowner 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: getHistoricalTokenAccountsByOwner
      description: >-
        List the token accounts a wallet held at a past slot or timestamp, with
        balances, paged up to 500 at a time.
      operationId: gethistoricaltokenaccountsbyowner
      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:
                        - getHistoricalTokenAccountsByOwner
                      description: The name of the RPC method to invoke.
                      example: getHistoricalTokenAccountsByOwner
                      default: getHistoricalTokenAccountsByOwner
                params:
                  allOf:
                    - type: array
                      description: >-
                        A single configuration object with the wallet, point in
                        time, filters and paging.
                      default:
                        - owner: 7xK1a6Ut1pCrH9CiMwdEqx7RyhqgUZRux692Sg4m1TTw
                          slot: 411108200
                          limit: 100
                      items:
                        type: object
                        description: Wallet, optional point in time, filters and paging.
                        required:
                          - owner
                        properties:
                          owner:
                            type: string
                            description: Wallet address whose token accounts to list.
                            example: 7xK1a6Ut1pCrH9CiMwdEqx7RyhqgUZRux692Sg4m1TTw
                          mint:
                            type: string
                            description: Only return token accounts of this mint.
                            example: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                          slot:
                            type: integer
                            description: >-
                              Read holdings as of this slot. Set at most one of
                              `slot` or `timestamp`; omit both for current
                              holdings.
                            example: 411108200
                          timestamp:
                            type: integer
                            description: >-
                              Read holdings as of this time, in Unix seconds
                              (milliseconds are also accepted). Set at most one
                              of `slot` or `timestamp`.
                            example: 1767225600
                          excludeZeroBalance:
                            type: boolean
                            description: >-
                              Leave out token accounts whose balance is zero at
                              that point.
                            default: false
                            example: true
                          limit:
                            type: integer
                            description: Maximum token accounts per page, 1 to 500.
                            minimum: 1
                            maximum: 500
                            default: 100
                            example: 100
                          paginationToken:
                            type: string
                            description: >-
                              The `paginationToken` from the previous page. Keep
                              `owner`, `mint`, the point in time and
                              `excludeZeroBalance` unchanged while paging.
                            example: BGocb4GEpbTFm8UFV2VsDSaBXHELPfAXrvd4vtt8QWrA
              required:
                - jsonrpc
                - id
                - method
                - params
            examples:
              bySlot:
                summary: Holdings at a slot, zero balances skipped
                value:
                  jsonrpc: '2.0'
                  id: 1
                  method: getHistoricalTokenAccountsByOwner
                  params:
                    - owner: 7xK1a6Ut1pCrH9CiMwdEqx7RyhqgUZRux692Sg4m1TTw
                      slot: 411108200
                      excludeZeroBalance: true
                      limit: 100
              byTimestampAndMint:
                summary: One mint at a Unix timestamp
                value:
                  jsonrpc: '2.0'
                  id: 1
                  method: getHistoricalTokenAccountsByOwner
                  params:
                    - owner: 7xK1a6Ut1pCrH9CiMwdEqx7RyhqgUZRux692Sg4m1TTw
                      timestamp: 1767225600
                      mint: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
              nextPage:
                summary: Next page
                value:
                  jsonrpc: '2.0'
                  id: 1
                  method: getHistoricalTokenAccountsByOwner
                  params:
                    - owner: 7xK1a6Ut1pCrH9CiMwdEqx7RyhqgUZRux692Sg4m1TTw
                      slot: 411108200
                      excludeZeroBalance: true
                      limit: 100
                      paginationToken: BGocb4GEpbTFm8UFV2VsDSaBXHELPfAXrvd4vtt8QWrA
      responses:
        '200':
          description: A page of historical token accounts for the wallet.
          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: One page of token accounts.
                        properties:
                          accounts:
                            type: array
                            description: Token accounts the wallet owned at that point.
                            items:
                              type: object
                              description: One token account and its balance.
                              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'
                          paginationToken:
                            type: string
                            description: >-
                              Pass this to get the next page. Omitted on the
                              last page.
                            example: BGocb4GEpbTFm8UFV2VsDSaBXHELPfAXrvd4vtt8QWrA
                          count:
                            type: integer
                            description: Number of accounts in this page.
                            example: 1
              examples:
                bySlot:
                  summary: Holdings at a slot
                  value:
                    jsonrpc: '2.0'
                    id: 1
                    result:
                      accounts:
                        - 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'
                      count: 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.