Uniswap API (Subgraph)
Uniswap API (Subgraph)
Uniswap doesn't have traditional REST API — on-chain data is queried via The Graph's official Uniswap subgraphs (v2/v3/v4): pools, trades, liquidity, price history.
Data from world's largest DEX
No "place order API" — Uniswap is AMM; to trade, use SDK to sign on-chain transactions via wallet
Get API key from The Graph studio. POST GraphQL to Uniswap V3 subgraph endpoint.
Uptime · 30-day window
About this API
Uniswap is the largest decentralized exchange launched in 2018, pioneering the AMM (automated market maker) model — no order book; users trade against liquidity pools with price determined by token ratio (xy=k formula). Unlike centralized exchanges, Uniswap has no "API order placement" — any "trade" is a wallet-signed swap transaction on-chain. But Uniswap data queries go through The Graph's official subgraph — developers use GraphQL to query any pool, any token's swap history, TVL, APY, etc. Three versions each have a subgraph: v2 (classic AMM), v3 (concentrated liquidity, 2021), v4 (hooks, 2024). Most common developer uses: get real-time token prices as price oracle (avoid centralized oracle risk), compare Uniswap prices for arbitrage, LP yield tracking.
What you can build
- 1DeFi dashboards displaying Uniswap pool data
- 2Token price oracles (Uniswap TWAP)
- 3Arbitrage strategies comparing Uniswap vs CEX prices
- 4LP yield tracking
Strengths & limitations
Strengths
- Data from world's largest DEX
- Flexible GraphQL queries
- Subgraph data pre-aggregated (no raw event scanning needed)
Limitations
- No "place order API" — Uniswap is AMM; to trade, use SDK to sign on-chain transactions via wallet
- Subgraph has indexing lag (seconds to minutes)
Example request
curl https://uniswap.org/<endpoint> \
-H "Authorization: Bearer $API_KEY"
# Some providers use X-Api-Key instead — verify in the docs.Getting started
Get API key from The Graph studio. POST GraphQL to Uniswap V3 subgraph endpoint.
FAQ
How do I "place an order on Uniswap"?+
No API. Use Uniswap SDK (@uniswap/v3-sdk) to construct swap transactions; sign with wallet and submit on-chain.
What's the price lag?+
Subgraph typically 5-30s delay. For real-time, query pool state directly via RPC node (uniswapV3Pool.slot0(), etc.).
Technical details
- Auth type
- api_key
- Pricing
- freemium
- Rate limit
- The Graph 标准限制:100k queries/月免费
- Protocols
- GraphQL
- SDKs
- typescript, javascript, python
- Response time
- 548 ms
- Last health check
- 5/12/2026, 7:38:33 AM