# Swagger API

{% hint style="danger" %}
Datasets providing access to the SDK have not been updated for a long time. Please note that the SDK may not function properly until the completion of the V3 upgrade!
{% endhint %}

## Hera Dex Aggregator - Swap Protocol API

### Metis Mainnet Release

Using Hera Aggregation protocol API, you can find the best route to exchange assets and make the exchange.\
\
Progressing:

1. Lookup addresses of tokens you want to swap, for example ‘0xxx’ , ‘0xxxx’ for USDC -> METIS
2. Check for allowance and if necessary give approval for HeraAggregatorV2 contract to spend token (/allowance)
3. Monitor the best exchange route using (/quote)
4. When you ready use to perform swap (/swap)

{% hint style="info" %}
**EmporiaSDK is now available on Metis Mainnet.** Other chains are coming soon!
{% endhint %}

<details>

<summary><strong>Built with OpenAPI &#x26; Swagger!</strong></summary>

Design, describe, and document your API on the first open source editor supporting multiple API specifications and serialization formats. The Swagger Editor offers an easy way to get started with the OpenAPI Specification (formerly known as Swagger) as well as the AsyncAPI specification, with support for Swagger 2.0, OpenAPI 3.0, and AsyncAPI 2.\* versions.

</details>

### Swagger Paths:

#### Allowance&#x20;

{% openapi src="/files/lqZFMH1uPGH5AyXvwled" path="/allowance" method="get" expanded="true" %}
[EmporiaSDK-Metis-v1-1.json](https://468680357-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRPd6E8y8uIj9QOgICwhl%2Fuploads%2F1Ez7x7M8GFPcrisX6sA8%2FEmporiaSDK-Metis-v1-1.json?alt=media\&token=d6b75e97-c3ed-4b3a-b311-8722b3bdc9c0)
{% endopenapi %}

{% code overflow="wrap" %}

```
// Example Query:

GET https://pathfindersdk.hera.finance/allowance?account=0x0000000000000000000000000000000000000000&amount=1000000&tokenInAddress=0xEA32A96608495e54156Ae48931A7c20f0dcc1a21
```

{% endcode %}

#### Quote (Pathfinder)

{% openapi src="/files/lqZFMH1uPGH5AyXvwled" path="/quote" method="get" expanded="true" %}
[EmporiaSDK-Metis-v1-1.json](https://468680357-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRPd6E8y8uIj9QOgICwhl%2Fuploads%2F1Ez7x7M8GFPcrisX6sA8%2FEmporiaSDK-Metis-v1-1.json?alt=media\&token=d6b75e97-c3ed-4b3a-b311-8722b3bdc9c0)
{% endopenapi %}

{% code overflow="wrap" %}

```
// Example Query:

GET https://pathfindersdk.hera.finance/quote?account=0x0000000000000000000000000000000000000000&tokenInAddress=0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000&tokenInChainId=1088&tokenOutAddress=0xEA32A96608495e54156Ae48931A7c20f0dcc1a21&tokenOutChainId=1088&amount=100000000000000000000&type=exactIn
```

{% endcode %}

#### Swap

{% openapi src="/files/lqZFMH1uPGH5AyXvwled" path="/swap" method="get" expanded="true" %}
[EmporiaSDK-Metis-v1-1.json](https://468680357-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRPd6E8y8uIj9QOgICwhl%2Fuploads%2F1Ez7x7M8GFPcrisX6sA8%2FEmporiaSDK-Metis-v1-1.json?alt=media\&token=d6b75e97-c3ed-4b3a-b311-8722b3bdc9c0)
{% endopenapi %}

{% code overflow="wrap" %}

```
// Example Query:

GET https://pathfindersdk.hera.finance/swap?account=0x0000000000000000000000000000000000000000&tokenInAddress=0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000&tokenInChainId=1088&tokenOutAddress=0xEA32A96608495e54156Ae48931A7c20f0dcc1a21&tokenOutChainId=1088&amount=100000000000000000000
```

{% endcode %}


---

# 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://docs.hera.finance/developers/emporia-sdk/swagger-api.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.
