Uniswap Swap API is one of 14 APIs that Uniswap publishes on the APIs.io network, described by a machine-readable OpenAPI specification.
This API exposes 6 JSON Schema definitions.
Tagged areas include Swap. The published artifact set on APIs.io includes an OpenAPI specification, API documentation, and 6 JSON Schemas.
This API exposes
4 operations
across 4 paths,
and defines 67 schemas.
It is described by OpenAPI 3.2.0, at version 1.0.0.
Requests are made against a single base URL, https://trade-api.gateway.uniswap.org/v1.
The identity and technical contract details declared by the specification.
gasFee
string
The total estimated gas cost of this transaction (eg. gasLimit multiplied by maxFeePerGas) in the base unit of the chain.
tickCurrent
string
The current tick of the pool. For more information see the [Uniswap V3 Whitepaper](https://app.uniswap.org/whitepaper-v3.pdf).
CreateSwap7702Response
object
3 properties
2 required
Err429
object
2 properties
maxFeePerGas
string
The sum of the base fee and priority fee. Subtracting maxPriorityFeePerGas from this value will yield the base fee to be paid for this transaction.
GetSwapsResponse
object
2 properties
2 required
Permit
object
the permit2 message object for the customer to sign to permit spending by the permit2 contract.
3 properties
Err400
object
2 properties
inputToken
string
The token which will be sent, specified by its token address. For a list of supported tokens, see the [FAQ](https://api-docs.uniswap.org/guides/faqs).
Err404
object
2 properties
NullablePermit
objectnull
the permit2 message object for the customer to sign to permit spending by the permit2 contract.
3 properties
liquidity
string
The amount of liquidity in the pool at a given tick. For more information see the [Uniswap V3 Whitepaper](https://app.uniswap.org/whitepaper-v3.pdf).
slippageTolerance
number
The slippage tolerance as a percentage up to a maximum of two decimal places. For Uniswap Protocols (v2, v3, v4), the slippage tolerance is the maximum amount…
WrapUnwrapQuote
object
12 properties
RequestId
string
A unique ID for the request.
ClassicInput
object
2 properties
ClassicQuote
object
23 properties
tokenAmount
string
The quantity of tokens denominated in the token's base units. (For example, for an ERC20 token one token is 1x10^18 base units. For one USDC token one token is…
V3PoolInRoute
object
10 properties
Err500
object
2 properties
V2Reserve
object
The remaining reserve of this token in the pool.
2 properties
ClassicOutput
object
3 properties
TransactionHash
string
The unique hash of the transaction.
Routing
string
The routing for the proposed transaction.
gasFeeInCurrency
string
The total estimated gas cost of this transaction (eg. gasLimit multiplied by maxFeePerGas) in the quoted currency (e.g. output token) in the base units of the…
tickSpacing
number
The width of ticks in this pool (e.g. the price range between two ticks) specified in basis points. For more information see the [Uniswap V3 Whitepaper](https:…
TradeType
string
The handling of the amount field. EXACTINPUT means the requester will send the specified amount of input tokens and get a quote with a variable quantity of out…
TransactionRequest
object
9 properties
5 required
bps
number
The portion of the swap stated in basis points. Fractional basis points are supported with up to two decimal places (e.g. 12.5).
V4PoolInRoute
object
12 properties
10 required
Err401
object
2 properties
minAmount
string
The minimum portion of the swap, stated in the base unit of the token, which will be output to the recipient.
AggregatedOutput
object
An array of all outputs of the proposed transaction. This includes the swap as well as any fees collected by the API integrator. This does not include pool fee…
5 properties
portionBips
number
The portion of the swap that will be taken as a fee stated in basis points. Fractional basis points are supported with up to two decimal places (e.g. 87.5 for…
gasPrice
string
The cost per unit of gas.
TransactionFailureReason
string
CreateSwap5792Request
object
4 properties
1 required
ChainId
number
The unique ID of the blockchain. For a list of supported chains see the [FAQ](https://api-docs.uniswap.org/guides/faqs).
V2PoolInRoute
object
8 properties
senderWalletAddress
string
The wallet address which will be used to send the token.
TransactionRequest5792
object
7 properties
4 required
gasFeeUSD
string
The total estimated gas cost of this transaction (eg. gasLimit multiplied by maxFeePerGas) denominated in USDC.
TokenInRoute
object
6 properties
BridgeQuote
object
21 properties
receiverWalletAddress
string
The wallet address which will receive the token.
portionAmount
string
The portion of the swap that will be taken as a fee in the base units of the token. The fee will be taken from the output token.
deadline
number
The unix timestamp at which the order will be reverted if not filled.
bpsFee
string
A fee charged by the token specified in basis points. Field is not present if the token does not charge a fee.
contractAddress
string
The address of a contract which will be used to facilitate the swap.
tokenSymbol
string
The symbol of the token.
UniversalRouterVersion
string
quoteId
string
A unique ID for the quote.
sqrtRatioX96
string
The square root of the ratio of the token0 and token1 in the pool, as a Q64.64 number. For more information see the [Uniswap V3 Whitepaper](https://app.uniswap…
CreateSwap7702Request
object
7 properties
1 required
CreateSwapRequest
object
The parameters signature and permitData should only be included if permitData was returned from /quote.
9 properties
1 required
Err504
object
2 properties
CreateSwap5792Response
object
5 properties
4 required
outputToken
string
The token which will be received, specified by its token address. For a list of supported tokens, see the [FAQ](https://api-docs.uniswap.org/guides/faqs).
maxPriorityFeePerGas
string
The maximum tip to the block builder. Adjusted based upon the urgency specified in the request.
CreateSwapResponse
object
3 properties
2 required
gasLimit
string
The maximum units of gas that will be consumed by this transaction.
poolFee
string
The fee of the pool in basis points.
SwapSafetyMode
string
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 o…
Urgency
string
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 b…
portionAmountReceiverAddress
string
The wallet address which will receive the fee.
The full machine-readable OpenAPI contract behind this narrative.
Other APIs Uniswap publishes across the network.