0x Price Quote logo

Catalog action EVM Onchain

Get a live swap price quote from 0x Protocol without executing anything. Returns how much of the output token you'd receive for a given input amount.

At a Glance

FieldValue
Action ID0x-quote
CategoryEVM Onchain
ConnectorNot required
Requires gasNo
Funds movementNone declared
Tagsblockchain, evm, dex, swap, defi

Payload Schema

FieldTypeRequiredDescription
sellTokenstringYesToken address to sell. Use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native ETH.
buyTokenstringYesToken address to buy. Use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native ETH.
sellAmountstringYesAmount to sell in smallest unit (wei for ETH). Must be a positive integer string.
chainIdnumberYesChain ID (e.g., 1 for Ethereum, 8453 for Base, 42161 for Arbitrum)
slippageBpsnumberNoSlippage tolerance in basis points (100 = 1%). Default is 100 (1%). Max 5000 (50%).

Result Schema

FieldTypeRequiredDescription
buyAmountstringYesAmount of buy token received in smallest unit
sellAmountstringYesAmount of sell token spent in smallest unit
buyTokenstringYesAddress of the buy token
sellTokenstringYesAddress of the sell token
estimatedGasstringNoEstimated gas for the swap
pricenumberYesEffective price (buyAmount per sellAmount ratio from API)

Examples

json
{ "type": "0x-quote", "payload": { "sellToken": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", "buyToken": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", "sellAmount": "1000000", "chainId": 8453 }, "children": []}

Payload fields can use workflow expressions such as {{$trigger.body.amount}}, {{$nodes.fetch.result.price}}, and {{$props.asset}} when the value should come from a trigger, prior node, or reusable workflow prop.

Ask a question... ⌘I