Get swap and bridge quotes
curl --request GET \
--url https://api.zerion.io/v1/swap/quotes/ \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.zerion.io/v1/swap/quotes/"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.zerion.io/v1/swap/quotes/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.zerion.io/v1/swap/quotes/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"links": {
"self": "https://api.zerion.io/v1/wallet/0x42b9df65b219b3dd36ff330a4dd8f327a6ada990/swap-list"
},
"data": [
{
"type": "swap_quotes",
"id": "589a0095e2111df5276ebf073fff9a8bfb821f34",
"attributes": {
"liquidity_source": {
"id": "relay",
"name": "Relay",
"icon": {
"url": "https://token-icons.s3.amazonaws.com/0x0391d2021f89dc339f60fff84546ea23e337750f.png"
}
},
"input_amount": {
"quantity": "0.001",
"value": 2.2830463441233997,
"usd_value": 2.2830463441233997,
"currency": "USD"
},
"output_amount": {
"quantity": "0.001",
"value": 2.2830463441233997,
"usd_value": 2.2830463441233997,
"currency": "USD"
},
"minimum_output_amount": {
"quantity": "0.001",
"value": 2.2830463441233997,
"usd_value": 2.2830463441233997,
"currency": "USD"
},
"output_amount_after_fees": {
"quantity": "0.001",
"value": 2.2830463441233997,
"usd_value": 2.2830463441233997,
"currency": "USD"
},
"slippage_percent": 2,
"rate": [
{
"value": 1,
"symbol": "WETH"
}
],
"protocol_fee": {
"amount": {
"quantity": "0.001",
"value": 2.2830463441233997,
"usd_value": 2.2830463441233997,
"currency": "USD"
},
"base_percentage": 0.67,
"percentage": 0,
"included_in_rate": false,
"fungible": {
"type": "fungibles",
"id": "eth"
}
},
"bridge_fee": {
"amount": {
"quantity": "0.001",
"value": 2.2830463441233997,
"usd_value": 2.2830463441233997,
"currency": "USD"
},
"included_in_rate": true,
"fungible": {
"type": "fungibles",
"id": "eth"
}
},
"network_fee": {
"amount": {
"quantity": "0.001",
"value": 2.2830463441233997,
"usd_value": 2.2830463441233997,
"currency": "USD"
},
"free": true,
"fungible": {
"type": "fungibles",
"id": "eth"
}
},
"transaction_approve": {
"evm": {
"type": "0x2",
"from": "0xbf9db3564c22fd22ff30a8db7f689d654bf5f1fd",
"to": "0xb2be281e8b11b47fec825973fc8bb95332022a54",
"nonce": "0x42",
"chain_id": "0x1",
"gas": "0x1c138",
"value": "0x0",
"data": "0xa9059cbb000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa9604500000000000000000000000000000000000000000000000000000000000003e8",
"gas_price": "0x9502f900",
"max_fee": "0xc6a17141",
"max_priority_fee": "0x35aeb151",
"custom_data": {
"paymaster_params": {
"paymaster": "<string>",
"paymaster_input": "<string>"
},
"gas_per_pubdata_byte": "<string>"
}
},
"solana": {
"raw": "<string>"
}
},
"transaction_swap": {
"evm": {
"type": "0x2",
"from": "0xbf9db3564c22fd22ff30a8db7f689d654bf5f1fd",
"to": "0xb2be281e8b11b47fec825973fc8bb95332022a54",
"nonce": "0x42",
"chain_id": "0x1",
"gas": "0x1c138",
"value": "0x0",
"data": "0xa9059cbb000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa9604500000000000000000000000000000000000000000000000000000000000003e8",
"gas_price": "0x9502f900",
"max_fee": "0xc6a17141",
"max_priority_fee": "0x35aeb151",
"custom_data": {
"paymaster_params": {
"paymaster": "<string>",
"paymaster_input": "<string>"
},
"gas_per_pubdata_byte": "<string>"
}
},
"solana": {
"raw": "<string>"
}
},
"error": {
"code": "not_enough_input_asset_balance",
"hint": "topup",
"message": "Input asset balance is not enough to execute a swap"
},
"estimated_time_seconds": 2
},
"relationships": {
"input_chain": {
"links": {
"related": "https://api.zerion.io/v1/chains/polygon"
},
"data": {
"type": "chains",
"id": "polygon"
}
},
"output_chain": {
"links": {
"related": "https://api.zerion.io/v1/chains/polygon"
},
"data": {
"type": "chains",
"id": "polygon"
}
},
"input_fungible": {
"links": {
"related": "https://api.zerion.io/v1/fungibles/eth"
},
"data": {
"type": "fungibles",
"id": "eth"
}
},
"output_fungible": {
"links": {
"related": "https://api.zerion.io/v1/fungibles/eth"
},
"data": {
"type": "fungibles",
"id": "eth"
}
}
}
}
]
}{
"errors": [
{
"title": "Parameter is malformed",
"detail": "Some validation errors will be described here"
}
]
}{
"errors": [
{
"title": "Unauthorized Error",
"detail": "The API key is invalid, please, make sure that you are using a valid key"
}
]
}{
"errors": [
{
"title": "Too many requests",
"detail": "Your request had been throttled"
}
]
}swap
Get swap and bridge quotes
Compare same-chain swap and cross-chain bridge quotes from multiple DEXs, aggregators and bridges, best first.
GET
/
v1
/
swap
/
quotes
/
Get swap and bridge quotes
curl --request GET \
--url https://api.zerion.io/v1/swap/quotes/ \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.zerion.io/v1/swap/quotes/"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.zerion.io/v1/swap/quotes/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.zerion.io/v1/swap/quotes/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"links": {
"self": "https://api.zerion.io/v1/wallet/0x42b9df65b219b3dd36ff330a4dd8f327a6ada990/swap-list"
},
"data": [
{
"type": "swap_quotes",
"id": "589a0095e2111df5276ebf073fff9a8bfb821f34",
"attributes": {
"liquidity_source": {
"id": "relay",
"name": "Relay",
"icon": {
"url": "https://token-icons.s3.amazonaws.com/0x0391d2021f89dc339f60fff84546ea23e337750f.png"
}
},
"input_amount": {
"quantity": "0.001",
"value": 2.2830463441233997,
"usd_value": 2.2830463441233997,
"currency": "USD"
},
"output_amount": {
"quantity": "0.001",
"value": 2.2830463441233997,
"usd_value": 2.2830463441233997,
"currency": "USD"
},
"minimum_output_amount": {
"quantity": "0.001",
"value": 2.2830463441233997,
"usd_value": 2.2830463441233997,
"currency": "USD"
},
"output_amount_after_fees": {
"quantity": "0.001",
"value": 2.2830463441233997,
"usd_value": 2.2830463441233997,
"currency": "USD"
},
"slippage_percent": 2,
"rate": [
{
"value": 1,
"symbol": "WETH"
}
],
"protocol_fee": {
"amount": {
"quantity": "0.001",
"value": 2.2830463441233997,
"usd_value": 2.2830463441233997,
"currency": "USD"
},
"base_percentage": 0.67,
"percentage": 0,
"included_in_rate": false,
"fungible": {
"type": "fungibles",
"id": "eth"
}
},
"bridge_fee": {
"amount": {
"quantity": "0.001",
"value": 2.2830463441233997,
"usd_value": 2.2830463441233997,
"currency": "USD"
},
"included_in_rate": true,
"fungible": {
"type": "fungibles",
"id": "eth"
}
},
"network_fee": {
"amount": {
"quantity": "0.001",
"value": 2.2830463441233997,
"usd_value": 2.2830463441233997,
"currency": "USD"
},
"free": true,
"fungible": {
"type": "fungibles",
"id": "eth"
}
},
"transaction_approve": {
"evm": {
"type": "0x2",
"from": "0xbf9db3564c22fd22ff30a8db7f689d654bf5f1fd",
"to": "0xb2be281e8b11b47fec825973fc8bb95332022a54",
"nonce": "0x42",
"chain_id": "0x1",
"gas": "0x1c138",
"value": "0x0",
"data": "0xa9059cbb000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa9604500000000000000000000000000000000000000000000000000000000000003e8",
"gas_price": "0x9502f900",
"max_fee": "0xc6a17141",
"max_priority_fee": "0x35aeb151",
"custom_data": {
"paymaster_params": {
"paymaster": "<string>",
"paymaster_input": "<string>"
},
"gas_per_pubdata_byte": "<string>"
}
},
"solana": {
"raw": "<string>"
}
},
"transaction_swap": {
"evm": {
"type": "0x2",
"from": "0xbf9db3564c22fd22ff30a8db7f689d654bf5f1fd",
"to": "0xb2be281e8b11b47fec825973fc8bb95332022a54",
"nonce": "0x42",
"chain_id": "0x1",
"gas": "0x1c138",
"value": "0x0",
"data": "0xa9059cbb000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa9604500000000000000000000000000000000000000000000000000000000000003e8",
"gas_price": "0x9502f900",
"max_fee": "0xc6a17141",
"max_priority_fee": "0x35aeb151",
"custom_data": {
"paymaster_params": {
"paymaster": "<string>",
"paymaster_input": "<string>"
},
"gas_per_pubdata_byte": "<string>"
}
},
"solana": {
"raw": "<string>"
}
},
"error": {
"code": "not_enough_input_asset_balance",
"hint": "topup",
"message": "Input asset balance is not enough to execute a swap"
},
"estimated_time_seconds": 2
},
"relationships": {
"input_chain": {
"links": {
"related": "https://api.zerion.io/v1/chains/polygon"
},
"data": {
"type": "chains",
"id": "polygon"
}
},
"output_chain": {
"links": {
"related": "https://api.zerion.io/v1/chains/polygon"
},
"data": {
"type": "chains",
"id": "polygon"
}
},
"input_fungible": {
"links": {
"related": "https://api.zerion.io/v1/fungibles/eth"
},
"data": {
"type": "fungibles",
"id": "eth"
}
},
"output_fungible": {
"links": {
"related": "https://api.zerion.io/v1/fungibles/eth"
},
"data": {
"type": "fungibles",
"id": "eth"
}
}
}
}
]
}{
"errors": [
{
"title": "Parameter is malformed",
"detail": "Some validation errors will be described here"
}
]
}{
"errors": [
{
"title": "Unauthorized Error",
"detail": "The API key is invalid, please, make sure that you are using a valid key"
}
]
}{
"errors": [
{
"title": "Too many requests",
"detail": "Your request had been throttled"
}
]
}Authorizations
Query Parameters
Currency in which fiat values of amounts and fees in the response are expressed.
Address of the wallet performing the swap. Must match the chain type of input[chain_id] (EVM hex or Solana base58).
Recipient of the output asset. Must match the chain type of output[chain_id]. For a same-chain swap to the same wallet, set to equal to from.
The asset being sent.
Show child attributes
Show child attributes
The asset being received.
Show child attributes
Show child attributes
Maximum acceptable slippage in percent. When omitted, an auto-slippage value is chosen.
Required range:
x >= 0Was this page helpful?