In this recipe, we’ll show you how to use
There are two levels of discovery: events (containers that group related markets, like “2024 Presidential Election”) and markets (individual binary questions, like “Will candidate X win?”). A third query,
filterPredictionEvents and filterPredictionMarkets to build discovery pages for prediction markets: filterable, sortable lists that let users browse what’s trending, search by topic, and find markets that match specific criteria.There are two levels of discovery: events (containers that group related markets, like “2024 Presidential Election”) and markets (individual binary questions, like “Will candidate X win?”). A third query,
filterPredictionTraders, powers trader leaderboards and is covered in the Prediction Traders recipe.Step 1: Browse the Category Taxonomy
Before building filters, fetch the full category tree so you can populate category dropdowns and sidebar navigation. Categories are nested up to 5 levels deep (e.g., Sports > Football > NFL).Fetch all prediction categories
Fetch all prediction categories
Step 2: Discover Trending Events
Events are the primary discovery unit. They group related markets together (e.g., “2024 Presidential Election” contains markets for each candidate, state, etc.). UsefilterPredictionEvents to build sortable, filterable event lists.
Trending events on Polymarket
Trending events on Polymarket
High-volume sports events
High-volume sports events
Search events by keyword
Search events by keyword
Scoring explained (events):
trendingScore24hcombines volume, trades, and momentum, making it best for “what’s hot right now”relevanceScore24hfactors in liquidity and market maturity, making it best for “most important”competitiveScore24his only available on markets (viafilterPredictionMarkets), not events, since competitiveness measures how close a market’s outcomes are to each other.
relatedEventIds to build “Related Events” sections.Step 3: Discover Individual Markets
For more granular discovery, filter at the individual market level withfilterPredictionMarkets. This is useful for showing specific binary questions across events, or building market-level leaderboards.
Most competitive open markets (closest to 50/50)
Most competitive open markets (closest to 50/50)
Markets within a specific event, ranked by probability
Markets within a specific event, ranked by probability
Use event IDs from the events query above (e.g.,
event.id).High open-interest markets closing soon
High open-interest markets closing soon
Market-level vs outcome-level ranking: Use
attribute for market-wide metrics (volume, trending score) or outcome + outcomeAttribute for outcome-specific metrics (best ask price, liquidity per outcome).bestAskCTis the implied probability when collateral is a stablecoin (0.65 = 65% chance)spreadCT=bestAskCT - bestBidCT. Tighter spreads indicate more efficient marketspriceCompetitivenessmeasures how close outcome prices are to each othervolumeImbalance24hshows buy/sell pressure asymmetry
Step 4: Building Filter UIs
Combine the above into a practical filter interface: Category navigation: UsepredictionCategories to build sidebar/tabs, pass selected slug into filters.categories
Status tabs: OPEN | RESOLVED | all. Map to filters.status using PredictionEventStatus values
Sort dropdown: map user-friendly labels to ranking attributes:
- “Trending” →
trendingScore24hDESC - “Most Volume” →
volumeUsd24hDESC - “Most Liquidity” →
liquidityUsdDESC - “Newest” →
ageASC - “Closing Soon” →
closesAtASC (with status OPEN filter) - “Most Competitive” →
competitiveScore24hDESC (markets only, viafilterPredictionMarkets)
offset and limit for page-based navigation. count in the response gives the total matching results.
Step 5: Combining Events and Markets
The recommended pattern for a discovery page that shows events with their top markets inline:- Fetch events with
filterPredictionEvents(gives youmarketCountand basic market IDs) - For each displayed event, fetch market pricing with
filterPredictionMarkets(eventIds: [eventId])ranked byoutcome0.bestAskCTDESC - Display as: Event card → list of markets with Yes/No prices
Check out related endpoints in their respective API reference pages: