curl --request GET \
--url https://api-v2.swaps.xyz/api/getQuote \
--header 'x-api-key: <api-key>'import requests
url = "https://api-v2.swaps.xyz/api/getQuote"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api-v2.swaps.xyz/api/getQuote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-v2.swaps.xyz/api/getQuote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-v2.swaps.xyz/api/getQuote"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-v2.swaps.xyz/api/getQuote")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.swaps.xyz/api/getQuote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"vmId": "evm",
"amountIn": {
"chainId": 123,
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"isNative": true,
"amount": "<string>",
"logo": "<string>",
"swapsXyzCode": "<string>",
"usdAmount": 123
},
"amountInMax": {
"chainId": 123,
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"isNative": true,
"amount": "<string>",
"logo": "<string>",
"swapsXyzCode": "<string>",
"usdAmount": 123
},
"amountOut": {
"chainId": 123,
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"isNative": true,
"amount": "<string>",
"logo": "<string>",
"swapsXyzCode": "<string>",
"usdAmount": 123
},
"amountOutMin": {
"chainId": 123,
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"isNative": true,
"amount": "<string>",
"logo": "<string>",
"swapsXyzCode": "<string>",
"usdAmount": 123
},
"protocolFee": {
"chainId": 123,
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"isNative": true,
"amount": "<string>",
"logo": "<string>",
"swapsXyzCode": "<string>",
"usdAmount": 123
},
"applicationFee": {
"chainId": 123,
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"isNative": true,
"amount": "<string>",
"logo": "<string>",
"swapsXyzCode": "<string>",
"usdAmount": 123
},
"exchangeRate": 123,
"estimatedTxTime": 123,
"estimatedPriceImpact": 123,
"requiresTokenApproval": true,
"requiresRegisterTransaction": true,
"bridgeFee": {
"chainId": 123,
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"isNative": true,
"amount": "<string>",
"logo": "<string>",
"swapsXyzCode": "<string>",
"usdAmount": 123
},
"relayerFee": {
"chainId": 123,
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"isNative": true,
"amount": "<string>",
"logo": "<string>",
"swapsXyzCode": "<string>",
"usdAmount": 123
}
}Get Quote
Returns a non-binding reference price for a cross-chain swap. Unlike GET /getAction, this endpoint never allocates a deposit address, builds transaction calldata, or triggers wallet-screening checks — it’s priced-only, safe to call at high frequency (e.g. to refresh a quote widget), and always uses swap-action semantics regardless of any actionType you pass.
sender and recipient are not accepted as inputs — the endpoint prices the route using internal placeholder addresses, since no transaction is produced. If you need a signable transaction, use GET /getAction instead.
curl --request GET \
--url https://api-v2.swaps.xyz/api/getQuote \
--header 'x-api-key: <api-key>'import requests
url = "https://api-v2.swaps.xyz/api/getQuote"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api-v2.swaps.xyz/api/getQuote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-v2.swaps.xyz/api/getQuote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-v2.swaps.xyz/api/getQuote"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-v2.swaps.xyz/api/getQuote")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.swaps.xyz/api/getQuote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"vmId": "evm",
"amountIn": {
"chainId": 123,
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"isNative": true,
"amount": "<string>",
"logo": "<string>",
"swapsXyzCode": "<string>",
"usdAmount": 123
},
"amountInMax": {
"chainId": 123,
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"isNative": true,
"amount": "<string>",
"logo": "<string>",
"swapsXyzCode": "<string>",
"usdAmount": 123
},
"amountOut": {
"chainId": 123,
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"isNative": true,
"amount": "<string>",
"logo": "<string>",
"swapsXyzCode": "<string>",
"usdAmount": 123
},
"amountOutMin": {
"chainId": 123,
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"isNative": true,
"amount": "<string>",
"logo": "<string>",
"swapsXyzCode": "<string>",
"usdAmount": 123
},
"protocolFee": {
"chainId": 123,
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"isNative": true,
"amount": "<string>",
"logo": "<string>",
"swapsXyzCode": "<string>",
"usdAmount": 123
},
"applicationFee": {
"chainId": 123,
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"isNative": true,
"amount": "<string>",
"logo": "<string>",
"swapsXyzCode": "<string>",
"usdAmount": 123
},
"exchangeRate": 123,
"estimatedTxTime": 123,
"estimatedPriceImpact": 123,
"requiresTokenApproval": true,
"requiresRegisterTransaction": true,
"bridgeFee": {
"chainId": 123,
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"isNative": true,
"amount": "<string>",
"logo": "<string>",
"swapsXyzCode": "<string>",
"usdAmount": 123
},
"relayerFee": {
"chainId": 123,
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"isNative": true,
"amount": "<string>",
"logo": "<string>",
"swapsXyzCode": "<string>",
"usdAmount": 123
}
}Authorizations
Limited demo key for API Reference: 5c951bc81da566bbd030ba8e20724063.
Query Parameters
Source chain ID Chain ID. Find in the list of supported networks.
Source token address. Use native for the chain's native asset.
Address type - can be EvmAddress, HyperCoreAddress, SolanaAddress, or AltVmAddress.
Destination chain ID Chain ID. Find in the list of supported networks.
Destination token address. Use native for the chain's native asset.
Address type - can be EvmAddress, HyperCoreAddress, SolanaAddress, or AltVmAddress.
The exact in or exact out amount of the swap, in the source or destination token's base units respectively.
^[0-9]+$Whether amount is an exact input or exact output amount.
Swap direction for the action.
exact-amount-in, exact-amount-out Slippage tolerance in bps. Defaults to 50 (0.5%) if omitted — unlike GET /getAction, where this parameter is required.
0 <= x <= 10000Specific bridge protocols to use
Optional: Will default to all available protocols
Bridge protocol identifier (e.g. "across", "relay", "mayan").
Alternate address the reference route would refund to
Optional: Will default to an internal placeholder address Address type - can be EvmAddress, HyperCoreAddress, SolanaAddress, or AltVmAddress.
Solana address that would pay for tx fees and rent (e.g. ATA creation) if this quote were later executed. Only used for Solana same-chain swaps. Address type - can be EvmAddress, HyperCoreAddress, SolanaAddress, or AltVmAddress.
Restrict the priced route universe to deposit-address-based flows
Optional: Set to true to price against the deposit-address strategy set
Extra gas to deliver on the destination chain, factored into the reference price
Optional
^[0-9]+$Application fees configuration as JSON array
Optional: Will default to fees configured for the application
Example: [{ "bps": 50, "receiverAddress": "0x..." }]
Price the route as if gasless execution were requested.
Optional: Has limited effect on this endpoint's response — executions/executionsType are never returned by getQuote, so this mainly affects fee computation, not the response shape.
Bypass the internal quote cache and re-price against live routes.
Optional: Presence, not value, is checked — passing skipCache=false still skips the cache. Omit the parameter entirely to use the cache.
Response
Successful response with a reference-price quote
Virtual machine identifier.
evm, solana, alt-vm, hypercore Expected amount to input (exclusive of slippage - recommended value to display in frontend)
Show child attributes
Show child attributes
Maximum amount to input (inclusive of slippage)
Show child attributes
Show child attributes
Expected amount delivered to users (exclusive of slippage - recommended value to display in frontend)
Show child attributes
Show child attributes
Minimum amount delivered to users (inclusive of slippage)
Show child attributes
Show child attributes
Swaps.xyz fee
Show child attributes
Show child attributes
Application fee (your fee!)
Show child attributes
Show child attributes
Exchange rate for the swap.
Estimated transaction time in seconds.
Estimated price impact percentage.
Flag indicating whether executing this route later would require a source token approval check.
Flag indicating whether executing this route later would require registration via the registerTxs endpoint. Mandatory for non-EVM transactions.
Bridge fee (from aggregated providers). Only present when the reference route crosses a bridge.
Show child attributes
Show child attributes
Fee charged by a gasless relay provider, denominated in USDT. Rarely populated on this endpoint since executionsType/executions are not returned here — present mainly for schema parity with GET /getAction.
Show child attributes
Show child attributes