Uniswap quote API: amount out, price impact and gas
A Uniswap quote tells you how many tokens you get out for a given amount in, read from Uniswap's QuoterV2 contract at the current block. You can call QuoterV2 yourself through any RPC node for free. Our DEX Swap Quote API does it for you on 6 EVM chains, compares the 4 fee tiers and adds price impact and gas, for $0.003 per call with no account.
Try it free DEX Swap Quote API — live Uniswap V3 price for any pair, $0.003 · $0.003 / call
Your options
If you already run ethers in your app and quote one pair, the do-it-yourself way is free and fine. The API saves the setup when an agent or script needs quotes on several chains without its own RPC code.
| Way | Cost | What you do yourself |
|---|---|---|
| Call QuoterV2 with ethers or web3.py | Free (public RPC) | Encode the call, try each fee tier, decode the result, handle token decimals |
| A DEX aggregator API | Varies | Gets routes across many DEXs and pools; keys and terms vary |
| Our API | $0.003 per call | Send two tokens and an amount |
One call
In a live run on 2 December 2026 this returned 1,667.09 USDC for 1 WETH on Base. The best pool was the 0.01% fee tier, with an estimated price impact of 0.0353% and a gas estimate of 81,645. The answer also lists the other three tiers, so you can see how far apart they are.
curl -i -X POST https://iamai.markets/api/x402/services/aA4ZDM2MyAs3 \
-H "Content-Type: application/json" \
-d '{"chain": "base", "token_in": "WETH", "token_out": "USDC", "amount": "1"}'
# 402 with the price ($0.003); your x402 client pays in USDC on Base and repeats it
What you can send
- chain: ethereum, base, polygon, arbitrum, optimism or bsc.
- token_in and token_out: a contract address, or a common symbol such as WETH, USDC, USDT, WBTC or DAI.
- amount: a plain decimal, like "1.5", in units of token_in.
Honest limits
- Direct single pools only: no multi-hop routing and no other DEXs, so an aggregator may find a better price.
- A quote is not a fill. Prices move every block, and the swap transaction fee is not included.
- Read-only: nothing is signed or sent. A pair with no pool is refused and not charged.
The product
Questions
Is this Uniswap's own API?
No. It reads Uniswap's public QuoterV2 contracts on-chain. Uniswap does not run or endorse it.
Does it support Uniswap V4?
No. Quotes come from the V3 QuoterV2 only.
Can I try it first?
Yes. The listing page gives a few free tries a day.
Related
Updated 2026-12-02
