> For the complete documentation index, see [llms.txt](https://docs-swap.crypto-chief.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-swap.crypto-chief.com/api-reference/tokens.md).

# Tokens

## Tokens

The tokens of a network: their addresses, symbols, decimals and flags. By default only the network's configured list; `include_unverified: true` adds the tokens learned from callers' requests.

#### **Tokens**

<mark style="color:green;">`POST`</mark> `https://swap-api.crypto-chief.com/YOUR_API_KEY/v1/tokens`

**Headers**

| Name         | Value                                                                                                           |
| ------------ | --------------------------------------------------------------------------------------------------------------- |
| Content-Type | `application/json`                                                                                              |
| X-Request-Id | Optional — your id for this call, echoed in the response ([Authentication](/getting-started/authentication.md)) |

**Body**

| Name                 | Type    | Required | Description                                                        |
| -------------------- | ------- | -------- | ------------------------------------------------------------------ |
| `network`            | string  | true     | Network code, case-insensitive                                     |
| `include_unverified` | boolean | false    | Also list tokens learned from requests by address. Default `false` |

```json
{
  "network": "ETH_MAINNET"
}
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "tokens": [
    {"address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", "symbol": "ETH", "decimals": 18, "kind": "native"},
    {"address": "0xdAC17F958D2ee523a2206206994597C13D831ec7", "symbol": "USDT", "decimals": 6, "kind": "token", "flags": ["pausable", "blacklist", "approve_reset_required"]}
  ]
}
```

{% endtab %}
{% endtabs %}

**Fields**

| Field      | Description                                                                                                                                                                                                                              |
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `address`  | What you pass in `token_in` / `token_out`. On XRP Ledger: the `CUR.rIssuer` form                                                                                                                                                         |
| `symbol`   | The ticker                                                                                                                                                                                                                               |
| `decimals` | The decimals behind the base units of `amount_in` and friends                                                                                                                                                                            |
| `kind`     | `native` or `token`                                                                                                                                                                                                                      |
| `flags`    | Present when any apply, for example `pausable`, `approve_reset_required`, `unverified`. Solana and XRP Ledger tokens carry more; treat an unknown flag as informational. [The list](/getting-started/networks-and-tokens.md#token-flags) |

{% hint style="warning" %}
Tokens listed only with `include_unverified: true` always carry the `unverified` flag; their symbol is read from the contract. A route through an unverified token works, but it carries the `token_flags` risk factor — check the [quote's `risk`](/api-reference/quote.md#risk-factors) before building it.
{% endhint %}

### Example

`swap()` is defined in [Authentication](/getting-started/authentication.md).

{% tabs %}
{% tab title="JavaScript" %}

```javascript
const { tokens } = await swap("tokens", { network: "ETH_MAINNET" });
for (const t of tokens) console.log(t.symbol, t.address, t.decimals);
```

{% endtab %}

{% tab title="PHP" %}

```php
$out = swap('tokens', ['network' => 'ETH_MAINNET']);
foreach ($out['tokens'] as $t) echo $t['symbol'], ' ', $t['address'], ' ', $t['decimals'], "\n";
```

{% endtab %}

{% tab title="GO" %}

```go
out, _, err := swap("tokens", map[string]any{"network": "ETH_MAINNET"})
if err != nil {
	log.Fatal(err)
}
for _, t := range out["tokens"].([]any) {
	t := t.(map[string]any)
	fmt.Println(t["symbol"], t["address"], t["decimals"])
}
```

{% endtab %}

{% tab title="Python" %}

```python
out = swap("tokens", {"network": "ETH_MAINNET"})
for t in out["tokens"]:
    print(t["symbol"], t["address"], t["decimals"])
```

{% endtab %}

{% tab title="curl" %}

```bash
curl -s -X POST "https://swap-api.crypto-chief.com/$CC_API_KEY/v1/tokens" \
  -H "Content-Type: application/json" \
  -d '{"network":"ETH_MAINNET"}'
```

{% endtab %}
{% endtabs %}
