Documentation Index Fetch the complete documentation index at: https://pond.dflow.net/llms.txt
Use this file to discover all available pages before exploring further.
Every block below is an independent example. Each one redeclares the env consts and the headers object so you can copy and run any one of them on its own.
A market is a single YES/NO question. Events group related markets (for example, an NBA game is an event containing a market for each team winning). The Metadata API lets you query either.
List markets
Query events with withNestedMarkets=true to include each event’s markets inline. Read outcome mints from each market’s accounts field (pass these as outputMint to /order when trading). See Event fields for the data model.
Get events with nested markets
import "dotenv/config" ;
const DFLOW_METADATA_API_URL = process . env . DFLOW_METADATA_API_URL ?? "https://dev-prediction-markets-api.dflow.net" ;
const DFLOW_API_KEY = process . env . DFLOW_API_KEY ; // optional; not needed for dev endpoints
const headers : HeadersInit = {};
if ( DFLOW_API_KEY ) headers [ "x-api-key" ] = DFLOW_API_KEY ;
const { events = [] } = await fetch (
` ${ DFLOW_METADATA_API_URL } /api/v1/events?withNestedMarkets=true&limit=200` ,
{ headers }
). then (( r ) => r . json ());
events . forEach (( event : any ) => {
console . log ( "Event:" , {
ticker: event . ticker ,
title: event . title ,
subtitle: event . subtitle ,
seriesTicker: event . seriesTicker ,
});
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 ,
})),
});
});
});
Filter by market status
Filter events to focus on markets that match a given status (e.g. active vs. initialized). See Prediction Market Lifecycle for the full status flow.
import "dotenv/config" ;
const DFLOW_METADATA_API_URL = process . env . DFLOW_METADATA_API_URL ?? "https://dev-prediction-markets-api.dflow.net" ;
const DFLOW_API_KEY = process . env . DFLOW_API_KEY ; // optional; not needed for dev endpoints
const headers : HeadersInit = {};
if ( DFLOW_API_KEY ) headers [ "x-api-key" ] = DFLOW_API_KEY ;
const { events = [] } = await fetch (
` ${ DFLOW_METADATA_API_URL } /api/v1/events?withNestedMarkets=true&status=active&limit=200` ,
{ headers }
). then (( r ) => r . json ());
events . forEach (( event : any ) => {
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 ,
})),
});
});
});
import "dotenv/config" ;
const DFLOW_METADATA_API_URL = process . env . DFLOW_METADATA_API_URL ?? "https://dev-prediction-markets-api.dflow.net" ;
const DFLOW_API_KEY = process . env . DFLOW_API_KEY ; // optional; not needed for dev endpoints
const headers : HeadersInit = {};
if ( DFLOW_API_KEY ) headers [ "x-api-key" ] = DFLOW_API_KEY ;
const { events = [] } = await fetch (
` ${ DFLOW_METADATA_API_URL } /api/v1/events?withNestedMarkets=true&status=initialized&limit=200` ,
{ headers }
). then (( r ) => r . json ());
events . forEach (( event : any ) => {
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 ,
})),
});
});
});
Full-text search
GET /api/v1/search?q=... returns events matching title, ticker, or nested market titles. Response shape mirrors /events.
Search events by title or ticker
import "dotenv/config" ;
const DFLOW_METADATA_API_URL = process . env . DFLOW_METADATA_API_URL ?? "https://dev-prediction-markets-api.dflow.net" ;
const DFLOW_API_KEY = process . env . DFLOW_API_KEY ; // optional; not needed for dev endpoints
const headers : HeadersInit = {};
if ( DFLOW_API_KEY ) headers [ "x-api-key" ] = DFLOW_API_KEY ;
const params = new URLSearchParams ({
q: "bitcoin" ,
withNestedMarkets: "true" ,
status: "active" ,
limit: "20" ,
});
const { events = [] } = await fetch (
` ${ DFLOW_METADATA_API_URL } /api/v1/search? ${ params } ` ,
{ headers }
). then (( r ) => r . json ());
for ( const event of events ) {
console . log ( ` ${ event . ticker } ${ event . title } ( ${ event . markets ?. length ?? 0 } markets)` );
}
Markets by series
A series groups related events. For example, a single NBA series contains an event for each game; a Bitcoin price series contains an event for each price interval. Series cover every category Kalshi supports (crypto, sports, politics, weather, entertainment, and more).
The events endpoint accepts a seriesTickers parameter that returns every event and market in that series.
Query with a known series ticker
Get all active markets in a series
import "dotenv/config" ;
const DFLOW_METADATA_API_URL = process . env . DFLOW_METADATA_API_URL ?? "https://dev-prediction-markets-api.dflow.net" ;
const DFLOW_API_KEY = process . env . DFLOW_API_KEY ; // optional; not needed for dev endpoints
const headers : HeadersInit = {};
if ( DFLOW_API_KEY ) headers [ "x-api-key" ] = DFLOW_API_KEY ;
// Pick a series ticker for your topic. Examples:
// KXBTC - Bitcoin price markets
// KXSOL - Solana price markets
// KXNBA - NBA game outcomes
const seriesTicker = "KXBTC" ;
const { events = [] } = await fetch (
` ${ DFLOW_METADATA_API_URL } /api/v1/events?withNestedMarkets=true&seriesTickers= ${ seriesTicker } &status=active` ,
{ headers }
). then (( r ) => r . json ());
events . forEach (( event : any ) => {
console . log ( "Event:" , {
ticker: event . ticker ,
title: event . title ,
});
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 ,
})),
});
});
});
Pass a comma-separated list to query multiple series at once: seriesTickers=KXBTC,KXSOL,KXNBA.
Find a series ticker by category and tag
Pass any of the resulting tickers into the events query above.
Filter series by category and tags
Calendar view
Two endpoints for date-based UIs:
GET /api/v1/calendar?date=YYYY-MM-DD: events for one day, with pricing and score data
GET /api/v1/calendar/month?month=YYYY-MM: per-date summary for month-grid views
import "dotenv/config" ;
const DFLOW_METADATA_API_URL = process . env . DFLOW_METADATA_API_URL ?? "https://dev-prediction-markets-api.dflow.net" ;
const DFLOW_API_KEY = process . env . DFLOW_API_KEY ; // optional; not needed for dev endpoints
const headers : HeadersInit = {};
if ( DFLOW_API_KEY ) headers [ "x-api-key" ] = DFLOW_API_KEY ;
const today = new Date (). toISOString (). slice ( 0 , 10 ); // "YYYY-MM-DD"
const day = await fetch (
` ${ DFLOW_METADATA_API_URL } /api/v1/calendar?date= ${ today } &category=Sports` ,
{ headers }
). then (( r ) => r . json ());
const buckets = Object . entries ( day . events ?? {});
if ( buckets . length === 0 ) {
console . log ( `No Sports events on ${ today } .` );
}
for ( const [ startTime , events ] of buckets ) {
console . log ( `-- ${ startTime } UTC --` );
for ( const event of events as any []) {
console . log ( ` ${ event . ticker } ${ event . title } ` );
}
}
Fetch a month at a glance
import "dotenv/config" ;
const DFLOW_METADATA_API_URL = process . env . DFLOW_METADATA_API_URL ?? "https://dev-prediction-markets-api.dflow.net" ;
const DFLOW_API_KEY = process . env . DFLOW_API_KEY ; // optional; not needed for dev endpoints
const headers : HeadersInit = {};
if ( DFLOW_API_KEY ) headers [ "x-api-key" ] = DFLOW_API_KEY ;
const month = "2026-04" ;
const summary = await fetch (
` ${ DFLOW_METADATA_API_URL } /api/v1/calendar/month?month= ${ month } &months=1&category=Sports` ,
{ headers }
). then (( r ) => r . json ());
for ( const [ date , milestones ] of Object . entries ( summary . dates ?? {})) {
const leagues = new Set (( milestones as any []). map (( m ) => m . league ). filter ( Boolean ));
console . log ( ` ${ date } : ${ ( milestones as any []). length } milestones, leagues: ${ [ ... leagues ]. join ( ", " ) } ` );
}
months=12 max for year-at-a-glance views.
Live events feed
GET /api/v1/live_events returns currently live sports events with score data. Live first, then upcoming and final.
import "dotenv/config" ;
const DFLOW_METADATA_API_URL = process . env . DFLOW_METADATA_API_URL ?? "https://dev-prediction-markets-api.dflow.net" ;
const DFLOW_API_KEY = process . env . DFLOW_API_KEY ; // optional; not needed for dev endpoints
const headers : HeadersInit = {};
if ( DFLOW_API_KEY ) headers [ "x-api-key" ] = DFLOW_API_KEY ;
const params = new URLSearchParams ({
category: "Sports" ,
status: "live" ,
limit: "20" ,
});
const { liveEvents = [] } = await fetch (
` ${ DFLOW_METADATA_API_URL } /api/v1/live_events? ${ params } ` ,
{ headers }
). then (( r ) => r . json ());
for ( const card of liveEvents ) {
console . log ( ` ${ card . ticker } ${ card . title } status= ${ card . status } ` );
}
Sport filters
If your UI surfaces a sport-heavy filter sidebar (NBA, NFL, MLB, etc.), GET /api/v1/filters_by_sports returns the per-sport scopes and competitions you need to render those controls.
Get per-sport filter options
import "dotenv/config" ;
const DFLOW_METADATA_API_URL = process . env . DFLOW_METADATA_API_URL ?? "https://dev-prediction-markets-api.dflow.net" ;
const DFLOW_API_KEY = process . env . DFLOW_API_KEY ; // optional; not needed for dev endpoints
const headers : HeadersInit = {};
if ( DFLOW_API_KEY ) headers [ "x-api-key" ] = DFLOW_API_KEY ;
const filtersRes = await fetch (
` ${ DFLOW_METADATA_API_URL } /api/v1/filters_by_sports` ,
{ headers }
). then (( r ) => r . json ());
console . log ( "Sport ordering:" , filtersRes . sportOrdering );
Prediction Market Quickstart Build a Kalshi prediction market integration end-to-end.
Identify a Market From a Mint Reverse-lookup a market and side from any ledger or outcome mint.
Bulk Fetch Markets Hydrate multiple markets and outcome mints in one call.
Prediction Market Data Model Events, markets, outcomes, mints, and how they relate.
API Routes