> 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/networks.md).

# Networks

## Networks

The enabled networks and their live readiness. The full list with chain IDs and native coins is in [Networks and Tokens](/getting-started/networks-and-tokens.md#network-codes); this endpoint is how you read which of them are ready **right now**.

#### **Networks**

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

**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**

An empty object (an empty body is accepted too):

```json
{}
```

**Response**

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

```json
{
  "networks": [
    {"network": "ETH_MAINNET", "family": "EVM", "chain_id": 1, "native_symbol": "ETH", "testnet": false, "ready": true},
    {"network": "XRP_MAINNET", "family": "XRP", "chain_id": 0, "native_symbol": "XRP", "testnet": false, "ready": false, "reason": "validated ledger is 31 s old"}
  ]
}
```

Sorted by network code.
{% endtab %}
{% endtabs %}

**Fields**

| Field           | Description                                                                                                |
| --------------- | ---------------------------------------------------------------------------------------------------------- |
| `network`       | The network code — what you pass in every other call                                                       |
| `family`        | `EVM`, `TRON`, `SOLANA`, `TON` or `XRP`                                                                    |
| `chain_id`      | The EVM chain id; on XRP Ledger, the network id (`0` mainnet, `1` testnet). Absent on TRON, Solana and TON |
| `native_symbol` | The native coin's symbol                                                                                   |
| `testnet`       | `true` on testnets                                                                                         |
| `ready`         | The network is serving quotes and builds                                                                   |
| `reason`        | Why not, when `ready` is `false`                                                                           |

{% hint style="warning" %}
A network that did not start is listed too — with `ready: false` and a `reason` like `failed to start (…)`. Calls naming it answer `503 NETWORK_UNAVAILABLE` (refunded — [Billing](/getting-started/billing.md)). Check readiness here before a batch of builds, not by catching the 503.
{% endhint %}

### Example

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

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

```javascript
const { networks } = await swap("networks", {});
for (const n of networks.filter((n) => n.ready)) {
  console.log(n.network, n.family, n.native_symbol);
}
```

{% endtab %}

{% tab title="PHP" %}

```php
$out = swap('networks', []);
foreach ($out['networks'] as $n) {
    if ($n['ready']) echo $n['network'], ' ', $n['family'], ' ', $n['native_symbol'], "\n";
}
```

{% endtab %}

{% tab title="GO" %}

```go
out, _, err := swap("networks", map[string]any{})
if err != nil {
	log.Fatal(err)
}
for _, n := range out["networks"].([]any) {
	n := n.(map[string]any)
	if n["ready"] == true {
		fmt.Println(n["network"], n["family"], n["native_symbol"])
	}
}
```

{% endtab %}

{% tab title="Python" %}

```python
out = swap("networks", {})
for n in out["networks"]:
    if n["ready"]:
        print(n["network"], n["family"], n["native_symbol"])
```

{% endtab %}

{% tab title="curl" %}

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

{% endtab %}
{% endtabs %}
