Skip to main content
POST
/
api
/
rapidquote
Get Quote
curl --request POST \
  --url https://quote.rapidx.app/api/rapidquote \
  --header 'Content-Type: application/json' \
  --data '{
  "chainIdFrom": 123,
  "chainIdTo": 123,
  "fromToken": "<string>",
  "toToken": "<string>",
  "fromWalletAddress": "<string>",
  "toWalletAddress": "<string>",
  "amountIn": "<string>"
}'
{
  "Data": {
    "Data": {
      "success": true,
      "message": "<string>",
      "data": {
        "id": "<string>",
        "isMultiChain": true,
        "route": {
          "sourceTransaction": {
            "dexName": "<string>",
            "fromToken": {
              "address": "<string>",
              "chainId": 123,
              "decimal": 123,
              "logoURI": "<string>",
              "name": "<string>",
              "symbol": "<string>",
              "price": 123,
              "tokenIsNative": true,
              "tokenIsStable": true,
              "amount": "<string>",
              "amountIne": "<string>",
              "amountInUsd": "<string>"
            },
            "toToken": {
              "address": "<string>",
              "chainId": 123,
              "decimal": 123,
              "logoURI": "<string>",
              "name": "<string>",
              "symbol": "<string>",
              "price": 123,
              "tokenIsNative": true,
              "tokenIsStable": true,
              "amount": "<string>",
              "amountIne": "<string>",
              "amountInUsd": "<string>"
            },
            "gasCosts": [
              {
                "name": "<string>",
                "desctiption": "<string>",
                "price": "<string>",
                "estimate": "<string>",
                "limit": "<string>",
                "amount": "<string>",
                "amountUSD": "<string>",
                "token": {}
              }
            ],
            "feeCosts": [
              {
                "name": "<string>",
                "desctiption": "<string>",
                "price": "<string>",
                "estimate": "<string>",
                "limit": "<string>",
                "amount": "<string>",
                "amountUSD": "<string>",
                "token": {}
              }
            ],
            "approvalAddress": "<string>",
            "callData": "<string>",
            "receviableAmountByDex": {
              "token": {
                "address": "<string>",
                "chainId": 123,
                "decimal": 123,
                "logoURI": "<string>",
                "name": "<string>",
                "symbol": "<string>",
                "price": 123,
                "tokenIsNative": true,
                "tokenIsStable": true,
                "amount": "<string>",
                "amountIne": "<string>",
                "amountInUsd": "<string>"
              },
              "amountInWei": "<string>",
              "amountInUSD": "<string>"
            },
            "alreadySupportedToken": true
          },
          "destinationTransaction": {
            "dexName": "<string>",
            "fromToken": {
              "address": "<string>",
              "chainId": 123,
              "decimal": 123,
              "logoURI": "<string>",
              "name": "<string>",
              "symbol": "<string>",
              "price": 123,
              "tokenIsNative": true,
              "tokenIsStable": true,
              "amount": "<string>",
              "amountIne": "<string>",
              "amountInUsd": "<string>"
            },
            "toToken": {
              "address": "<string>",
              "chainId": 123,
              "decimal": 123,
              "logoURI": "<string>",
              "name": "<string>",
              "symbol": "<string>",
              "price": 123,
              "tokenIsNative": true,
              "tokenIsStable": true,
              "amount": "<string>",
              "amountIne": "<string>",
              "amountInUsd": "<string>"
            },
            "gasCosts": [
              {
                "name": "<string>",
                "desctiption": "<string>",
                "price": "<string>",
                "estimate": "<string>",
                "limit": "<string>",
                "amount": "<string>",
                "amountUSD": "<string>",
                "token": {}
              }
            ],
            "feeCosts": [
              {
                "name": "<string>",
                "desctiption": "<string>",
                "price": "<string>",
                "estimate": "<string>",
                "limit": "<string>",
                "amount": "<string>",
                "amountUSD": "<string>",
                "token": {}
              }
            ],
            "approvalAddress": "<string>",
            "callData": "<string>",
            "receviableAmountByDex": {
              "token": {
                "address": "<string>",
                "chainId": 123,
                "decimal": 123,
                "logoURI": "<string>",
                "name": "<string>",
                "symbol": "<string>",
                "price": 123,
                "tokenIsNative": true,
                "tokenIsStable": true,
                "amount": "<string>",
                "amountIne": "<string>",
                "amountInUsd": "<string>"
              },
              "amountInWei": "<string>",
              "amountInUSD": "<string>"
            },
            "alreadySupportedToken": true
          }
        },
        "quote": {
          "fromAmount": "<string>",
          "toAmount": "<string>",
          "totalCostInUSD": "<string>",
          "approvalAddress": "<string>",
          "recevableAmoutAtDestination": {
            "token": {
              "address": "<string>",
              "chainId": 123,
              "decimal": 123,
              "logoURI": "<string>",
              "name": "<string>",
              "symbol": "<string>",
              "price": 123,
              "tokenIsNative": true,
              "tokenIsStable": true,
              "amount": "<string>",
              "amountIne": "<string>",
              "amountInUsd": "<string>"
            },
            "amountInWei": "<string>",
            "amountInUSD": "<string>"
          }
        },
        "transactionData": {
          "data": "<string>",
          "to": "<string>",
          "value": "<string>",
          "from": "<string>",
          "chainId": 123,
          "gasPrice": "<string>",
          "gasLimit": "<string>"
        },
        "executorTransactionData": {
          "data": "<string>",
          "to": "<string>",
          "value": "<string>",
          "from": "<string>",
          "chainId": 123,
          "gasPrice": "<string>",
          "gasLimit": "<string>"
        }
      },
      "timestamp": "2023-11-07T05:31:56Z"
    }
  }
}
This endpoint allows you to get a cross-chain bridge quote for token swaps between different blockchain networks using RapidX.

