# 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
}

```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.layerswap.io/api/api-integration/deprecated-v1-api-reference/get-swap-rate.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
