# Overview

## Endpoints

Learn more about the different endpoints of Swap V2 API:

* [GET /rfq/pool/v2/{CHAIN\_ID}](https://docs.clipper.exchange/disclaimers-and-technical/integrating-with-clipper-rfq/api-reference/api-v2/pool-v2) - Get information about a blockchain network supported by clipper.
* [GET /rfq/quote/v2/{CHAIN\_ID} ](https://docs.clipper.exchange/disclaimers-and-technical/integrating-with-clipper-rfq/api-reference/api-v2/quote-v2)- Generate potential asset swap quotes. Obtain pricing and essential details for informed decision-making **:**

**New Domain**

`https://blade-api.sushi.com`<br>

### Authorization

In order to prevent abuse on the API we implement rate limits on the requests, to overcome these limits as an aggregator get in contact with the support team to get API credentials (user and password) [here](mailto:aggregators@shipyardsoftware.org).

{% hint style="warning" %}
For API v2 the api key auth is required.
{% endhint %}

The API uses the API KEY authentication method. You have to include the credentials in the header <mark style="color:orange;">`x-api-key`</mark>.

Example: If your api key is <mark style="color:orange;">TzuiYrpRgN2</mark>

```bash
curl --location 'https://blade-api.sushi.com/rfq/v2/pool/1?fieldset=offchain-data&pool_address=0x655eDCE464CC797526600a462A8154650EEe4B77' \
--header 'x-api-key: TzuiYrpRgN2' \
--data ''
```

### Errors

#### Common Error Codes

<table><thead><tr><th width="118">Code</th><th>Reason</th></tr></thead><tbody><tr><td>400</td><td>Bad Request - Invalid data in the request</td></tr><tr><td>401</td><td>Unauthorized</td></tr><tr><td>403</td><td>Forbidden Error</td></tr><tr><td>500</td><td>Internal Server Error</td></tr><tr><td>503</td><td>External Service Error</td></tr></tbody></table>

#### Error Format

```json
{
    "errorMessage": "Description of the error",
    "errorType": "Type of the error",
    "errorCode": 422,  // it is returned only when we have a clipper code for the error
    "data": []  // is is returned only when the input data is invalid
}
```

{% hint style="warning" %} <mark style="color:orange;">`error_code`</mark> and <mark style="color:orange;">`data`</mark> are not always present
{% endhint %}

*Examples*&#x20;

1. If we make a request to [quote](https://docs.clipper.exchange/disclaimers-and-technical/integrating-with-clipper-rfq/api-reference/api-v2/quote-v2) endpoint and the body does not have the field <mark style="color:orange;">`chain_id`</mark> (required param), the API response will look like similar to this:

```json
{
    "errorMessage": "Invalid input data",
    "errorType": "BadData",
    "errorCode": 422,
    "data": [
        {
            "type": "missing",
            "loc": [
                "chain_id"
            ],
            "msg": "Field required",
            "input": {
                "input_amount": "18000",
                "input_asset_symbol": "ETH",
                "output_asset_symbol": "WBTC",
                "time_in_seconds": 60
            },
            "url": "https://errors.pydantic.dev/2.1/v/missing"
        }
    ]
}
```

2. If we make a request to [quote](https://docs.clipper.exchange/disclaimers-and-technical/integrating-with-clipper-rfq/api-reference/api-v2/quote-v2) endpoint and we send an <mark style="color:orange;">`input_asset_symbol`</mark> that clipper does not support, the API response will look like similar to this

```json
{
    "errorMessage": "input_asset_symbol: INVALIDASSET is not supported",
    "errorType": "BadData"
}
```

3. If we make a request to [quote](https://docs.clipper.exchange/disclaimers-and-technical/integrating-with-clipper-rfq/api-reference/api-v1/quote) endpoint and we send invalid credentials

```json
{
    "errorMessage": "Auth: Access is forbidden",
    "errorType": "Forbidden"
}
```

#### Clipper Error Codes

These codes appear in the field <mark style="color:orange;">`errorCode`</mark>

<table><thead><tr><th width="112">Code</th><th>Reason</th></tr></thead><tbody><tr><td>422</td><td>Invalid input data</td></tr><tr><td>409</td><td>Quote problems</td></tr></tbody></table>
