# Best route for a swap

`GET https://api.getchord.xyz/v1/quote`

Source: https://getchord.xyz/docs/api-reference/operations/getquote/

Quotes every venue on the chain in parallel, splits the order across venues when that improves the output, composes a two-hop route through the chain's anchors when no direct pool wins, and returns the best.

**Use it for**: a price before a trade, a route card, an agent deciding whether to buy, a bot comparing venues.

**Notes**
- Amounts are strings in the token's smallest unit. On Arc the USDC predeploy has 6 decimals, native USDC 18 — send the predeploy address `0x3600…0000` (the zero address is an alias for it on 5042).
- A quote is a live read of the venues and is good for about 30 seconds. Re-quote before you build if you waited longer.
- `fast=1` returns a single-hop answer in about 400 ms marked `preliminary`; run the full quote alongside and replace it.
- `only=` pins one venue and bypasses the routing safety gates — it needs an API key.
- An empty `routePlan` is a real answer (no route at this size); read `noRouteReason`.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `chain` | query | no | `5042` · `4663` · `143` · `43114` · `8453` · `56` · `42161` · `1` (default `143`) | Chain id: `5042` Arc · `4663` Robinhood Chain · `143` Monad · `43114` Avalanche C-Chain · `8453` Base · `56` BNB Chain · `42161` Arbitrum One · `1` Ethereum. Omitted = 143. Always pass it. |
| `inputMint` | query | yes | string | Token you sell. The zero address means the native unit (an alias for the USDC predeploy on Arc; ETH on Robinhood Chain). |
| `outputMint` | query | yes | string | Token you buy. |
| `amount` | query | yes | string | Input amount, smallest unit. |
| `slippageBps` | query | no | integer (default `50`) | Slippage tolerance in basis points; sets `otherAmountThreshold`. |
| `fast` | query | no | `0` · `1` | 1 = progressive first frame (single-hop, ~400 ms, `preliminary: true`). |
| `only` | query | no | string | Debug: restrict routing to one venue id. Requires `X-API-Key`. |

## Response 200

The best route. `routePlan` empty + `outputAmount` "0" = no route.

Example (captured from the live API):

```json
{
  "inputMint": "0x3600000000000000000000000000000000000000",
  "outputMint": "0x171a4217b86a807a64eb94757db6849fb4bdbaa0",
  "inputAmount": "5000000",
  "outputAmount": "465",
  "otherAmountThreshold": "460",
  "slippageBps": 100,
  "priceImpactPct": "92.51",
  "routePlan": [
    {
      "percent": 100,
      "swapInfo": {
        "dex": "uniswap_v4",
        "pool": "0xdd9da42901118c475e6efb78117100e611c675e2c53bc801c4d2bfdd504b2e8d",
        "inputMint": "0x3600000000000000000000000000000000000000",
        "outputMint": "0x171a4217b86a807a64eb94757db6849fb4bdbaa0",
        "inputAmount": "5000000",
        "outputAmount": "465",
        "adapter": "0xd1d86d370f40471B79D9938B27F6ea040EbD6888",
        "extraData": "0x000000000000000000000000171a4217b86a807a64eb94757db6849fb4bdbaa00000000000000000000000003600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000017700000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000"
      }
    }
  ],
  "gasEstimate": "318189",
  "gasCostUSD": "0",
  "blockNumber": 21808240,
  "timeTaken": 0.643,
  "feeBps": 25,
  "feeAmount": "1",
  "feeMint": "0x171a4217b86a807a64eb94757db6849fb4bdbaa0",
  "feeTier": "meme"
}
```

- **400**: Invalid parameters — `error` names the check that failed (`INVALID_PARAMS`, `BAD_ADDRESS`, `BAD_LIMIT`, `BAD_HOURS`, …).
- **429**: Over the per-minute limit (`RATE_LIMIT_EXCEEDED`). Read `X-RateLimit-Reset` and back off.
- **502**: The routing engine or an upstream did not answer (`ENGINE_ERROR`, `ROUTE_ERROR`).
- **503**: The lane behind this endpoint is not ready or not enabled here (`NOT_READY`, `CHAIN_NOT_ENABLED`, `NOT_ENABLED`, `*_UNAVAILABLE`). Retry later; do not treat it as an empty answer.
