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 freeAll candidate routes for a swap (bridge/DEX picks with per-route output, fees, ETAs and preference scores).
Parameters
| name | in | type | description | |
|---|---|---|---|---|
amount | body | str | required | Input amount in the source token's smallest units (decimal string) example: 0.01 |
from | body | str | required | Source asset as `{blockchain, symbol, address}` (address null for native tokens) example: {"blockchain": "ETH", "symbol": "ETH", "address": null} |
to | body | str | required | Destination asset as `{blockchain, symbol, address}` (address null for native tokens) example: {"blockchain": "POLYGON", "symbol": "POL", "address": null} |
slippage | body | str | optional | Slippage tolerance in percent default: 1example: 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"}'