---
title: "Compare every rail for a lane (query form)"
method: GET
path: "/api/route/compare"
tags: ["best-execution"]
---

# Compare every rail for a lane (query form)

`GET /api/route/compare`

## Request

- Base URL: `https://api.anygas.xyz/svc`
- URL: `https://api.anygas.xyz/svc/api/route/compare`
- Auth: none declared

Quotes every rail that can serve a lane (aggregators + Allbridge + Chainflip) in parallel, ranks by net destination output and flags the best. Read-only, nothing signed. Adds effectiveFeePct, qualityScore, guard and a 12s cached flag. Rate limit 30/min.

Includes Robyn's OWN float lane as a ranked candidate, not just third-party bridges. The lane is quoted from inventory Robyn already holds on the destination chain, so it needs no external API and still answers when every aggregator is rate-limited or down. The `firstParty` block states the first-party price against the best third-party price for that exact request, so the independence claim is checkable per call. Pass `excludeRails: ["floatlane"]` to compare only third-party rails (used internally when moving Robyn's own inventory, which the lane cannot do).

## Query parameters

- `fromChain` string, required
- `toChain` string, required
- `fromToken` string
- `toToken` string
- `amount` string, required
- `toAddress` string

## Response `200`

Ranked rails

- CompareResult
  - `lane` object
    - `fromChain` string
    - `toChain` string
    - `applicableRails` string[]
    - `estOutUnit` string
  - `quotes` object[]
    - `rail` string
    - `ok` boolean
    - `estOut` string
    - `etaSeconds` number
    - `best` boolean
    - `effectiveFeePct` number
    - `qualityScore` integer
  - `best` string
  - `comparedRails` integer
  - `railsAttempted` integer
  - `guard` object
    - `ok` boolean
    - `effectiveFeePct` number
    - `thresholdPct` number
    - `recommendedMinInput` string
  - `cached` boolean

---

[API](https://skmtc.dev/anygas/apis/robyn-anygas-api.md) · [All operations](https://skmtc.dev/anygas/apis/robyn-anygas-api/llms.txt) · [OpenAPI document](https://skmtc.dev/anygas/apis/robyn-anygas-api/revisions/9b7498be8304?raw)
