POSTCreate swap calldata

Create swap calldata

Create the calldata for a swap transaction (including wrap/unwrap) against the Uniswap Protocols. If the quote parameter includes the fee parameters, then the calldata will include the fee disbursement. The gas estimates will be more precise when the the response calldata would be valid if submitted on-chain.

npx skills add uniswap/uniswap-trading --skill swap-integration

Full swap flow integration for apps. Works with Claude Code, Cursor, and other AI coding tools.

Also available:
npx skills add uniswap/uniswap-driver --skill swap-planner
Get a QuoteThis endpoint requires a quote response from the Quote API.

Authorization

x-api-keystringrequiredheader
Playground key
You're using a shared playground keyCreate a free account and get your own API keys from the dashboard.
Get your keys

Headers

x-universal-router-versionenumdefault:2.0
1.22.02.1.1

The version of the Universal Router to use for the swap journey. *MUST* be consistent throughout the API calls.

x-permit2-disabledbooleandefault:false

Disables the Permit2 approval flow. When set to true, permitData is returned as null and the header is forwarded to the routing layer for correct gas simulation against the Proxy Universal Router contract. When false or omitted, the standard Permit2 approval flow is used. This header is intended for integrators whose infrastructure uses a direct approval-then-swap pattern without Permit2.

Body

application/json
signaturestring

The signed permit.

includeGasInfobooleandefault:false

Use refreshGasPrice instead.

refreshGasPricebooleandefault:false

If true, the gas price will be re-fetched from the network.

simulateTransactionbooleandefault:false

If true, the transaction will be simulated. If the simulation results on an onchain error, endpoint will return an error.

permitDataunknown
safetyModeenum
SAFE

Swap safety mode will automatically sweep the transaction for the native token and return it to the sender wallet address. This is to prevent accidental loss of funds in the event that the token amount is set in the transaction value instead of as part of the calldata.

deadlinenumber

The unix timestamp at which the order will be reverted if not filled.

urgencyenumdefault:urgent
normalfasturgent

The urgency impacts the estimated gas price of the transaction. The higher the urgency, the higher the gas price, and the faster the transaction is likely to be selected from the mempool. The default value is urgent.