Token swap quote
Get a firm 0x swap quote — a signable transaction plus Permit2 typed data and fees — for an ERC-20 swap on an EVM chain.
Provider contract
- Call path
- /routes/blockrun-zerox/crypto/swap-quote
- Method
- GET
- Selected provider
- blockrun-zeroxdefault
- Provider price
- Free, 0.35% on swap
- Settlement
- free call
Quickstart
Both commands call the selected provider directly.
curl '/routes/blockrun-zerox/crypto/swap-quote?chainId=8453&sellToken=0x833589fcd6edb6e08f4c7c32d4f71b54bda02913&buyToken=0x4200000000000000000000000000000000000006&sellAmount=1000000&taker=0x1677383A7Bec2cf618FC98aeF68b757BcFc37F27'
h402 call 'crypto/swap-quote' --provider 'blockrun-zerox' --method GET --query '{"chainId":8453,"sellToken":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","buyToken":"0x4200000000000000000000000000000000000006","sellAmount":"1000000","taker":"0x1677383A7Bec2cf618FC98aeF68b757BcFc37F27"}'Parameters & live test
freeFill the request fields and call — the result returns directly, no payment or wallet needed. Only the selected provider's listed parameters are accepted.
chainIdintegerrequiredEVM chain id the swap executes on. 0x supports a provider-defined set, e.g. 1 (Ethereum), 8453 (Base), 137 (Polygon), 42161 (Arbitrum), 10 (Optimism), 56 (BNB Chain), 43114 (Avalanche). Supported chains: https://docs.0x.org/docs/introduction/supported-chains
sellTokenstringrequiredERC-20 contract address of the token being sold.
buyTokenstringrequiredERC-20 contract address of the token being bought.
sellAmountstringrequiredAmount to sell, in the sell token's smallest unit (wei).
takerstringrequiredWallet address that will sign and execute the swap.
{
"chainId": 8453,
"sellToken": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"buyToken": "0x4200000000000000000000000000000000000006",
"sellAmount": "1000000",
"taker": "0x1677383A7Bec2cf618FC98aeF68b757BcFc37F27"
}Free · returns the result directly, no payment
{ "data": { "allowanceTarget": "0x000000000022d473030f116ddee9f6b43ac78ba3", "blockNumber": "48971712", "buyAmount": "514558614589441", "buyToken": "0x4200000000000000000000000000000000000006", "fees": { "integratorFee": { "amount": "2000", "token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "type": "volume" }, "integratorFees": [ { "amount": "2000", "token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "type": "volume" } ], "zeroExFee": { "amount": "1500", "token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "type": "volume" }, "gasFee": null }, "issues": { "allowance": { "actual": "0", "spender": "0x000000000022d473030f116ddee9f6b43ac78ba3" }, "balance": null, "simulationIncomplete": false, "invalidSourcesPassed": [] }, "liquidityAvailable": true, "minBuyAmount": "509413028434200", "mode": "exact-in", "route": { "fills": [ { "from": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "to": "0x4200000000000000000000000000000000000006", "source": "PancakeSwap_Infinity_CL", "proportionBps": "10000" } ], "tokens": [ { "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "symbol": "USDC" }, { "address": "0x4200000000000000000000000000000000000006", "symbol": "WETH" } ] }, "sellAmount": "1000000", "sellToken": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "tokenMetadata": { "buyToken": { "buyTaxBps": "0", "sellTaxBps": "0", "transferTaxBps": "0" }, "sellToken": { "buyTaxBps": "0", "sellTaxBps": "0", "transferTaxBps": "0" } }, "totalNetworkFee": "4629056657173", "zid": "0xef901c08891369b1b6dd9b10", "permit2": { "type": "Permit2", "hash": "0xb668654e7317d45e9379830862b90628b78cd1f7f177d5f9330e9993608a45e3", "eip712": { "types": { "PermitTransferFrom": [ { "name": "permitted", "type": "TokenPermissions" }, { "name": "spender", "type": "address" }, { "name": "nonce", "type": "uint256" } ], "EIP712Domain": [ { "name": "name", "type": "string" }, { "name": "chainId", "type": "uint256" }, { "name": "verifyingContract", "type": "address" } ], "TokenPermissions": [ { "name": "token", "type": "address" }, { "name": "amount", "type": "uint256" } ] }, "domain": { "name": "Permit2", "chainId": 8453, "verifyingContract": "0x000000000022d473030f116ddee9f6b43ac78ba3" }, "message": { "permitted": { "token": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", "amount": "1000000" }, "spender": "0x7747f8d2a76bd6345cc29622a946a929647f2359", "nonce": "2241959297937691820908574931991883", "deadline": "1784733072" }, "primaryType": "PermitTransferFrom" } }, "transaction": { "to": "0x7747f8d2a76bd6345cc29622a946a929647f2359", "data": "0x1fff991f0000000000000000000000001677383a7bec2cf618fc98aef68b757bcfc37f2700000000000000000000000042000000000000000000000000000000000000060000000000000000000000000000000000000000000000000001cf4ef69a911800000000000000000000000000000000000000000000000000000000000000a0ef901c08891369b1b6dd9b1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000076000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000380000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000006a0000000000000000000000000000000000000000000000000000000000000012438c9c147000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda029130000000000000000000000000000000000000000000000000000000000000014000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000e9030014f5dae217d0a152f02a043567b16c1abf00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012438c9c147000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000000000000000000000000000000000000000000f000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000ad01c20d5886137e056775af56915d… [truncated for committed sample]", "gas": "370996", "gasPrice": "12434885", "value": "0" } }, "h402": { "routeId": "crypto/swap-quote", "provider": "blockrun-zerox", "selectedCandidateId": "crypto/swap-quote/blockrun-zerox", "routing": "manual", "paidBy": "free" } }
Providers
Choose a provider for this task. The catalog recommends the current default from quality, reliability, and price; your selected provider stays pinned. Listed prices are provider prices; settlement adds a 5% h402 fee.
- Success
- 100%
- p50
- 950ms
- Calls
- 3