> ## 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 DAS getTokenAccounts

> Lista cuentas de SPL Token y Token-2022 por propietario, por mint o por ambos, ordenadas por dirección con paginación por cursor o por página. Parámetros y ejemplos de getTokenAccounts.

Cubre cuentas de SPL Token y Token-2022, ordenadas por dirección de la cuenta de token. También se acepta como `get_token_accounts`.

* Envía `owner`, `mint` o ambos. `ownerAddress` y `mintAddress` se aceptan como alias.
* Las cuentas de token vacías se ocultan salvo que `options.showZeroBalance` sea `true`.
* `amount` es el balance raw en unidades base.
* `limit` es 1000 por defecto y no puede superar 1000.
* Sin `page`, `before` ni `after`, el `cursor` de la respuesta es la dirección de la última cuenta. Envíalo como `cursor` para obtener la página siguiente; detente cuando `token_accounts` esté vacío.
* Una consulta que coincide con más de 200.000 cuentas de token devuelve un error, así que `mint` por sí solo no funciona con tokens muy distribuidos. Añade `owner` o usa [getTokenLargestAccounts](https://docs.solanatracker.io/es/solana-rpc/http/gettokenlargestaccounts.md).
* Cuesta 1 crédito y cuenta para el límite de RPS DAS de tu plan.

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

Todos los métodos DAS: [resumen de DAS API](https://docs.solanatracker.io/es/solana-rpc/das-api.md).


## OpenAPI

````yaml gettokenaccounts 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: getTokenAccounts
      description: >-
        List SPL Token and Token-2022 accounts by owner, by mint, or by both,
        sorted by token account address. Empty accounts are hidden unless
        `showZeroBalance` is set.
      operationId: gettokenaccounts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  allOf:
                    - type: string
                      description: The JSON-RPC protocol version.
                      example: '2.0'
                      enum:
                        - '2.0'
                id:
                  allOf:
                    - type: string
                      description: A unique identifier for the request.
                      example: '1'
                method:
                  allOf:
                    - type: string
                      description: The name of the RPC method to invoke.
                      example: getTokenAccounts
                      enum:
                        - getTokenAccounts
                params:
                  allOf:
                    - type: object
                      description: >-
                        Owner and/or mint, and pagination. Send at least one of
                        `owner` or `mint`. Unknown keys are rejected.
                      properties:
                        owner:
                          type: string
                          description: Owner wallet. Also accepted as `ownerAddress`.
                          example: 86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY
                        mint:
                          type: string
                          description: Token mint. Also accepted as `mintAddress`.
                          example: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                        limit:
                          type: integer
                          description: Maximum items per page. Default 1000, maximum 1000.
                          example: 100
                          default: 1000
                          minimum: 1
                          maximum: 1000
                        page:
                          type: integer
                          description: >-
                            1-based page number. Cannot be combined with
                            `before`, `after` or `cursor`.
                          example: 1
                          minimum: 1
                        cursor:
                          type: string
                          description: >-
                            Token account address from the previous response's
                            `cursor`. Returns accounts after it.
                        before:
                          type: string
                          description: >-
                            Return token accounts with an address lower than
                            this one (exclusive).
                        after:
                          type: string
                          description: >-
                            Return token accounts with an address higher than
                            this one (exclusive).
                        options:
                          type: object
                          description: Display options. Also accepted as `displayOptions`.
                          properties:
                            showZeroBalance:
                              type: boolean
                              description: Include token accounts with a zero balance.
                              example: false
                              default: false
              required:
                - jsonrpc
                - id
                - method
                - params
            examples:
              ownerExample:
                summary: All token accounts of a wallet
                value:
                  jsonrpc: '2.0'
                  id: 1
                  method: getTokenAccounts
                  params:
                    owner: 86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY
                    limit: 100
              ownerMintExample:
                summary: A wallet's accounts for one mint
                value:
                  jsonrpc: '2.0'
                  id: 1
                  method: getTokenAccounts
                  params:
                    owner: 86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY
                    mint: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                    options:
                      showZeroBalance: true
      responses:
        '200':
          description: Successfully retrieved token accounts.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        description: The JSON-RPC protocol version.
                        example: '2.0'
                        enum:
                          - '2.0'
                  id:
                    allOf:
                      - type: string
                        description: Identifier matching the request.
                        example: '1'
                  result:
                    allOf:
                      - type: object
                        description: A page of token accounts.
                        properties:
                          total:
                            type: integer
                            description: Number of token accounts on this page.
                            example: 2
                          limit:
                            type: integer
                            description: Page size used.
                            example: 100
                          page:
                            type: integer
                            description: Echoed when paging by `page`.
                          cursor:
                            type:
                              - string
                              - 'null'
                            description: >-
                              Address of the last token account when paging by
                              cursor (no `page`, `before` or `after`); otherwise
                              `null`.
                          token_accounts:
                            type: array
                            description: Token accounts.
                            items:
                              type: object
                              description: A token account.
                              properties:
                                address:
                                  type: string
                                  description: Token account address.
                                mint:
                                  type: string
                                  description: Mint.
                                amount:
                                  type: integer
                                  description: Raw balance in base units.
                                owner:
                                  type: string
                                  description: Owner wallet.
                                frozen:
                                  type: boolean
                                  description: Whether the account is frozen.
                                delegate:
                                  type:
                                    - string
                                    - 'null'
                                  description: Delegate address, or `null`.
                                delegated_amount:
                                  type: integer
                                  description: Amount the delegate may transfer.
                                close_authority:
                                  type: 'null'
                                  description: Always `null`.
                                extensions:
                                  type: 'null'
                                  description: Always `null`.
                          errors:
                            type: array
                            description: Always empty.
                            example: []
                          last_indexed_slot:
                            type: integer
                            description: The latest slot included in the results.
                            example: 386120417
              examples:
                example:
                  summary: Successful response
                  value:
                    jsonrpc: '2.0'
                    id: 1
                    result:
                      total: 2
                      limit: 100
                      token_accounts:
                        - address: AUH6c4QLMr2qQr9N5Kkpz5astDM9gBNroXCSxQiFTGQv
                          mint: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                          amount: 2500000
                          owner: 86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY
                          frozen: false
                          delegate: null
                          delegated_amount: 0
                          close_authority: null
                          extensions: null
                        - address: DYougPS3ao5Ticdy5bFcKKcXgSjHVJ2yuwaMgxHpPoQr
                          mint: So11111111111111111111111111111111111111112
                          amount: 120000000
                          owner: 86xCnPeV69n6t3DnyGvkKobf9FdN2H9oiVDdaMpo2MMY
                          frozen: false
                          delegate: null
                          delegated_amount: 0
                          close_authority: null
                          extensions: null
                      cursor: DYougPS3ao5Ticdy5bFcKKcXgSjHVJ2yuwaMgxHpPoQr
                      errors: []
                      last_indexed_slot: 386120417
        '400':
          description: Bad Request - Invalid request parameters or malformed request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    allOf:
                      - type: string
                        description: The JSON-RPC protocol version.
                        example: '2.0'
                        enum:
                          - '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
                        description: The JSON-RPC protocol version.
                        example: '2.0'
                        enum:
                          - '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
                        description: The JSON-RPC protocol version.
                        example: '2.0'
                        enum:
                          - '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
                        description: The JSON-RPC protocol version.
                        example: '2.0'
                        enum:
                          - '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
                        description: The JSON-RPC protocol version.
                        example: '2.0'
                        enum:
                          - '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
                        description: The JSON-RPC protocol version.
                        example: '2.0'
                        enum:
                          - '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.