Introduction
Getting Started with Uniswap APIs
What Are Uniswap APIs?
Uniswap Labs provides API endpoints which support easy integration of swapping and liquidity providing features to your application. These APIs abstract away many of the complexities of interacting with smart contracts and they allow you to leverage Uniswap’s powerful routing logic and intent-based swapping systems.
The APIs have two main feature groups:
- Swapping: Swapping is the ability to swap one token for another token (e.g. trade), to bridge a token from one chain to another chain, and to wrap and unwrap tokens. The swapping endpoints include support for limit orders, batched actions (EIP-5792), and smart wallets (EIP-7702).
- Liquidity Providing (LPing): LPing includes the ability create, modify, and remove liquidity positions from Uniswap protocol pools, to migrate positions between protocol versions, and to claim liquidity providing fees.
Why Integrate with Uniswap APIs?
The APIs are designed for institutional and professional customers to directly integrate swapping and LPing into their existing systems. Direct integration can support a UI, for example to support LPing from a wallet, or it can support a program, for example an algorithmic trading bot. The benefits of integrating with the APIs include:
- Access to public, private, and off-chain liquidity through the UniswapX RFQ protocol, with high-accuracy mid-market pricing and built-in MEV protection.
- Integrated routing which finds the most cost-efficient path to perform a swap
- Request-specific generation of appropriate, validated approvals and transaction calldata.
- Access to swap and provide liquidity on thousands of swapping pairs across 13 blockchains
- Robust, scalable, and performant architecture (used to power Uniswap’s UIs) which is trusted by millions of users and hundreds of professional market participants.
How Do I Get Started?
To use the Uniswap APIs requires an API key. To get an API key, please visit https://hub.uniswap.org/ and fill out the intake form. While your intake form is processed, familiarize yourself with the workflows for token trading and liquidity staking in the following pages. All documentation for these flows, including code samples, can be found on this site.
If you are a market maker interested in filling UniswapX orders, visit our UniswapX quoter API documentation for more information.
Common Terms
Before you dive further into the documentation, there are a few terms used throughout these documents which are helpful to understand:
- Uniswap Protocols refers to the pools of liquidity created through protocol smart contracts. These are sometimes referred to as V2, V3, and V4 pools. (V1 is not supported by the APIs.) In rare instances these protocols collectively are called Classic.
- UniswapX refers to the intent-based RFQ swap mechanism. UniswapX has three versions in circulation (UniswapX, UniswapX_V2, and UniswapX_V3), although most swaps are filled through UniswapX_V2 and UniswapX_V3. UniswapX is alternately referred to as DutchQuote, DutchQuoteV2, and DutchQuoteV3 (respectively) in the API documentation. Additionally, UniswapX_V2 can be referred to as a PriorityQuote (when a UniswapX_V2 request is made on Base or Unichain chains).