Build NFL Showdown CPT/FLEX lineups with salary leave and seat controls
Because single-game Showdown slates assign separate `slate_player_id` rows for 1.5x `CPT`/`MVP` and 1.0x `FLEX`, targeting `slate_player_id` lets you lock a specific Captain, set seat-level exposure bounds, and leave cap space via `lineup_min_salary`.
- What it is
- Optimizes 5 PIT @ CIN Showdown lineups on slate `1179681` locking Ja'Marr Chase in `CPT`, excluding kicker Chris Boswell, setting min 60% Joe Burrow (`FLEX`) and max 40% Chase Brown (`FLEX`), with a $46,500 floor.
- When to use it
- Use this on DraftKings Showdown / FanDuel Single-Game slates where distinct `slate_player_id` rows separate the 1.5x Captain multiplier seat from standard FLEX seats.
- What you get back
- Showdown diversity metrics, realized CPT/FLEX player exposures, and top ranked Showdown rosters.
1.Optimize 5 PIT @ CIN Showdown Captain lineups
Lock `CPT` `slate_player_id` `44296671`, exclude `44296708`, and apply seat-level exposure bounds on slate `1179681`.
POST request (requires your API key in STAT_API_KEY). Run the SDK program on the right or the curl snippet below.
{
"lineup_count": 5,
"lineup_min_salary": 46500,
"lineup_allow_defense_vs_offense": true,
"diversity_weight": 0.35,
"min_unique_players": 2,
"max_player_exposure_pct": 80,
"players": [
{
"slate_player_id": 44296671,
"lock": true
},
{
"slate_player_id": 44296708,
"exclude": true
},
{
"slate_player_id": 44296679,
"min_exposure_pct": 60
},
{
"slate_player_id": 44296690,
"max_exposure_pct": 40
}
],
"response_format": "json"
}const showdownRes = await api.dfs.slates.optimizerLineups(1179681, { lineup_count: 5, lineup_min_salary: 46500, lineup_allow_defense_vs_offense: true, diversity_weight: 0.35, min_unique_players: 2, max_player_exposure_pct: 80, players: [{ slate_player_id: 44296671, lock: true }, { slate_player_id: 44296708, exclude: true }, { slate_player_id: 44296679, min_exposure_pct: 60 }, { slate_player_id: 44296690, max_exposure_pct: 40 }] })The complete program
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
// Optimize 5 PIT @ CIN Showdown Captain lineups
const showdownRes = await api.dfs.slates.optimizerLineups(1179681, { lineup_count: 5, lineup_min_salary: 46500, lineup_allow_defense_vs_offense: true, diversity_weight: 0.35, min_unique_players: 2, max_player_exposure_pct: 80, players: [{ slate_player_id: 44296671, lock: true }, { slate_player_id: 44296708, exclude: true }, { slate_player_id: 44296679, min_exposure_pct: 60 }, { slate_player_id: 44296690, max_exposure_pct: 40 }] })
// Print Showdown exposures and ranked rosters
const p = showdownRes.portfolio
const excl = showdownRes.diagnostics.excluded?.by_caller ?? 0
const shortfalls = (p.min_exposure_shortfalls ?? []).length
console.log(`Slate ${showdownRes.slate.id} (${showdownRes.slate.league}/${showdownRes.slate.operator}) | source=${showdownRes.source.name} lineups=${p.lineup_count} unique=${p.unique_players} mean_pts=${p.mean_projected_points.toFixed(2)}`)
console.log(`Diversity pds=${p.diversity.composite_diversity_score.toFixed(2)} overlap=${p.mean_pairwise_overlap.toFixed(2)} max_overlap=${p.diversity.max_pair_overlap} eff_shannon=${p.diversity.effective_players_shannon.toFixed(2)} excluded=${excl} shortfalls=${shortfalls}`)
const sortedExps = [...p.exposures].sort((a, b) => b.lineups - a.lineups || a.slate_player_id - b.slate_player_id)
for (const e of sortedExps.slice(0, 8)) {
console.log(`Exposure ${e.name ?? ''} (${e.team ?? ''}) | lineups=${e.lineups}/${p.lineup_count} pct=${e.exposure_pct.toFixed(2)}%`)
}
for (const l of showdownRes.lineups.slice(0, 3)) {
console.log(`Lineup #${l.rank} | salary=${l.salary} pts=${l.projected_points.toFixed(2)} stack=${l.stack.summary}`)
}Verified output across all 4 SDKs
TypeScript, Python, Go, and Java execute cleanly and print byte-identical output:
Slate 1179681 (nfl/draftkings) | source=STAT_API_LATEST lineups=5 unique=12 mean_pts=100.57
Diversity pds=0.57 overlap=3.40 max_overlap=4 eff_shannon=10.28 excluded=1 shortfalls=0
Exposure Ja'Marr Chase (CIN) | lineups=5/5 pct=100.00%
Exposure Joe Burrow (CIN) | lineups=4/5 pct=80.00%
Exposure Aaron Rodgers (PIT) | lineups=4/5 pct=80.00%
Exposure Evan McPherson (CIN) | lineups=4/5 pct=80.00%
Exposure Darnell Washington (PIT) | lineups=3/5 pct=60.00%
Exposure Chase Brown (CIN) | lineups=2/5 pct=40.00%
Exposure Rico Dowdle (PIT) | lineups=2/5 pct=40.00%
Exposure Dohnte Meyers (CIN) | lineups=2/5 pct=40.00%
Lineup #1 | salary=49900 pts=102.72 stack=CPT WR (CIN) · 4 CIN / 2 PIT
Lineup #2 | salary=49900 pts=101.69 stack=CPT WR (CIN) · 4 CIN / 2 PIT
Lineup #3 | salary=49900 pts=100.92 stack=CPT WR (CIN) · 4 CIN / 2 PIT