curl --request GET \
--url https://api.chainrails.io/api/v1/quotes/single \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.chainrails.io/api/v1/quotes/single"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.chainrails.io/api/v1/quotes/single', 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.chainrails.io/api/v1/quotes/single",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.chainrails.io/api/v1/quotes/single"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.chainrails.io/api/v1/quotes/single")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chainrails.io/api/v1/quotes/single")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"bridgeFeeDetails": {
"timestamp": 1702425683,
"fillDeadline": 1702429283,
"pctFee": 100000000000000,
"flatFee": "5000"
},
"totalFee": "15500",
"totalFeeFormatted": "0.0155",
"route": {
"tokenIn": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"tokenOut": "0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4",
"sourceChain": "BASE_TESTNET",
"destinationChain": "ARBITRUM_TESTNET",
"amount": "10000000",
"bridge": "ACROSS",
"recipient": "0x742d35Cc6635C0532925a3b8D62A7fe7B58123D1"
}
}{
"statusCode": 400,
"message": "Token addresses are required"
}{
"statusCode": 401,
"message": "Unauthorized"
}{
"statusCode": 500,
"message": "Failed to retrieve quote. Please try again later."
}Get quote from specific bridge
Retrieves a cross-chain transfer quote from a specific bridge protocol
curl --request GET \
--url https://api.chainrails.io/api/v1/quotes/single \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.chainrails.io/api/v1/quotes/single"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.chainrails.io/api/v1/quotes/single', 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.chainrails.io/api/v1/quotes/single",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.chainrails.io/api/v1/quotes/single"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.chainrails.io/api/v1/quotes/single")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chainrails.io/api/v1/quotes/single")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"bridgeFeeDetails": {
"timestamp": 1702425683,
"fillDeadline": 1702429283,
"pctFee": 100000000000000,
"flatFee": "5000"
},
"totalFee": "15500",
"totalFeeFormatted": "0.0155",
"route": {
"tokenIn": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"tokenOut": "0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4",
"sourceChain": "BASE_TESTNET",
"destinationChain": "ARBITRUM_TESTNET",
"amount": "10000000",
"bridge": "ACROSS",
"recipient": "0x742d35Cc6635C0532925a3b8D62A7fe7B58123D1"
}
}{
"statusCode": 400,
"message": "Token addresses are required"
}{
"statusCode": 401,
"message": "Unauthorized"
}{
"statusCode": 500,
"message": "Failed to retrieve quote. Please try again later."
}Authorizations
Enter your Chainrails API key as a Bearer token
Query Parameters
Input token address
"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
Output token address
"0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4"
Source blockchain
ARBITRUM_MAINNET, ARBITRUM_TESTNET, AVALANCHE_MAINNET, AVALANCHE_TESTNET, BASE_MAINNET, BASE_TESTNET, STARKNET_MAINNET, STARKNET_TESTNET, BSC_MAINNET, ETHEREUM_MAINNET, ETHEREUM_TESTNET, OPTIMISM_MAINNET, OPTIMISM_TESTNET, MONAD_MAINNET, MONAD_TESTNET, POLYGON_MAINNET, HYPEREVM_MAINNET, LISK_MAINNET, SOLANA_MAINNET, SOLANA_TESTNET, TRON_MAINNET Destination blockchain
ARBITRUM_MAINNET, ARBITRUM_TESTNET, AVALANCHE_MAINNET, AVALANCHE_TESTNET, BASE_MAINNET, BASE_TESTNET, STARKNET_MAINNET, STARKNET_TESTNET, BSC_MAINNET, ETHEREUM_MAINNET, ETHEREUM_TESTNET, OPTIMISM_MAINNET, OPTIMISM_TESTNET, MONAD_MAINNET, MONAD_TESTNET, POLYGON_MAINNET, HYPEREVM_MAINNET, LISK_MAINNET, SOLANA_MAINNET, SOLANA_TESTNET, TRON_MAINNET Amount in token units (denominated in amountSymbol if specified, otherwise USDC)
"10000000"
Bridge to use for the quote
ACROSS, CCTP, GATEWAY, RHINOFI Optional recipient address
"0x742d35Cc6635C0532925a3b8D62A7fe7B58123D1"
Token symbol for amount denomination (defaults to USDC). Use this to specify amounts in other tokens like WETH, DAI, etc.
USDC, USDT, DAI, BUSD, EURC, ETH, WETH, STRK, BNB, LORDS, USDS, USDG, USDT0, WBTC, LINK, SOL, EKUBO, AAVE, UNI, CURVE, cbBTC, VIRTUAL, stETH, wstETH, SKY, AUSD, WMON, LVMON, OP, WLD, ARB, sAVAX, WAVAX, anyBTC, WBNB, TRON, AVAX, POL, MON Response
Quote retrieved successfully
Bridge-specific fee details (structure varies by bridge)
{
"timestamp": 1702425683,
"fillDeadline": 1702429283,
"pctFee": 100000000000000,
"flatFee": "5000"
}
Total fee in token units (bridge fee + ChainRails fee)
"15500"
Human-readable formatted total fee
"0.0155"
Show child attributes
Show child attributes
Was this page helpful?

