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

# getTokenAccounts DAS Method

> List SPL Token and Token-2022 accounts by owner, by mint, or both, sorted by address with cursor or page pagination. getTokenAccounts parameters and examples.

Covers SPL Token and Token-2022 accounts, sorted by token account address. Also accepted as `get_token_accounts`.

* Send `owner`, `mint` or both. `ownerAddress` and `mintAddress` are accepted as aliases.
* Empty token accounts are hidden unless `options.showZeroBalance` is `true`.
* `amount` is the raw balance in base units.
* `limit` defaults to 1000 and may not exceed 1000.
* With no `page`, `before` or `after`, the response `cursor` is the last account's address. Send it back as `cursor` for the next page; stop when `token_accounts` is empty.
* A query that matches more than 200,000 token accounts returns an error, so `mint` alone does not work for widely held tokens. Add `owner`, or use [getTokenLargestAccounts](https://docs.solanatracker.io/solana-rpc/http/gettokenlargestaccounts.md).
* Costs 1 credit and counts against your plan's DAS RPS limit.

Request setup and error handling: [RPC quickstart](https://docs.solanatracker.io/solana-rpc/quickstart.md). Billing: [credits and limits](https://docs.solanatracker.io/solana-rpc/credits-and-rate-limits.md).

All DAS methods: [DAS API overview](https://docs.solanatracker.io/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.