← Tools Reference

Uniswap API

Uniswap API integration (Finance, Developer Tools). Imported from open-connector.

API key3 toolshttps://trade-api.gateway.uniswap.org/v1
POST
uniswap_api_get_quote
Request a Uniswap trade quote for one wallet, token pair, and amount.

/quote

18 parameters
ParamTypeRequiredDescription
typestringrequiredHow Uniswap interprets the requested amount.
amountstringrequiredThe input or output amount in token base units.
tokenInChainIdnumberrequiredThe blockchain chain ID supported by the Uniswap Trading API.
tokenOutChainIdnumberrequiredThe blockchain chain ID supported by the Uniswap Trading API.
tokenInstringrequiredThe input token contract address.
tokenOutstringrequiredThe output token contract address.
swapperstringrequiredThe wallet address that will submit the transaction.
recipientstringoptionalThe wallet address that should receive the output token.
slippageTolerancenumberoptionalThe manual slippage tolerance percentage.
autoSlippagestringoptionalThe automatic slippage strategy supported by the public Uniswap API.
routingPreferencestringoptionalThe quote routing preference for Uniswap route selection.
protocolsarrayoptionalThe protocols Uniswap may use for routing.
urgencystringoptionalThe urgency mode used for approval or swap pricing.
permitAmountstringoptionalThe permit allowance mode included in a quote response when Permit2 is enabled.
spreadOptimizationstringoptionalThe UniswapX spread optimization strategy when applicable.
generatePermitAsTransactionbooleanoptionalWhether Permit2 should be generated as an onchain transaction instead of a sign…
enableUniversalRouterbooleanoptionalWhether to send the public x-universal-router-version header as version 2.0.
enablePermit2booleanoptionalWhether Permit2 should stay enabled. Set false to send x-permit2-disabled: true.
POST
uniswap_api_check_approval
Check whether the swapper wallet needs an ERC-20 approval transaction before swapping.

/check_approval

9 parameters
ParamTypeRequiredDescription
walletAddressstringrequiredThe wallet address that would send the token.
tokenstringrequiredThe token contract address to approve.
amountstringrequiredThe token amount that must be spendable.
chainIdnumberrequiredThe blockchain chain ID supported by the Uniswap Trading API.
urgencystringoptionalThe urgency mode used for approval or swap pricing.
includeGasInfobooleanoptionalWhether the gas-fee fields should be requested from Uniswap.
tokenOutstringoptionalThe output token address when provided for routing context.
tokenOutChainIdnumberoptionalThe blockchain chain ID supported by the Uniswap Trading API.
enablePermit2booleanoptionalWhether Permit2 should stay enabled. Set false to send x-permit2-disabled: true.
POST
uniswap_api_create_swap
Create the transaction calldata for a Uniswap swap from a prior quote and optional permit signature.

/swap

10 parameters
ParamTypeRequiredDescription
quoteobjectrequiredThe prior Uniswap quote object to convert into swap calldata.
signaturestringoptionalThe signed Permit2 signature when one is required.
permitDataobjectoptionalThe Permit2 payload returned by Uniswap when applicable.
refreshGasPricebooleanoptionalWhether Uniswap should refresh gas pricing.
simulateTransactionbooleanoptionalWhether Uniswap should simulate the transaction.
safetyModestringoptionalThe swap safety mode accepted by the /swap endpoint.
deadlinestringoptionalThe swap deadline timestamp in seconds.
urgencystringoptionalThe urgency mode used for approval or swap pricing.
enableUniversalRouterbooleanoptionalWhether to send the public x-universal-router-version header as version 2.0.
enablePermit2booleanoptionalWhether Permit2 should stay enabled. Set false to send x-permit2-disabled: true.