GET /swap/quote

Auth X-Hub-Key from API_HUB_KEYExecute GET /run/socket/swap/quoteCache cached 1s, never served stale past that windowCost free · weight 0 · standard rate classSource billing free

Route discovery for a swap or bridge: ranked routes with output amount and minimum received, estimated time, slippage, gas fee, bridge/DEX provider metadata, fee breakdown, ERC-20 approval plan and an unsigned transaction plan. Plan data only — never signed or broadcast by this source.

Plan data only. The txData/approval fields describe what a wallet would send; this source never signs, approves, submits or broadcasts. Pin exactly one amount side: inputAmount for EXACT_INPUT, outputAmount for EXACT_OUTPUT (live 2026-09-12: outputAmount on an input-pinned call returns HTTP 400 'outputAmount is only supported for EXPECTED_OUTPUT and EXACT_OUTPUT quote types'; simulatedQuotesRequired/refuel are rejected for output quote types).

Parameters

nameintypedescription
userOpsquerystr
tx | deposit
requiredOperation kind. 'tx' = a transaction the caller would send; 'deposit' = pre-funding instruction variant used by the site's QR-deposit flow (not exercised by this source).
default: tx
example: tx
originChainIdqueryintrequiredSource chain id (hub aliases accepted: base / 8453).
example: 8453
destinationChainIdqueryintrequiredDestination chain id (hub aliases accepted).
example: 42161
inputTokenquerystrrequiredSource token contract address.
example: 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
outputTokenquerystrrequiredDestination token contract address.
example: 0xaf88d065e77c8cc2239327c5edb3a432268e5831
receiverAddressquerystrrequiredDestination address. any public address works for quoting.
example: 0x18Cc6F90512C6D95ACA0d57F98C727D61873c06a
inputAmountquerystroptionalAmount in source-token base units (EXACT_INPUT; USDC has 6 decimals, so 10000 = 0.01 USDC). Omit for EXACT_OUTPUT.
example: 10000
outputAmountquerystroptionalAmount in destination-token base units (EXACT_OUTPUT only, with quoteType=EXACT_OUTPUT). Omit for EXACT_INPUT.
example: 10000
quoteTypequerystr
EXACT_INPUT | EXACT_OUTPUT
optionalWhich side of the trade the amount pins.
default: EXACT_INPUT
example: EXACT_INPUT
userAddressquerystroptionalSender address used for the approval/gas plan. Defaults to a placeholder address when omitted.
example: 0x18Cc6F90512C6D95ACA0d57F98C727D61873c06a
slippagequeryfloatoptionalSlippage tolerance in percent (1 = 1%); bounds each route's minAmountOut. Defaults to the route's suggested slippage when omitted.
example: 1
refuelquerystr
true | false
optionalRequest a small native-gas refuel add-on on the destination chain (input-pinned quotes only — the upstream rejects it for EXACT_OUTPUT).
example: true
simulatedQuotesRequiredquerystr
true | false
optionalAsk the router to simulate each quote; set true so returned plans are pre-validated. Input-pinned quotes only — the upstream rejects it for EXACT_OUTPUT.
example: true

Response

type: object
pagination: none
sample: {
  "result": "object{originChainId, destinationChainId, quoteType, userAddress, receiverAddress, input{token, amount, priceInUsd, valueInUsd}, routes: array of route objects, quoteRejections: array{providerId, reason}}",
  "statusCode": "int",
  "success": "bool",
  "message": "null"
}

Safe request

Reads the credential from API_HUB_KEY; it never appears in the URL.

curl -sH "X-Hub-Key: $API_HUB_KEY" "https://openapihub.dev/run/socket/swap/quote?userOps=tx&originChainId=8453&destinationChainId=42161&inputToken=0x833589fcd6edb6e08f4c7c32d4f71b54bda02913&outputToken=0xaf88d065e77c8cc2239327c5edb3a432268e5831&receiverAddress=0x18Cc6F90512C6D95ACA0d57F98C727D61873c06a&inputAmount=10000&outputAmount=10000&quoteType=EXACT_INPUT&userAddress=0x18Cc6F90512C6D95ACA0d57F98C727D61873c06a&slippage=1&refuel=true&simulatedQuotesRequired=true"