POST /routing/bests

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

All candidate routes for a swap (bridge/DEX picks with per-route output, fees, ETAs and preference scores).

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: results
pagination: none
sample: {
  "from": "object",
  "to": "object",
  "requestAmount": "str",
  "routeId": "str",
  "results": "array[6]",
  "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/bests" \
  -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"}'