> ## Documentation Index
> Fetch the complete documentation index at: https://docs.swaps.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Token List

> Retrieve the list of supported tokens for a given chain, or for all supported chains if no chainId is specified.



## OpenAPI

````yaml /swap-api-reference/openapi.json get /getTokenList
openapi: 3.1.0
info:
  title: Swaps API
  description: >-
    The Swaps API provides instant cross-chain swap and bridge functionality for
    decentralized applications.

    It supports multiple virtual machines (EVM, Solana, Bitcoin) and various DEX
    protocols and bridge solutions.
  version: 3.0.0
  contact:
    name: Swaps.xyz
    url: https://swaps.xyz
servers:
  - url: https://api-v2.swaps.xyz/api
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /getTokenList:
    get:
      summary: Get Token List
      description: >-
        Retrieve the list of supported tokens for a given chain, or for all
        supported chains if no chainId is specified.
      operationId: getTokenList
      parameters:
        - name: chainId
          in: query
          required: false
          description: >-
            Chain ID to retrieve tokens for. If omitted, returns token lists for
            all supported chains, keyed by chain ID.
          schema:
            $ref: '#/components/schemas/ChainId'
      responses:
        '200':
          description: Token list response
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/TokenListResponse'
                  - $ref: '#/components/schemas/TokenListByChainResponse'
        '400':
          description: Bad request due to an unsupported chainId
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      servers:
        - url: https://api-v2.swaps.xyz/api
          description: Core Swap API server
components:
  schemas:
    ChainId:
      type: integer
      description: Chain ID. Find in the list of supported networks.
    TokenListResponse:
      type: object
      required:
        - tokens
      properties:
        tokens:
          type: array
          description: >-
            List of tokens for the requested chain, with the native token listed
            first
          items:
            $ref: '#/components/schemas/TokenListItem'
    TokenListByChainResponse:
      type: object
      description: >-
        Map of chain ID (as a string) to that chain's token list, returned when
        no chainId query parameter is provided
      additionalProperties:
        $ref: '#/components/schemas/TokenListResponse'
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          description: Always false for error responses
          enum:
            - false
          example: false
        error:
          type: object
          required:
            - code
            - name
            - message
            - title
            - statusCode
            - timestamp
          properties:
            code:
              type: string
              description: Error type code for programmatic handling
            name:
              type: string
              description: Error class name
            message:
              type: string
              description: Detailed error message
            title:
              type: string
              description: Short, user-friendly error title
            statusCode:
              type: integer
              description: HTTP status code
            details:
              type: object
              description: Additional error details
              additionalProperties: true
            timestamp:
              type: string
              description: ISO 8601 timestamp when the error occurred
    TokenListItem:
      type: object
      required:
        - chainId
        - address
        - name
        - symbol
        - decimals
        - isNative
      properties:
        chainId:
          $ref: '#/components/schemas/ChainId'
          description: Chain ID for the token
        address:
          $ref: '#/components/schemas/Address'
          description: Token address
        name:
          type: string
          description: Token name
        symbol:
          type: string
          description: Token symbol
        decimals:
          type: integer
          description: Token decimals
        isNative:
          type: boolean
          description: Boolean flag for whether token is the chain's gas token.
        logo:
          type:
            - string
            - 'null'
          description: URL to the token's logo image. Can be null if logo is not available.
    Address:
      type: string
      description: >-
        Address type - can be EvmAddress, HyperCoreAddress, SolanaAddress, or
        AltVmAddress.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Limited demo key for API Reference: `5c951bc81da566bbd030ba8e20724063`.'

````