DEXScreener API Documentation - Solana Trades, Pairs, Prices
Everything you see on the DEXScreener Solana dashboard—live pairs, trades, prices, volumes, makers/buyers/sellers, and more—can be accessed via APIs/Streams with Bitquery. We expose the same on-chain data via GraphQL APIs, real-time WebSocket streams, and enterprise Kafka topics, with optional cloud connectors (AWS, GCP, Snowflake) for analytics pipelines.
Checkout our DEXScreener EVM API documentation if you are interested in getting EVM chains(Ethereum, Binance Smart Chain(BSC), Arbitrum, Base, Matic, Optimism, etc) data which DEXScreener shows.
Bitquery Solana Data Access Options
- GraphQL APIs: Query historical and real-time Solana data with flexible filtering and aggregation
- Real-time Streams: Subscribe to live Solana blockchain events via WebSocket subscriptions
- Cloud Solutions: Access Solana data through AWS, GCP, and Snowflake integrations
- Kafka Streams: High-throughput data streaming for enterprise applications
Getting Started with Solana
- Solana API Examples - Complete collection of Solana API examples
- Solana DEX Trades - Real-time DEX trading data and analytics
- Solana Subscriptions - Learn how to set up real-time data streams
- IDE for Solana - Interactive development environment for testing Solana queries
This guide shows how to retrieve the same Solana DEX data that DEXScreener displays—real-time trades, pair stats, volumes, buyers/sellers, and more—using Bitquery APIs, streams, and Kafka.
Get Trade Transactions of DEXScreener for a particular pair in realtime
The query will subscribe you to real-time trade transactions for a Solana pair, providing a continuous stream of data as new trades are processed and recorded. You can find the query here
subscription MyQuery {
Solana {
DEXTradeByTokens(
where: {Trade: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}, Side: {Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}}, Market: {MarketAddress: {is: "Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE"}}}, Transaction: {Result: {Success: true}}}
) {
Block {
Time
}
Trade {
Currency {
Name
Symbol
}
Amount
PriceAgainstSideCurrency: Price
PriceInUSD
Side {
Currency {
Name
Symbol
}
Amount
Type
}
}
Transaction {
Maker: Signer
Signature
}
}
}
}
Get Price of a Token
This query will give you the latest Price of a specified token using Trading API. Here is the saved query link
query MyQuery {
Trading {
Pairs(
where: {Token: {Id: {is: "bid:solana:So11111111111111111111111111111111111111112"}}, Interval: {Time: {Duration: {eq: 1}}}, Price: {IsQuotedInUsd: true}}
limit: {count: 10}
orderBy: {descending: Interval_Time_Start}
) {
Token {
Name
Address
Id
NetworkBid
}
Price {
Average {
Mean
Estimate
ExponentialMoving
SimpleMoving
WeightedSimpleMoving
}
Ohlc {
Open
High
Low
Close
}
}
}
}
}
Get OHLC Data for a Token Pair
This query fetches the Open, High, Low, and Close (OHLC) price data (USD-quoted) for a given token pair across DEXs, using a specified quote token and time interval (in seconds). Specify the base token and quote token contract addresses in the Token.Id and QuoteToken.Id filters. The Interval.Time.Duration field allows you to define the candle interval (e.g., 3600 for 1 hour). The query returns the most recent OHLC data for up to 10 pairs sorted by their interval start time.
You can find the query here
query MyQuery {
Trading {
Pairs(
where: {Token: {Id: {is: "bid:solana:So11111111111111111111111111111111111111112"}}, QuoteToken: {Id: {is: "bid:solana:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Interval: {Time: {Duration: {eq: 3600}}}, Price: {IsQuotedInUsd: true}}
limit: {count: 10}
orderBy: {descending: Interval_Time_Start}
) {
Token {
Name
Address
Id
NetworkBid
}
QuoteToken{
Name
Address
Id
NetworkBid
}
Price {
Average {
Mean
Estimate
ExponentialMoving
SimpleMoving
WeightedSimpleMoving
}
Ohlc {
Open
High
Low
Close
}
}
}
}
}
Buy volume, sell volume, buys, sells, makers, buyers and sellers for a pair
This is the query behind a DEXScreener pair row: total and 5-minute buy/sell volume, trade counts, unique makers, buyers and sellers, and the price at the start of the window, five minutes ago, and now.
Two things make it reliable:
since_relative/after_relativeinstead of absolute timestamps. The window is always "the last hour" and "the last 5 minutes" no matter when the query runs — a hardcoded date silently widens every day it sits in your code.Transaction: { Result: { Success: true } }drops failed transactions, which otherwise inflate trade counts and volume.
query PairStats($token: String!, $side_token: String!, $pair_address: String!) {
Solana(dataset: realtime) {
DEXTradeByTokens(
where: {
Transaction: { Result: { Success: true } }
Trade: {
Currency: { MintAddress: { is: $token } }
Side: { Currency: { MintAddress: { is: $side_token } } }
Market: { MarketAddress: { is: $pair_address } }
}
Block: { Time: { since_relative: { hours_ago: 1 } } }
}
) {
Trade {
Currency {
Name
MintAddress
Symbol
}
price_start: PriceInUSD(minimum: Block_Time)
price_5min_ago: PriceInUSD(
minimum: Block_Time
if: { Block: { Time: { after_relative: { minutes_ago: 5 } } } }
)
price_now: PriceInUSD(maximum: Block_Time)
Dex {
ProtocolName
ProtocolFamily
ProgramAddress
}
Market {
MarketAddress
}
Side {
Currency {
Symbol
Name
MintAddress
}
}
}
makers: count(distinct: Transaction_Signer)
makers_5min: count(
distinct: Transaction_Signer
if: { Block: { Time: { after_relative: { minutes_ago: 5 } } } }
)
buyers: count(distinct: Transaction_Signer, if: { Trade: { Side: { Type: { is: buy } } } })
sellers: count(distinct: Transaction_Signer, if: { Trade: { Side: { Type: { is: sell } } } })
trades: count
trades_5min: count(if: { Block: { Time: { after_relative: { minutes_ago: 5 } } } })
traded_volume: sum(of: Trade_Side_AmountInUSD)
traded_volume_5min: sum(
of: Trade_Side_AmountInUSD
if: { Block: { Time: { after_relative: { minutes_ago: 5 } } } }
)
buy_volume: sum(of: Trade_Side_AmountInUSD, if: { Trade: { Side: { Type: { is: buy } } } })
sell_volume: sum(of: Trade_Side_AmountInUSD, if: { Trade: { Side: { Type: { is: sell } } } })
buys: count(if: { Trade: { Side: { Type: { is: buy } } } })
sells: count(if: { Trade: { Side: { Type: { is: sell } } } })
}
}
}
Variables — this example uses the WSOL/USDC Orca Whirlpool, a long-lived pool that will still be there when you run it:
{
"token": "So11111111111111111111111111111111111111112",
"side_token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"pair_address": "Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE"
}
pair_addressTwo traps here.
Aggregators return an empty MarketAddress. Routers such as Jupiter, dflow and Aquifer carry large volume but expose no single pool, so filtering by Market.MarketAddress on them yields nothing. Filter on an AMM pool — Whirlpool, Raydium, PumpSwap — instead.
Memecoin pools are short-lived. A pump.fun graduate can do eight figures of volume in one hour and almost nothing an hour later, so a mint that looks ideal today may be dead by the time you copy the query. Use Get Top Pairs on Solana to find a currently active pool, then substitute its address here.
Get Top Pairs on Solana on DEXScreener
This returns the top 10 Solana pairs by trade count over the last hour, with total trades, buys, sells, traded volume and buy volume — the data behind a DEXScreener leaderboard. Use it to find a currently active pool to plug into the pair stats query above.
since_relative keeps the window rolling, so there is no date to update.
Note you cannot run this as a WebSocket subscription: aggregate functions like sum do not work in subscription.
You can find the query here
query MyQuery {
Solana {
DEXTradeByTokens(
where: {Transaction: {Result: {Success: true}}, Trade: {Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}}, Block: {Time: {since_relative: {hours_ago: 1}}}}
orderBy: {descendingByField: "total_trades"}
limit: {count: 10}
) {
Trade {
Currency {
Name
MintAddress
Symbol
}
start: PriceInUSD(minimum: Block_Time)
min5: PriceInUSD(
minimum: Block_Time
if: {Block: {Time: {after_relative: {minutes_ago: 5}}}}
)
end: PriceInUSD(maximum: Block_Time)
Dex {
ProtocolName
ProtocolFamily
ProgramAddress
}
Market {
MarketAddress
}
Side {
Currency {
Symbol
Name
MintAddress
}
}
}
makers: count(distinct:Transaction_Signer)
total_trades: count
total_traded_volume: sum(of: Trade_Side_AmountInUSD)
total_buy_volume: sum(
of: Trade_Side_AmountInUSD
if: {Trade: {Side: {Type: {is: buy}}}}
)
total_sell_volume: sum(
of: Trade_Side_AmountInUSD
if: {Trade: {Side: {Type: {is: sell}}}}
)
total_buys: count(if: {Trade: {Side: {Type: {is: buy}}}})
total_sells: count(if: {Trade: {Side: {Type: {is: sell}}}})
}
}
}
Trader-Focused Trade APIs (with USD Price, Market Cap & Supply)
The queries below use the Trades cube (Trading { Trades }) which is trader-focused and provides reliable USD prices including for all tokens. See DEXTrades vs DEXTradeByTokens vs Trades cube for when to use which.
Get All DEX Trades on Solana With Price, Market Cap, and Supply
Stream all Solana DEX trades in real time with USD price, market cap, FDV, circulating supply, and transaction fee data. Filter by Pair.Market.Network: Solana to capture every swap across Raydium, Orca, Jupiter, PumpSwap, and other Solana DEXs in a single subscription.
You can run this subscription in the Bitquery IDE.
Click to expand GraphQL query
subscription {
Trading {
Trades(where: { Pair: { Market: { Network: { is: "Solana" } } } }) {
Side
Supply {
MaxSupply
TotalSupply
FullyDilutedValuationUsd
CirculatingSupply
MarketCap
}
Trader {
Address
}
TransactionHeader {
Fee
FeePayer
Sender
To
Hash
Index
}
Amounts {
Base
Quote
}
AmountsInUsd {
Base
Quote
}
Block {
Date
Time
Timestamp
}
Pair {
Currency {
Id
Name
Symbol
}
Market {
Address
Program
Network
}
QuoteCurrency {
Id
Name
Symbol
}
Token {
Address
Id
IsNative
Symbol
TokenId
Network
}
QuoteToken {
Address
Id
IsNative
Symbol
TokenId
Network
}
}
Price
PriceInUsd
}
}
}
Top Traders by PnL for a Specific Pool (Last 30 Minutes)
Rank traders by PnL on one pool: filter Pair.Market.Address, last 30 minutes, limit: 10, and orderBy PnL descending. Useful for leaderboards, smart-money screens, and pool-specific trader analytics.
You can run this query in the Bitquery IDE.
Click to expand GraphQL query
{
Trading {
Trades(
limit: { count: 10 }
orderBy: [{ descendingByField: "PnL" }]
where: {
Block: { Time: { since_relative: { minutes_ago: 30 } } }
Pair: {
Market: {
Address: { is: "2axyccPzS7Ei57c7ESEq7tBpo4HxtpfCR9gKxh5uNUpu" }
}
}
}
) {
Trader {
Address
}
Amount_Bought: sum(of: AmountsInUsd_Base, if: { Side: { is: "Buy" } })
Amount_Sold: sum(of: AmountsInUsd_Base, if: { Side: { is: "Sell" } })
Amount_Bought_native: sum(of: Amounts_Base, if: { Side: { is: "Buy" } })
Amount_Sold_native: sum(of: Amounts_Base, if: { Side: { is: "Sell" } })
PnL: calculate(expression: "$Amount_Sold - $Amount_Bought")
buys: count(if: { Side: { is: "Buy" } })
sells: count(if: { Side: { is: "Sell" } })
}
}
}