How to get the price of a DEX pair
A pool quote is one number from one contract at one size. Four ways to read it, and why the figure you get back is not a price anyone could have traded.
Read it from a pool indexer rather than from a node. GeckoTerminal and DEX Screener both answer without a key, DEX Screener faster and GeckoTerminal with candles; the CoinGecko API sells the same on-chain surface on a plan, and Bitquery or Dune give you the swaps underneath it. What comes back is a marginal quote in one pool, not a price you could have filled.
The short way
Ask a pool indexer, not a node. Both of the free ones answer an unauthenticated HTTP request with a pair's current price.
GET https://api.dexscreener.com/latest/dex/pairs/{chainId}/{pairId}
GET https://api.geckoterminal.com/api/v2/networks/{network}/pools/{pool_address}
DEX Screener is the quicker lookup and documents 60 requests a minute on every endpoint it publishes. GeckoTerminal is slower — its FAQ puts the public API at 30 calls a minute — and covers more ground: 228 networks and 1,978 DEXes against DEX Screener's 64 chains, and it publishes a pool OHLCV endpoint, which DEX Screener does not.
Neither needs a key, an account or a wallet. If what you want is one number for one pool right now, you are finished in one request, and the rest of this page is about why that number is not what it looks like.
What the options are
A keyless pool lookup. The two above. Use them when you have a pair or token address and want its current state — price, liquidity, 24-hour volume, buy and sell counts. GeckoTerminal when you also want a time series or a chain the other does not carry; DEX Screener when you want the answer in one call and will poll it yourself.
The same data on a plan. The CoinGecko API sells the on-chain surface — pool and token OHLCV, top token holders, wallet balances — on the same keyed ladder as its off-chain one. That is the reason to pay for it: not more pools, but one vendor, one key and one rate limit for a job that needs a pool quote sitting next to an asset price.
The swaps underneath. Bitquery answers GraphQL over decoded DEX trades, which is what you need when the summary is not the question — a particular wallet's fills, a sequence of swaps, a token's first hour. Read the retention line before you plan around it: on self-service, trades, prices and OHLC keep 30 days, and raw on-chain data keeps four hours on EVM chains and eight on Solana. Complete history is a per-chain add-on.
A query rather than a lookup. Dune has curated cross-protocol tables —
dex.trades, dex_aggregator.trades, sandwich tables, and on Solana a set with its own shape
including dex_solana.trades and Jupiter aggregator swaps. Use it when the question is
comparative or historical, and accept that you now own the definition of whatever you computed.
Where this breaks
A pool quote is not a price. It is the marginal rate for an infinitesimal trade against the
current reserves, and it is the one size nobody trades. The real price for your order is a walk
along the curve, and how far it walks is set by the pool's depth rather than by anything about the
token: in a pool holding a few tens of thousands of dollars, an ordinary order is the market
event. The quoted figure and the achievable figure diverge continuously as size grows, and nothing
in a priceUsd field tells you where that happens. If the number is going into a valuation, the
question to ask is not "what is the price" but "at what size does this stop being true".
There is no such thing as the pool. A token trades in as many pools as anyone has deployed,
on as many chains as it has been bridged to, and each one quotes independently. So every product
that prints one price per token has made a selection, and GeckoTerminal is unusually direct about
what its selection is: price_usd is the USD price of the token in the first pool listed under
top_pools. That is a ranking decision presented as a market fact. It is the same problem the
CEX side has, one layer down — where the Bitcoin price comes from
is the long version, and it applies harder here, because a pool cannot be a reference rate and a
ranking is not a methodology.
Two currencies, and one of them may be missing. DEX Screener's pair schema carries
priceNative and priceUsd separately, and priceUsd is explicitly nullable. The native figure
is what the contract quotes; the dollar figure is that number routed through somebody's estimate
of what the quote asset is worth. Every dollar price of an on-chain pair is a conversion with
another price inside it, and the inner one has the same problems as the outer one.
The quote and the fill are separated by a block. A pool's spot price is whatever the last transaction in the current block left it at, which means it can be moved and moved back within the same block by anyone who can order transactions. This is not a fringe concern: Uniswap's own documentation is built around it, describing the v3 oracle's maximum length as making "oracle price manipulation significantly more difficult, as the calling contract may cheaply construct a time-weighted average over any arbitrary range". If a contract you are writing should not read a spot tick, neither should a number you are about to publish. Read a time-weighted average, or read the trades and compute one.
Nothing here is filtered for you. GeckoTerminal will return tokens that are not on CoinGecko at all, with its own warning attached — "you need to know what you are doing since these tokens may be spams". Its GT Security Score, which carries contract verification, honeypot checks and holder concentration, is the clearest thing separating a pool table from a price feed, and it is a score rather than a guarantee. An address that quotes a price is not a token anybody wants.
If you outgrow this
If the problem is that you are polling, buy the plan rather than the pool: the CoinGecko API's on-chain endpoints exist precisely so that a production job has a key, a quota and a support address instead of a public endpoint's 30 calls a minute.
If the problem is that the number has to be defensible — it is going into a mark, a report or somebody else's screen — then stop reading pools and read trades. Bitquery and Dune both give you the swaps; the definition of the price is then yours, written down, and reproducible, which is the only form of it that survives being questioned.
If the problem is which screener to pay for, check how the tier is sold before comparing it to anything. DEX Screener is paid for by token promotion rather than by you, and two of DEXTools' three tiers are unlocked by holding the vendor's own token rather than by paying a fee — which is a cost, and not one you can put beside a monthly price. A token threshold is not a price is why.
And if the problem is chain coverage, that is the one thing the free tier does not gate: GeckoTerminal's 228 networks are free to read. What is not uniform is everything behind the pool table, which the Solana shelf and the DeFi shelf are the two clearest cases of.
The tools named above
In the order this page puts them in, which is an editorial judgement and not a ranking anyone paid for.
DEX Screener
Fastest keyless lookup by pair or token address across 64 chains, with no candle endpoint at all — current state and deltas only.
DEX pair screener and charts on 64 chains, paid for by token promotion rather than by you.
FreeFree tier
GeckoTerminal
The same shape over 228 networks and it does publish pool OHLCV, which is the largest functional difference between the two.
CoinGecko's DEX tracker — 228 networks, 1,978 DEXes, free to read, free to query slowly.
FreeFree tier
CoinGecko API
The same on-chain surface sold on a keyed plan, beside the off-chain one, when a pool price has to sit next to an asset price.
Prices, market data and onchain DEX data for 18,000+ coins, via REST, websocket or MCP.
$35/moFree tier
Bitquery
GraphQL over decoded DEX trades when the summary is not enough and you need the individual swaps behind it.
GraphQL over indexed chains — self-service plans are a real-time window, not history.
$49/mo
Dune
SQL over curated cross-protocol trade tables, including a Solana set with its own shape, when the question is a query rather than a lookup.
SQL over 100+ indexed chains, with the API on every plan including the free one.
$75/moFree tier
FAQ
Why do two DEX trackers show different prices for the same token?
Usually because they are reading different pools. GeckoTerminal's FAQ says plainly that its price_usd is the USD price of the token in the first pool listed under top_pools — so the number is one pool's quote, chosen by a ranking, not an average across venues. A token trading in six pools has six prices at every instant, and any single figure is a selection somebody made.
Can I get candles for a DEX pair?
From GeckoTerminal, yes. From DEX Screener, no — its documented API surface has no OHLCV or candle endpoint at all, only the pair's current state and its 5-minute to 24-hour deltas, so a time series has to be polled and stored yourself. That is the single largest functional difference between two products that otherwise look identical.
Is the price in USD or in the other token?
Both, and they are different claims. DEX Screener's pair schema carries priceNative as a string and priceUsd as a nullable string — the first is what the pool actually quotes, the second is that number converted through somebody's view of the quote asset. When priceUsd comes back null, nothing is broken; there was no route to a dollar figure.
Do I need an RPC node for this?
Not for a price, and using one is the expensive way to get a worse answer. A node will tell you a pool's current reserves, from which you can compute the marginal quote; it will not tell you which pool matters, what traded, or what the token is worth in dollars. Every product on this page exists because turning chain state into a market number is an indexing job, and an RPC endpoint is plumbing.
Sources
- FAQ — public API rate limit and how price_usd is determined — GeckoTerminal, read
- API Reference — endpoints, rate limits and the pair schema — DEX Screener, read
- Price oracles, Uniswap v3 concepts — Uniswap Labs, read
The catalogue next door
This page names a handful of products. The rest of them are in On-chain Analytics Platforms, each filled in against the same schema, with the fields to narrow it yourself.
Last updated . Corrected in place — an endpoint that moves is a bug on this page, not a new post.