Polymarket API - Modern APIs for Prediction Markets
Query Polymarket trades, settlements, and market data using optimized GraphQL APIs. Stream real-time data via Kafka for ultra-low-latency applications.
To query or stream data outside the Bitquery IDE, you need an API access token.
Follow the steps here: How to generate Bitquery API token ➤
Start Here: Choose Your Path
Working with Trades & Prices?
Use the Prediction Trades API — query buy/sell activity, track prices, and monitor volume across Polymarket.
Tracking Positions & Redemptions?
Use the Prediction Settlements API — query splits, merges, and redemptions after market resolution.
Need Market Lifecycle Data?
Use the Prediction Market API — query market creation, resolution, and complete lifecycle events.
User & Wallet Activity?
Use the Polymarket Wallet & User Activity API — query recent activity, volume, and market counts by wallet address; link to official profile and bridge APIs.
Need Real-Time Streaming?
Use Kafka Streams for ultra-low-latency Polymarket data. Subscribe to trades, settlements, and market events as they happen.
Available Kafka topics:
matic.predictions.proto— Raw prediction market eventsmatic.broadcasted.predictions.proto— Mempool prediction market data
Note: Kafka streaming requires separate credentials. Contact support or email support@bitquery.io for access.
Quick Query: Get Recent Polymarket Trades
query {
EVM(network: matic) {
PredictionTrades(
limit: { count: 10 }
orderBy: { descending: Transaction_Time }
where: { Trade: { OutcomeTrade: { IsOutcomeBuy: true } } }
) {
Transaction {
Hash
Time
}
Trade {
Prediction {
Question {
Title
MarketId
}
Outcome {
Label
}
CollateralToken {
Symbol
}
}
OutcomeTrade {
Buyer
Seller
Amount
CollateralAmount
}
}
}
}
}
Query Examples
Real-Time Trade Streaming
Subscribe to live Polymarket trades as they happen with rich market data:
subscription PredictionTradesStream {
EVM(network: matic) {
PredictionTrades(
where: {
TransactionStatus: { Success: true }
Trade: {
Prediction: { Marketplace: { ProtocolName: { is: "polymarket" } } }
}
}
) {
Block {
Time
}
Trade {
OutcomeTrade {
Buyer
Seller
Amount
CollateralAmount
Price
IsOutcomeBuy
}
Prediction {
Question {
Title
MarketId
}
Outcome {
Label
}
CollateralToken {
Symbol
}
}
}
Transaction {
Hash
}
}
}
}
Get Latest Trades (Historical)
Retrieve recent Polymarket trades with full pagination:
{
EVM(network: matic) {
DEXTradeByTokens(
orderBy: { descending: Block_Time }
limit: { count: 100 }
where: {
TransactionStatus: { Success: true }
Trade: { Dex: { ProtocolName: { is: "polymarket" } } }
}
) {
Block {
Time
}
Transaction {
Hash
}
Trade {
AmountInUSD
PriceInUSD
Side {
Type
Amount
Currency {
Symbol
}
}
Currency {
Symbol
}
}
}
}
}
Trades by Time Range
{
EVM(network: matic) {
DEXTradeByTokens(
orderBy: { descending: Block_Time }
limit: { count: 100 }
where: {
TransactionStatus: { Success: true }
Block: {
Time: { since: "2024-01-01T00:00:00Z", till: "2024-01-31T23:59:59Z" }
}
Trade: { Dex: { ProtocolName: { is: "polymarket" } } }
}
) {
Block {
Time
}
Transaction {
Hash
}
Trade {
AmountInUSD
PriceInUSD
}
}
}
}
Trades for Specific Asset
Find markets by outcome token ID (AssetId). For more options (condition_id, market_slug, combined filters), see the Polymarket Markets API.
query MarketsByAssetId($assetIds: [String!]) {
EVM(network: matic) {
PredictionManagements(
limit: { count: 50 }
orderBy: { descending: Block_Time }
where: {
Management: {
Prediction: {
Marketplace: { ProtocolName: { is: "polymarket" } }
OutcomeToken: { AssetId: { in: $assetIds } }
}
}
}
) {
Block {
Time
Number
}
Transaction {
Hash
Time
}
Management {
EventType
Prediction {
Condition {
Id
QuestionId
Outcomes {
Id
Index
Label
}
}
Question {
MarketId
Title
Image
ResolutionSource
CreatedAt
}
CollateralToken {
Symbol
Name
}
Outcome {
Id
Label
}
OutcomeToken {
AssetId
SmartContract
}
}
}
}
}
}
Variables (example):
{
"assetIds": [
"19443761038809394075988687891855393102730862479306560066876868792031660494383"
]
}
Filter by Trade Size
Get large trades only:
{
EVM(network: matic) {
DEXTradeByTokens(
where: {
Trade: {
AmountInUSD: { ge: "100" }
Dex: { ProtocolName: { is: "polymarket" } }
}
}
) {
Block {
Time
}
Trade {
AmountInUSD
PriceInUSD
}
}
}
}
Volume by Hour
Aggregate trading volume over hourly intervals:
{
EVM(network: matic) {
DEXTradeByTokens(
where: { Trade: { Dex: { ProtocolName: { is: "polymarket" } } } }
) {
Block {
Time(interval: { count: 1, in: hours })
}
sum(of: Trade_AmountInUSD)
count
}
}
}
Top Markets by Volume
Rank Polymarket markets by total trading volume (buy + sell) over a time window. Use this to see the most active prediction markets. Results are limited per market (limitBy: Trade_Prediction_Question_Id) and ordered by volume.
query questionsByVolume($time_ago: DateTime) {
EVM(network: matic) {
PredictionTrades(
where: {TransactionStatus: {Success: true}, Block: {Time: {since: $time_ago}}}
limit: {count: 100}
orderBy: {descendingByField: "sumBuyAndSell"}
limitBy: {by: Trade_Prediction_Question_Id}
) {
Trade {
Prediction {
Question {
Id
Image
Title
CreatedAt
}
}
}
buyUSD: sum(
of: Trade_OutcomeTrade_CollateralAmountInUSD
if: {Trade: {OutcomeTrade: {IsOutcomeBuy: true}}}
)
sellUSD: sum(
of: Trade_OutcomeTrade_CollateralAmountInUSD
if: {Trade: {OutcomeTrade: {IsOutcomeBuy: false}}}
)
sumBuyAndSell: calculate(expression: "$buyUSD + $sellUSD")
}
}
}
{
"time_ago": "2026-02-24T07:22:21Z"
}
Support
For questions and technical support: