POST /routing/best

Auth X-Hub-Key from API_HUB_KEYExecute POST /run/rango/routing/bestCache executed live on every call — a read-only POST answer is never cachedCost free · weight 0 · standard rate classSource billing free

Best single-step cross-chain route for a swap, with output amount, fees, price impact and ETA.

Parameters

nameintypedescription
amountbodystrrequiredInput amount in the source token's smallest units (decimal string)
example: 0.01
frombodystrrequiredSource asset as `{blockchain, symbol, address}` (address null for native tokens)
example: {"blockchain": "ETH", "symbol": "ETH", "address": null}
tobodystrrequiredDestination asset as `{blockchain, symbol, address}` (address null for native tokens)
example: {"blockchain": "POLYGON", "symbol": "POL", "address": null}
slippagebodystroptionalSlippage tolerance in percent
default: 1
example: 1

Response

type: object
data key: missingBlockchains
pagination: none
sample: {
  "from": "object",
  "to": "object",
  "requestAmount": "str",
  "requestId": "str",
  "result": "object",
  "validationStatus": "null",
  "walletNotSupportingFromBlockchain": "bool",
  "missingBlockchains": "array[0]",
  "diagnosisMessages": "array[0]",
  "error": "null",
  "errorCode": "null",
  "traceId": "null"
}

Safe request

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

curl -sX POST "https://openapihub.dev/run/rango/routing/best" \
  -H "X-Hub-Key: $API_HUB_KEY" -H "Content-Type: application/json" \
  -d '{"amount": "0.01", "from": "{\"blockchain\": \"ETH\", \"symbol\": \"ETH\", \"address\": null}", "to": "{\"blockchain\": \"POLYGON\", \"symbol\": \"POL\", \"address\": null}", "slippage": "1"}'