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

# Tokens

> Token list and search endpoints

# Tokens API

Query the list of tokens available on Kroko DEX, ranked by trading activity.

## GET /api/v1/tokens2

Returns the token list ranked by trading activity (total transaction count across V2 pairs and V3 pools).

### Parameters

| Parameter | Type     | Required | Description                                        |
| --------- | -------- | -------- | -------------------------------------------------- |
| `limit`   | `number` | No       | Number of tokens to return (1–500, default: `100`) |

### Response

```json theme={null}
{
  "tokens": [
    {
      "address": "0x2c2Ae87Ba178F48637acAe54B87c3924F544a83e",
      "symbol": "WKAS",
      "name": "Wrapped KAS",
      "decimals": 18,
      "logoURI": "https://..."
    },
    {
      "address": "0xB190a6A7fC2873f1Abf145279eD664348d5Ef630",
      "symbol": "HUB",
      "name": "Hub Token",
      "decimals": 18,
      "logoURI": null
    }
  ]
}
```

| Field      | Description                          |
| ---------- | ------------------------------------ |
| `address`  | Token contract address (checksummed) |
| `symbol`   | Token ticker symbol                  |
| `name`     | Full token name                      |
| `decimals` | Number of decimal places             |
| `logoURI`  | Token icon URL (nullable)            |

### Ranking Logic

Tokens are ranked by total `txCount` aggregated across all V2 pairs and V3 pools they participate in. Pinned tokens (with admin-set priority) appear first regardless of activity.

***

## GET /api/v1/tokens2/search

Search tokens by symbol or name. Useful for token selector UIs.

### Parameters

| Parameter | Type     | Required | Description                     |
| --------- | -------- | -------- | ------------------------------- |
| `q`       | `string` | Yes      | Search query (case-insensitive) |
| `limit`   | `number` | No       | Max results (default: `10`)     |

### Response

Same format as `/api/v1/tokens2`. Searches both `symbol` and `name` fields using substring matching.

### Example

```bash theme={null}
# Search for tokens with "SUN" in the name or symbol
curl "https://dex.kasplex.org/api/v1/tokens2/search?q=SUN&limit=10"
```

```json theme={null}
{
  "tokens": [
    {
      "address": "0x1234...",
      "symbol": "SUN",
      "name": "Sun Token",
      "decimals": 18,
      "logoURI": "https://..."
    }
  ]
}
```

***

## Token Address Discovery

If you have a token contract address but it's not in the API:

1. **Search by address** is not currently supported via the API
2. **Read on-chain**: Call `symbol()`, `name()`, and `decimals()` on the ERC-20 contract directly
3. **Import**: Contact the team to have the token added to the official list
