Bridge

Get a Swap or Bridge Quote

Changed on

Get a live quote for swapping or bridging tokens without executing anything. Specify the exact input amount (exact='input') or the exact output amount (exact='output') and the other side is returned, along with the route steps. The quote is indicative and subject to change; use /v1/bridge/swap to execute.

Maps to /v1/bridge/swap as: originChainId/originTokenAddress = tokenIn, destinationChainId/destinationTokenAddress = tokenOut.

Authentication: Pass x-client-id header for frontend usage from allowlisted origins or x-secret-key for backend usage.

get/v1/bridge/quote

Request

  • Base URL
    https://api.thirdweb.com
  • Auth
    API key in header x-client-id

Query parameters

exact'input' | 'output'

Whether amount is the exact input amount (sell) or the exact output amount (buy).

originChainIdinteger required

Chain ID of the input token.

Example:1
originTokenAddressstring required

Input token address (use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for the native token).

destinationChainIdinteger required

Chain ID of the output token.

Example:1
destinationTokenAddressstring required

Output token address (use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for the native token).

amountstring required

Amount in wei. The input amount when exact='input', the output amount when exact='output'.

Response

Quote for the requested swap or bridge.

Example response

{
  "result": {
    "originAmount": "1000000",
    "destinationAmount": "1003745",
    "blockNumber": "496935617",
    "timestamp": 1787334467125,
    "estimatedExecutionTimeMs": 0,
    "steps": [],
    "intent": {
      "originChainId": 42161,
      "originTokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
      "destinationChainId": 42161,
      "destinationTokenAddress": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
      "amount": "1000000",
      "maxSteps": 1
    }
  }
}

Changes