> For the complete documentation index, see [llms.txt](https://learn.layerswap.io/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.layerswap.io/api/api-integration/deprecated-v1-api-reference/get-available-routes.md).

# Get Available Routes

Before creating a swap, it's possible to programmatically retrieve all possible supported routes. The endpoint is public and does not require any authorization.

<mark style="color:blue;">`GET`</mark> `https://api.layerswap.io/api/available_networks`

#### Query Parameters

| Name             | Type   | Description                                                                                                                                                                      |
| ---------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| version          | String | Possible values “sandbox” \| any. If a sandbox value is provided, only the Testnet networks will be returned. For any other values - only the Mainnet networks will be returned. |
| sourceAsset      | String | The currency name to be filtered. Example: USDT.                                                                                                                                 |
| destination      | String | The supported blockchain network name to be filtered. [See available values.](/api/api-integration/deprecated-v1-api-reference/get-available-networks.md)                        |
| source           | String | The supported blockchain network name to be filtered. [See available values.](/api/api-integration/deprecated-v1-api-reference/get-available-networks.md)                        |
| destinationAsset | String | The currency name to be filtered. Example: USDT.                                                                                                                                 |

{% tabs %}
{% tab title="200: OK Arrays of possible routes" %}

```json
{
  "data": [
    {
      "source": "STARKNET_MAINNET",
      "source_asset": "USDC",
      "destination": "OPTIMISM_MAINNET",
      "destination_asset": "USDC"
    },
    {
      "source": "STARKNET_MAINNET",
      "source_asset": "ETH",
      "destination": "OPTIMISM_MAINNET",
      "destination_asset": "ETH"
    }
  ],
  "error": null
}
```

{% endtab %}
{% endtabs %}

### Raw request

```bash
curl -X 'GET' \
  'https://api.layerswap.io/api/available_routes'
```

### Raw response

```json
{
  "data": [
    {
      "source": "STARKNET_MAINNET",
      "source_asset": "USDC",
      "destination": "OPTIMISM_MAINNET",
      "destination_asset": "USDC"
    },
    {
      "source": "STARKNET_MAINNET",
      "source_asset": "ETH",
      "destination": "OPTIMISM_MAINNET",
      "destination_asset": "ETH"
    }
  ],
  "error": null
}

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://learn.layerswap.io/api/api-integration/deprecated-v1-api-reference/get-available-routes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
