> 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-swap-rate.md).

# Get Swap Rate

Before creating a swap, it's possible to programmatically retrieve data about the valid minimum/maximum swap amount and the Layerswap fee. The endpoint is public and does not require any authorization.

<mark style="color:green;">`POST`</mark> `https://api.layerswap.io/api/swap_rate`

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                            | Type   | Description                                                                                                                                |
| ----------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
| source<mark style="color:red;">\*</mark>        | String | The supported blockchain network name. [See available values.](/api/api-integration/deprecated-v1-api-reference/get-available-networks.md) |
| destination<mark style="color:red;">\*</mark>   | String | The supported blockchain network/CEX/fiat provider name. [See available values.](/api/data/supported-platforms/supported-networks.md)      |
| source\_asset<mark style="color:red;">\*</mark> | String | The currency name. Example: USDC                                                                                                           |
| refuel<mark style="color:red;">\*</mark>        | String | If set to true, the user will receive an additional refuel transaction in the native currency for the swap.                                |
| destination\_asset                              | String | The currency name. Example: USDC                                                                                                           |

{% tabs %}
{% tab title="200: OK Swap Rate object" %}

```json
{
  "data": [
    {
      "min_amount": 0.001431,
      "fee_amount": 0.0006,
      "max_amount": 0.1
    }
  ],
  "error": null
}

```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
A detailed explanation of the Swap Rate Object is [available here](/api/data/object-types.md#swap-rate-object).
{% endhint %}

### Raw request

```bash
curl -X 'POST' \
  'https://api.layerswap.io/api/swap_rate' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "source": "ETHEREUM_MAINNET",
  "destination": "ARBITRUM_MAINNET",
  "source_asset": "USDC",
  "destination_asset": "USDC",
  "refuel": true
}'
```

### Raw Response

```json
{
  "data": [
    {
      "min_amount": 0.001431,
      "fee_amount": 0.0006,
      "max_amount": 0.1
    }
  ],
  "error": null
}

```
