Get started
Try it live
A real quote from the API, from your browser: no sign-up, nothing signed. The request is written out as curl, JavaScript and Python to copy.
Ask for a quote
Pick a trade and send the request. It runs with the docs' demo key, which works only on this page; the code beside it uses yours.
GET
/v1/quoteDemo key · prices onlycurl "https://api.soheil.fi/v1/quote?fromChainId=8453&toChainId=42161&fromToken=0x0000000000000000000000000000000000000000&toToken=0x0000000000000000000000000000000000000000&fromAmount=0&fromAddress=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&slippageBps=50" \
-H "x-api-key: sk_your_key"curl "https://api.soheil.fi/v1/quote?fromChainId=8453&toChainId=42161&fromToken=0x0000000000000000000000000000000000000000&toToken=0x0000000000000000000000000000000000000000&fromAmount=0&fromAddress=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&slippageBps=50" \
-H "x-api-key: sk_your_key"const params = new URLSearchParams({
fromChainId: "8453",
toChainId: "42161",
fromToken: "0x0000000000000000000000000000000000000000",
toToken: "0x0000000000000000000000000000000000000000",
fromAmount: "0",
fromAddress: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
slippageBps: "50",
});
const res = await fetch(`https://api.soheil.fi/v1/quote?${params}`, {
headers: { "x-api-key": process.env.SOHEIL_ROUTER_KEY },
});
const quote = await res.json();
if (quote.error) throw new Error(quote.error.message);
console.log(quote.toAmount, quote.transactionRequest);import os, requests
params = {
"fromChainId": "8453",
"toChainId": "42161",
"fromToken": "0x0000000000000000000000000000000000000000",
"toToken": "0x0000000000000000000000000000000000000000",
"fromAmount": "0",
"fromAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"slippageBps": "50",
}
res = requests.get(
"https://api.soheil.fi/v1/quote",
params=params,
headers={"x-api-key": os.environ["SOHEIL_ROUTER_KEY"]},
timeout=30,
)
quote = res.json()
if "error" in quote:
raise RuntimeError(quote["error"]["message"])
print(quote["toAmount"], quote["transactionRequest"])