HTTP API · Execution
Get a firm quote
One routed quote across every integrated venue, returned ready to sign: a transaction, a CoW order, or a deposit address.
curl "https://www.swaps.pro/api/sdk/v1/quote?sellChain=8453&sellToken=ETH&buyChain=8453&buyToken=USDC&amount=0.1&address=0x21c9a94AF76B59b171b32fD125A4edF0e9A2Ad3e&partner=docs-example"The quote is FIRM. buyAmount is the venue's expected output and minBuyAmount is the floor the transaction enforces on chain; the wallet receives at least the floor or the transaction reverts.
Three execution shapes. A same-chain EVM route carries tx (and approval when the sell asset is an ERC-20 and the allowance is short). A CoW route carries order with EIP-712 typed data to sign and a postUrl to send the signed order to. THORChain-style routes carry depositAddress and memo.
Free at 60 requests per minute per IP with no credential. A grant from /access lifts that to 600; present it as the X-SwapsPro-Access header. Quotes are never billed — a quote that leads to a trade already pays for itself.
Parameters#
| Name | In | Type | Description |
|---|---|---|---|
sellChainREQUIRED | query | chain | Chain symbol or numeric id, from /chains. |
sellTokenREQUIRED | query | symbol | address | Symbol from /tokens, or a contract address. |
buyChainREQUIRED | query | chain | Chain symbol or numeric id. May differ from sellChain for a cross-chain route. |
buyTokenREQUIRED | query | symbol | address | Symbol from /tokens, or a contract address. |
amountREQUIRED | query | decimal string | Human amount of sellToken to sell, e.g. "0.1". Never base units. |
addressREQUIRED | query | address | The wallet that will sign. The venue builds the transaction for this sender. |
recipient | query | address | Where the bought asset lands, when it is not the signer. Default: same as address. |
slippage | query | percent | Maximum slippage in percent, 0 < s ≤ 50. Sets minBuyAmount on venues that accept it. Default: the venue's own floor. |
partner | query | string ≤ 64 | Your integrator id. Stamped on the quote and used for attribution. |
partnerFeeBps | query | integer bps | Fee you keep on top of SwapsPro's, in basis points, capped by tier. partnerFee in the response says what was actually collected. Default: 0. |
X-SwapsPro-Access | header | token | A grant from /access. Raises the ceiling from 60 to 600 requests per minute. Also accepted as Authorization: Bearer. |
Responses#
Success is the body below. Every error is { "error": string, "code": string } with a matching HTTP status — never a 200 that says no.
When: a route exists for the pair and size. Captured live. tx.data is 10,186 hex characters and is truncated here; everything else is verbatim.
{
"provider": "0x",
"sellChain": "BASE",
"buyChain": "BASE",
"sellToken": {
"caip": "eip155:8453/slip44:60",
"symbol": "ETH"
},
"buyToken": {
"caip": "eip155:8453/erc20:0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"symbol": "USDC"
},
"sellAmount": "0.1",
"buyAmount": "244.524665",
"minBuyAmount": "242.068365",
"rate": 2445.24665,
"tx": {
"chainId": 8453,
"to": "0x0000000000001ff3684f28c67538d4d072c22734",
"data": "0x2213bc0b0000000000000000000000007747f8d2a76bd6345cc29622a946a929…",
"value": "0x16345785d8a0000",
"gasLimit": "0x13df23"
},
"expiresAt": "2026-09-03T14:45:40.996Z",
"partner": "docs-example",
"partnerFee": {
"requestedBps": 0,
"collectedBps": 0,
"collected": false,
"note": "No partner fee was requested."
}
}Fields worth knowing#
| Field | Meaning |
|---|---|
provider | which venue won: 0x, cow, lifi, thorchain, … |
buyAmount / minBuyAmount | expected output and the enforced floor, human decimals |
rate | buyAmount per 1 sellToken |
tx | chainId, to, data, value, gasLimit — ready for eth_sendTransaction |
approval | exact-amount ERC-20 approve to send first, when needed |
order | CoW: typedData to sign, body and postUrl to submit |
depositAddress / memo | THORChain-style: where to send and what to say |
expiresAt | ISO time after which the quote must not be used |
partnerFee | what was requested, what was collected, and why |
For agents#
The brief below is what Copy for agents puts on the clipboard: the parameters, one example, the 200 body and the rules. It is Markdown, and it is short on purpose — everything in it is load-bearing.
- Read
minBuyAmountas the guarantee andbuyAmountas the estimate. Never promise a user more than the floor. - Execute exactly what came back: send
txas-is (value and gasLimit are 0x-hex), or signorder.typedDataand POSTorder.bodytoorder.postUrl, or deposit todepositAddresswithmemoverbatim. Do not rebuild calldata. - If
approvalis present, send that approve transaction first and wait for it to confirm. It is for the exact amount, never unlimited. - A quote expires at
expiresAt. Re-quote after that instead of sending a stale transaction. - A 502 with NO_ROUTE is an answer, not an outage: the pair cannot be priced at that size right now. Try a smaller amount or a different pair; do not retry in a loop.
