You get events (real-world questions) and include their nested markets so
you can read outcome mints from the accounts field. If you need the data
model, review Event fields.
Filter events to focus on markets that match a given status (for
example, active vs. initialized). If you need the full status flow, see
Prediction Market Lifecycle.
If you know the asset you want (e.g., Bitcoin, SOL), the fastest approach is
to query the events endpoint directly with the seriesTickers parameter. Each
asset has a root series ticker (e.g., KXBTC for Bitcoin, KXSOL for SOL)
that covers all market types for that asset.
Get All Active Bitcoin Markets
const METADATA_API_BASE_URL = "https://dev-prediction-markets-api.dflow.net";// Use the root series ticker for the asset (e.g., KXBTC for Bitcoin)const response = await fetch( `${METADATA_API_BASE_URL}/api/v1/events?withNestedMarkets=true&seriesTickers=KXBTC&status=active`, { method: "GET", headers: { "Content-Type": "application/json", }, });if (!response.ok) { throw new Error("Failed to get events");}const data = await response.json();const events = data.events;events.forEach((event: any) => { console.log("Event:", { ticker: event.ticker, title: event.title, }); if (event.markets && event.markets.length > 0) { event.markets.forEach((market: any) => { const accountValues = Object.values(market.accounts); console.log(" Market:", { ticker: market.ticker, title: market.title, status: market.status, accounts: accountValues.map((account: any) => ({ yesMint: account.yesMint, noMint: account.noMint, })), }); }); }});
If you don’t know the series ticker for an asset, use the series endpoint
with a category and tag to find it first. For example,
/api/v1/series?category=Crypto&tags=SOL returns all series tickers that
start with KXSOL. You can then pass those tickers to the events endpoint.For broader discovery without a specific asset in mind, use the categories
and tags approach below.
Use event and series responses to extract outcome mints and filter markets.
If you only need outcome mints, you can skip to the accounts map in each
market object.