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.0.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.
CreateSwap5792Response
object
5 properties
4 required
CreateSwap7702Request
object
7 properties
1 required
ClassicInput
object
2 properties
RequestId
string
A unique ID for the request.
Permit
object
the permit2 message object for the customer to sign to permit spending by the permit2 contract.
3 properties
gasFee
string
The total estimated gas cost of this transaction (eg. gasLimit multiplied by maxFeePerGas) in the base unit of the chain.
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…
Routing
string
The routing for the proposed transaction.
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…
tokenSymbol
string
The symbol of the token.
receiverWalletAddress
string
The wallet address which will receive the token.
Err401
object
2 properties
contractAddress
string
The address of a contract which will be used to facilitate the swap.
WrapUnwrapQuote
object
12 properties
quoteId
string
A unique ID for the quote.
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.
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…
CreateSwap7702Response
object
3 properties
2 required
GetSwapsResponse
object
2 properties
2 required
CreateSwap5792Request
object
4 properties
1 required
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…
NullablePermit
object
the permit2 message object for the customer to sign to permit spending by the permit2 contract.
3 properties
deadline
number
The unix timestamp at which the order will be reverted if not filled.
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).
Err500
object
2 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).
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
V4PoolInRoute
object
12 properties
10 required
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…
ClassicQuote
object
23 properties
TransactionFailureReason
string
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.
gasFeeUSD
string
The total estimated gas cost of this transaction (eg. gasLimit multiplied by maxFeePerGas) denominated in USDC.
minAmount
string
The minimum portion of the swap, stated in the base unit of the token, which will be output to the recipient.
TransactionRequest5792
object
7 properties
4 required
Err429
object
2 properties
bpsFee
string
A fee charged by the token specified in basis points. Field is not present if the token does not charge a fee.
tickCurrent
string
The current tick of the pool. For more information see the [Uniswap V3 Whitepaper](https://app.uniswap.org/whitepaper-v3.pdf).
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:…
ChainId
number
The unique ID of the blockchain. For a list of supported chains see the [FAQ](https://api-docs.uniswap.org/guides/faqs).
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…
TokenInRoute
object
6 properties
BridgeQuote
object
21 properties
V2PoolInRoute
object
8 properties
Err400
object
2 properties
CreateSwapResponse
object
3 properties
2 required
gasPrice
string
The cost per unit of gas.
TransactionHash
string
The unique hash of the transaction.
V3PoolInRoute
object
10 properties
V2Reserve
object
The remaining reserve of this token in the pool.
2 properties
ClassicOutput
object
3 properties
senderWalletAddress
string
The wallet address which will be used to send the token.
poolFee
string
The fee of the pool in basis points.
Err504
object
2 properties
CreateSwapRequest
object
The parameters signature and permitData should only be included if permitData was returned from /quote.
9 properties
1 required
TransactionRequest
object
9 properties
5 required
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…
UniversalRouterVersion
string
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.
gasLimit
string
The maximum units of gas that will be consumed by this transaction.
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.