Example Request

{
  "chainIdFrom": 56,
  "chainIdTo": 42161,
  "fromToken": "0x0000000000000000000000000000000000000000",
  "toToken": "0x0000000000000000000000000000000000000000",
  "fromWalletAddress": "0x552008c0f6870c2f77e5cC1d2eb9bdff03e30Ea0",
  "toWalletAddress": "0x552008c0f6870c2f77e5cC1d2eb9bdff03e30Ea0",
  "amountIn": "5000000000000000"
}

Parameters

  • chainIdFrom: The source blockchain chain ID (e.g., 56 for BSC, 1 for Ethereum)
  • chainIdTo: The destination blockchain chain ID (e.g., 42161 for Arbitrum)
  • fromToken: Source token contract address (use 0x0000000000000000000000000000000000000000 for native tokens)
  • toToken: Destination token contract address (use 0x0000000000000000000000000000000000000000 for native tokens)
  • fromWalletAddress: Source wallet address
  • toWalletAddress: Destination wallet address
  • amountIn: Amount to swap in wei (smallest unit)

Response

The API returns detailed swap information including:
  • Route information: Source and destination transaction details
  • Quote details: Amount calculations and costs
  • Transaction data: Ready-to-execute transaction data
  • Gas costs: Estimated gas fees for the swap

Common Chain IDs

NetworkChain ID
Ethereum1
BSC56
Polygon137
Arbitrum42161
Optimism10
Avalanche43114

Native Token Address

For native tokens (ETH, BNB, MATIC, etc.), use the zero address: 0x0000000000000000000000000000000000000000

Body

application/json

Quote request parameters

chainIdFrom
integer
required

Source blockchain chain ID

chainIdTo
integer
required

Destination blockchain chain ID

fromToken
string
required

Source token contract address (use 0x0000000000000000000000000000000000000000 for native tokens)

toToken
string
required

Destination token contract address (use 0x0000000000000000000000000000000000000000 for native tokens)

fromWalletAddress
string
required

Source wallet address

toWalletAddress
string
required

Destination wallet address

amountIn
string
required

Amount to swap in wei (smallest unit)

Response

Successful quote response

Data
object
I