0x Price Quote
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.
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
| Field | Value |
|---|---|
| Action ID | 0x-quote |
| Category | EVM Onchain |
| Connector | Not required |
| Requires gas | No |
| Funds movement | None declared |
| Tags | blockchain, evm, dex, swap, defi |
Payload Schema
| Field | Type | Required | Description |
|---|---|---|---|
sellToken | string | Yes | Token address to sell. Use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native ETH. |
buyToken | string | Yes | Token address to buy. Use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native ETH. |
sellAmount | string | Yes | Amount to sell in smallest unit (wei for ETH). Must be a positive integer string. |
chainId | number | Yes | Chain ID (e.g., 1 for Ethereum, 8453 for Base, 42161 for Arbitrum) |
slippageBps | number | No | Slippage tolerance in basis points (100 = 1%). Default is 100 (1%). Max 5000 (50%). |
Result Schema
| Field | Type | Required | Description |
|---|---|---|---|
buyAmount | string | Yes | Amount of buy token received in smallest unit |
sellAmount | string | Yes | Amount of sell token spent in smallest unit |
buyToken | string | Yes | Address of the buy token |
sellToken | string | Yes | Address of the sell token |
estimatedGas | string | No | Estimated gas for the swap |
price | number | Yes | Effective price (buyAmount per sellAmount ratio from API) |
Examples
json{ "type": "0x-quote", "payload": { "sellToken": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", "buyToken": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", "sellAmount": "1000000", "chainId": 8453 }, "children": []}
bashcurl -X POST "https://api.b3os.org/v1/actions/0x-quote/test" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "inputs": { "sellToken": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", "buyToken": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", "sellAmount": "1000000", "chainId": 8453 }}'
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.
