> For the complete documentation index, see [llms.txt](https://docs.swapper.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.swapper.finance/api-v1/endpoints/chains-and-tokens.md).

# Chains & Tokens

The catalog endpoints list what [`/v1/quote`](https://docs.swapper.finance/api-v1/endpoints/quote.md) can route: the supported chains, and the tokens on each. They need no `integrator` and no API key (send your key anyway from servers, to use your key's [rate limits](https://docs.swapper.finance/api-v1/rate-limits.md)).

Chains and tokens change rarely — cache the responses for a few minutes rather than fetching them per request.

## List chains

```
GET /v1/chains
```

Every chain `/v1/quote` can route from or to.

### Parameters

| Name         | Required | Description                                                                                                                          |
| ------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `ecosystems` | no       | Comma-separated ecosystems to return, case-insensitive: `evm`, `solana`. An unknown value is rejected with `400` `VALIDATION_ERROR`. |

### Response

```json
{
  "chains": [
    {
      "id": "8453",
      "key": "base",
      "ecosystem": "evm",
      "name": "Base",
      "coin": "ETH",
      "mainnet": true,
      "logoURI": "https://deposit.swapper.finance/assets/chains/base.webp",
      "nativeToken": {
        "address": "0x0000000000000000000000000000000000000000",
        "chainId": "8453",
        "symbol": "ETH",
        "decimals": 18,
        "name": "Ether",
        "logoURI": "https://deposit.swapper.finance/assets/tokens/eth.webp",
        "priceUSD": "2500.12"
      }
    }
  ]
}
```

| Field         | Type                       | Description                                                                                                                                      |
| ------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `id`          | string                     | Swapper's chain id, the same id the deposit widget uses: e.g. `"8453"` (Base), `"42161"` (Arbitrum), `"mainnet-beta"` (Solana). Always a string. |
| `key`         | string                     | Lowercase chain key (e.g. `base`, `arbitrum`, `solana`). Anywhere a chain is expected, you can pass the `id` or the `key`.                       |
| `ecosystem`   | string                     | `evm` or `solana`.                                                                                                                               |
| `name`        | string                     | Display name.                                                                                                                                    |
| `coin`        | string                     | Native token symbol.                                                                                                                             |
| `mainnet`     | boolean                    | Whether the chain is a mainnet.                                                                                                                  |
| `logoURI`     | string                     | Chain logo.                                                                                                                                      |
| `nativeToken` | [Token](#the-token-object) | The chain's native token.                                                                                                                        |

## List tokens

```
GET /v1/tokens
```

The tokens that can be quoted, grouped by chain.

### Parameters

| Name             | Required | Description                                                                                                                                                                                                      |
| ---------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `chains`         | no       | Comma-separated chain ids or keys, at most 50 (e.g. `8453,arbitrum`). Defaults to every supported chain.                                                                                                         |
| `ecosystems`     | no       | Comma-separated ecosystems (`evm`, `solana`), case-insensitive. Ignored when `chains` is given.                                                                                                                  |
| `depositAddress` | no       | `true`: only the tokens that can fund a [deposit address](https://docs.swapper.finance/api-v1/endpoints/deposit-addresses.md#which-tokens-can-be-deposited), on the chains that accept any. Defaults to `false`. |

### Response

`tokens` maps each chain id (as a string) to its tokens:

```json
{
  "tokens": {
    "8453": [
      {
        "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "chainId": "8453",
        "symbol": "USDC",
        "decimals": 6,
        "name": "USD Coin",
        "logoURI": "https://deposit.swapper.finance/assets/tokens/usdc.webp",
        "priceUSD": "0.9998"
      }
    ]
  }
}
```

## Get one token

```
GET /v1/token
```

Look up a single token by address or symbol.

### Parameters

| Name    | Required | Description                                                   |
| ------- | -------- | ------------------------------------------------------------- |
| `chain` | yes      | Chain id or key.                                              |
| `token` | yes      | Token address (any case on EVM) or symbol (case-insensitive). |

### Response

A single [Token](#the-token-object). A token the chain doesn't list returns `404` with the code `UNSUPPORTED_TOKEN`:

```json
{
  "error": {
    "code": "UNSUPPORTED_TOKEN",
    "message": "Token NOPE is not supported on chain 8453",
    "requestId": "0b6c1f0e-5f7e-4b7a-9f39-1a3c2f0d2c11"
  }
}
```

## The token object

| Field      | Type    | Description                                                                                                                                 |
| ---------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `address`  | string  | Token address. Native tokens: `0x0000000000000000000000000000000000000000` on EVM, `So11111111111111111111111111111111111111111` on Solana. |
| `chainId`  | string  | Swapper chain id, e.g. `"8453"`.                                                                                                            |
| `symbol`   | string  | Token symbol.                                                                                                                               |
| `decimals` | integer | Decimals — amounts are integers in units of `10^-decimals`.                                                                                 |
| `name`     | string  | Token name.                                                                                                                                 |
| `logoURI`  | string  | Token logo; empty when unknown.                                                                                                             |
| `priceUSD` | string  | USD price as a decimal string; `"0"` when unknown.                                                                                          |

## Errors

| Status | Code                | When                                                                   |
| ------ | ------------------- | ---------------------------------------------------------------------- |
| `400`  | `VALIDATION_ERROR`  | A parameter is malformed (e.g. an unknown ecosystem).                  |
| `400`  | `UNSUPPORTED_CHAIN` | A chain in `chains` or `chain` isn't served by v1.                     |
| `404`  | `UNSUPPORTED_TOKEN` | `/v1/token`: the chain doesn't list the token.                         |
| `401`  | `INVALID_API_KEY`   | An unknown or revoked API key was sent.                                |
| `429`  | `RATE_LIMITED`      | See [Rate Limits](https://docs.swapper.finance/api-v1/rate-limits.md). |

See [Errors](https://docs.swapper.finance/api-v1/errors.md) for the envelope and all codes.
