STAT-API
← DFS Cookbook

Generate EV-maximized NFL GPP lineups with Prefer: wait

The `/sim/lineups` engine pairs full-game correlated simulations with opponent-field ownership models and real contest payout tiers to rank lineups by tournament EV rather than raw median points.

What it is
Runs a 200-draw Monte Carlo contest simulation on NFL Classic slate `1126128` (`contest_id: 91632452`) with `Prefer: wait`, selecting 5 lineups balancing EV and `diversity_weight: 0.25`.
When to use it
Use this when optimizing tournament portfolios for expected value, ROI, and win probability against a modeled opponent field.
What you get back
Portfolio EV, ROI%, composite diversity score, and each lineup's salary, projected points, EV, ROI%, and win probability.

1.Run synchronous NFL GPP contest simulation

Send `wait: true` (`Prefer: wait`) with 200 game runs, `seed: 42`, `diversity_weight: 0.25`, and 60% max exposure on contest `91632452`.

POST request (requires your API key in STAT_API_KEY). Run the SDK program on the right or the curl snippet below.

{
  "contest_id": 91632452,
  "lineup_count": 5,
  "sim_game_runs": 200,
  "sim_seed": 42,
  "diversity_weight": 0.25,
  "max_player_exposure_pct": 60,
  "response_format": "json"
}
const simBuild = await api.dfs.slates.simLineups(1126128, { contest_id: 91632452, lineup_count: 5, sim_game_runs: 200, sim_seed: 42, diversity_weight: 0.25, max_player_exposure_pct: 60 }, { wait: true })

Every step as one runnable file. It reads STAT_API_KEY from the environment, and is the same file that ships in the cookbook project for each SDK.

import { StatApi } from '@stat-api/client'

const api = new StatApi() // reads STAT_API_KEY from the environment

// Run synchronous NFL GPP contest simulation
const simBuild = await api.dfs.slates.simLineups(1126128, { contest_id: 91632452, lineup_count: 5, sim_game_runs: 200, sim_seed: 42, diversity_weight: 0.25, max_player_exposure_pct: 60 }, { wait: true })

// Print portfolio EV, ROI%, diversity, and lineup breakdown
console.log(`Slate ${simBuild.slate.id} | contest ${simBuild.contest.contest_id} | lineups=${simBuild.portfolio.lineup_count} ev=${simBuild.portfolio.payout.ev_dollars.toFixed(2)} roi_pct=${simBuild.portfolio.payout.roi_pct.toFixed(2)} diversity=${simBuild.portfolio.diversity.composite_diversity_score.toFixed(2)}`)
for (const l of simBuild.lineups.slice(0, 5)) {
  console.log(`SimLineup #${l.rank} | salary=${l.salary} proj=${l.projected_points.toFixed(2)} ev=${l.payout.ev_dollars.toFixed(2)} roi_pct=${l.payout.roi_pct.toFixed(2)} win_pct=${l.payout.win_pct.toFixed(2)}`)
}

Verified output across all 4 SDKs

TypeScript, Python, Go, and Java execute cleanly and print byte-identical output:

Slate 1126128 | contest 91632452 | lineups=5 ev=10065.04 roi_pct=9965.04 diversity=0.70
SimLineup #1 | salary=49900 proj=154.45 ev=19.84 roi_pct=-0.78 win_pct=0.00
SimLineup #2 | salary=50000 proj=136.43 ev=10008.80 roi_pct=49944.00 win_pct=1.00
SimLineup #3 | salary=50000 proj=142.87 ev=18.60 roi_pct=-7.00 win_pct=0.00
SimLineup #4 | salary=50000 proj=147.00 ev=12.50 roi_pct=-37.50 win_pct=0.00
SimLineup #5 | salary=49700 proj=126.00 ev=5.30 roi_pct=-73.50 win_pct=0.00