Skip to main content
Use the hosted API to find a token pair and create an executable WETH-to-USDC quote on Ethereum. The catalogue endpoints are public; quote endpoints require an API key.

Before you start

Create an API key in the uatu console, then store it in an environment variable:
Keep your API key on the server. Do not commit it or expose it in browser or mobile application code.
All requests below use the hosted API at https://api.uatu.dev.

1. Choose a chain

GET /blockchains returns every supported chain and its token definitions. This endpoint does not require authentication.
Every response uses the same envelope: code mirrors the HTTP status, message describes the result, and data contains the payload. Here is the Ethereum entry, shortened for clarity:
Save the chain’s chainId. For this Ethereum swap, use 1 for both originChainId and destinationChainId in the quote request.

2. Choose the tokens

Filter the token catalogue by the selected chain. Omit chainId to list tokens on every chain.
The response’s data field is an array:
You need each token’s address for the quote. Keep decimals as well: raw amounts in the response use the token’s smallest unit.

3. Request a quote

POST /quotes prices the pair across the available DEX routes and returns the best route with ready-to-sign transaction data. Replace 0xYourRecipientAddress with the address that will receive USDC:
The first six fields are required. amount is a decimal string in the input token’s display units, so "1" means 1 WETH—not 1 wei. slippageBps is optional; 50 allows 0.5% slippage. If omitted, the server default applies. See Slippage for details.

4. Read and execute the quote

The response includes the chosen route, the minimum acceptable output, an expiry, and the transactions your wallet must submit. This representative response is shortened:
Before submitting anything:
  • Display amountOutFloat, but use the integer amount fields for on-chain logic.
  • Make sure the current Unix time is earlier than deadline; otherwise, request a new quote.
  • Submit every item in steps in order with the wallet in from, waiting for each transaction to confirm before sending the next.
  • Include a step’s value when present. Native-token swaps use it to carry the transaction’s native value.
The swap calldata enforces amountOutMinimum. If the market moves below that floor, the transaction reverts instead of filling at a worse price.

Integrate the API

Send quote steps with viem or ethers.js and handle common edge cases.

Full API reference

Review every endpoint, parameter, and response schema.