---
title: "Quote and build in one call"
method: GET
path: "/swap/calldata"
tags: ["Quote and swap"]
---

# Quote and build in one call

`GET /swap/calldata`

## Request

- Base URL: `https://api.getchord.xyz/v1`
- URL: `https://api.getchord.xyz/v1/swap/calldata`
- Auth: none declared

For contracts and bots that call the router directly: routes and encodes in a single request. The output goes to `msg.sender`; the caller approves the router for `tokenIn` and sends the calldata.

## Query parameters

- `chain` 5042 | 4663 | 143 | 43114 | 8453 | 56 | 42161 | 1
- `tokenIn` string, required: EVM address, hex, case-insensitive.
- `tokenOut` string, required: EVM address, hex, case-insensitive.
- `amountIn` string, required: Amount in the token's smallest unit, as a decimal string. Never a float.
- `slippageBps` integer

## Response `200`

Router call.

- object
  - `to` string: EVM address, hex, case-insensitive.
  - `data` string
  - `value` string: Amount in the token's smallest unit, as a decimal string. Never a float.
  - `minOut` string: Minimum output, human units.
  - `expectedOut` string: Quoted output, human units.
  - `gasLimit` string

## Other responses

- `400`: Invalid parameters — `error` names the check that failed (`INVALID_PARAMS`, `BAD_ADDRESS`, `BAD_LIMIT`, `BAD_HOURS`, …).
- `404`: Nothing at this identity (`NOT_FOUND`, `UNKNOWN_TOKEN`, `NO_ROUTE`).
- `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`).

---

[API](https://skmtc.dev/getchord/apis/chord-api.md) · [All operations](https://skmtc.dev/getchord/apis/chord-api/llms.txt) · [OpenAPI document](https://skmtc.dev/getchord/apis/chord-api/revisions/d3bc4640fea0?raw)
