STAT-API

DFS lineups API

lineupsdfs.lineupsbeta
Generate simulated or projection-optimal DFS lineups for a slate or specific contest, and poll async simulation jobs.
POST/api/v1/dfs/slates/{slate_id}/optimizer/lineupsbeta

Build 1-500 contest-ready DFS lineups using game simulations and real contest payout curves (default) or fast projection optimization. Every body field is optional — send {} for 20 optimal GPP lineups.

Path Parameter
slate_idbigintrequiredThe slate ID (dfs.slates.id).
Request Body (JSON)

Basics

Lineup count, scoring mode, contest target, and output format.

count
integer
20
Number of lineups to build.
1–500
mode
string
sim
"sim" uses full game simulations and contest payouts; "ev" runs faster warm EV pricing; "optimizer" optimizes projections directly (<300ms).
simevoptimizer
contest_type
string
gpp_large
Contest format to optimize for (omit when targeting a specific contest_id).
gpp_largeflagship20maxgpp_smallsingle_entryhigh_dollarcash
contest_id
bigint
Flagship GPP
Specific contest (dfs.contests.id) whose real payout curve, field size, and max entries to target.
format
string
json
Return JSON or a DraftKings/FanDuel upload-ready CSV (Pro+).
jsoncsv

Players & Stacks

Per-player locks, fades, custom projections/ownership, stacks, and group rules.

players
object[]
—
Per-player locks, excludes, exposure caps, custom projections, or ownership overrides.
stacks
object[]
—
Team and game stacking rules (e.g. QB + 2 WRs + opposing WR bring-back). Pass [] for no forced stacks.
groups
object[]
—
Group rules: play players together, allow at most 1 of a set (min_players: 0, max_players: 1), or require N from a pool.
liked_only
boolean
false
Build lineups using only players marked like:true or lock:true.
exclude_teams
string[]
—
Exclude all players from these team abbreviations (e.g. ["NYJ", "CAR"]).
exclude_games
integer[]
—
Exclude all players from these game IDs.
allow_offense_vs_dst
boolean
false
NFL only: allow pairing a team defense against opposing offensive players.

Portfolio & Rules

Portfolio style, diversity, exposure caps, uniqueness, salary bounds, and sorting.

style
string
balanced
Portfolio shape: "balanced" (core + leverage), "concentrated" (tighter core), or "contrarian" (wider low-owned leverage).
balancedconcentratedcontrarian
diversity
number
0
Spread exposure across more players and stacks (0.0 = max EV/points; 0.2-0.35 = 20-max; 0.5+ = 150-max).
0.0–1.0
max_exposure
number
100
Global max % of lineups any unlocked player can appear in.
1–100
min_uniques
integer
1
Minimum number of players that must differ between any two lineups.
1–9
min_salary
integer
—
Minimum total salary per lineup in dollars (e.g. leave salary open in Showdown).
max_salary
integer
—
Maximum total salary per lineup in dollars (defaults to site cap).
max_players_per_team
integer
—
Maximum players from any single team in one lineup.
flex_positions
string[]
—
Restrict positions allowed in FLEX / UTIL slots (e.g. ["WR", "TE"]).
sort_by
string
roi
Metric used to rank and pick lineups (defaults to "projected_points" in "optimizer" mode).
roievwin_ratetop_1_pcttop_01_pctcash_rateprojected_pointsp90sharpe
Example Request
curl -sS --compressed -X POST \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -H 'Prefer: wait' \
  'https://api.stat-api.com/api/v1/dfs/slates/1045169/optimizer/lineups' \
  -d '{
  "count": 20,
  "contest_type": "gpp_large"
}'

Looking for stacks, player locks, custom projections, game scenarios, or late swap? Open the DFS Lineup Generation Cookbook →

Responses
200Generate simulated or projection-optimal DFS lineups for a slate.application/jsonshow example ▸
202Async job queued — poll GET /api/v1/dfs/jobs/{job_id} until complete.application/json
400Invalid parameter, unknown field name, query string on POST, or conflicting options.
402CSV export (format="csv") requires a Pro or Elite plan.
404Slate not found.
405Any HTTP method other than POST.
503Server busy — retry after the Retry-After header seconds.
Response Schema(19 fields)show schema ▸
228 total fields (27 nested object/array groups)
Focus:
FieldTypeReferencesDescription
mode
string—Execution mode that produced this response (`"sim"`, `"ev"`, or `"optimizer"`).
strategy_summary
objectnullable—Active strategy explanation, model receipt, and locked-holdout evidence when built with a strategy. Omitted when `strategy: "none"`.
applied_settings
objectnullable—Transparent receipt of exact effective settings applied (`mode`, `strategy`, `lineup_count`, salary/exposure/uniqueness/risk/ownership knobs, `stack_rule_count`) and `caller_overrides[]` listing every Tier-2 field that overrode strategy defaults.
slate
object—The slate.
contest
objectnullable—The contest that priced the lineups (omitted in `mode: "fast"`).
contest_targets
objectnullable—Projected Contest Score Targets (`cash_line`, `winning_score`, `top_10_pct_score`, `top_5_pct_score`, `top_1_pct_score`, `top_01_pct_score`, `points_gap_win_to_cash`) matching `/score-targets` verbatim.
source
object—The source of the candidates' projections: `SIM` by default in `sim` mode, `STAT_API_LATEST` in `fast` mode, or `caller` for custom `players[].projected_points`.
sim
objectnullable—Simulation metadata, draw partitions, cache status, and reusable `pool_id` (omitted in `mode: "fast"`).
rules
object—Canonical echo of all effective request inputs with defaults filled in.
warnings
listnullable—Non-fatal notes (`W_LOCK_OVERRIDES_GLOBAL_CAP`, `W_PLAYER_MIN_OVERRIDES_GLOBAL_CAP`, `W_STRATEGY_YIELDED_SALARY`, `W_STRATEGY_YIELDED_UNIQUES`, `W_POLICY_CONSTRAINT_RELAXED`, `W_SIM_UNAVAILABLE_FAST_FALLBACK`, `W_COUNT_ABOVE_ENTRY_CAP`, `W_SCENARIO_WEIGHTS_LOW_ESS`, etc.). Absent when empty.
games
listnullable—Simulated games on the slate with live weighted NFL & NBA skill `correlations` and built-in/custom `scenarios[]` (omitted in `mode: "fast"` and `compact: true`).
player_pool
list—Every eligible pool row on the slate (trimmed to referenced players when `compact: true`). Lineups reference rows by `slate_player_id`.
portfolio
object—Portfolio-level summary: EV, ROI, finish rates, exposures, min-exposure shortfalls, and mathematical diversity metrics.
lineups
list—Ranked lineups in portfolio selection order.
opponent_field
objectnullable—Simulated contest opponent field composition, top stacks, and sample lineups (omitted in `mode: "fast"`).
diagnostics
object—Pool sizes, exclusion breakdown, timings (milliseconds), and candidate funnel summary.
frontier
list<object>nullable—Present on `pool_id` re-selection (`PortfolioSelectResponse`) when `include_diversity_frontier: true`; 4-point EV vs Portfolio Diversity Pareto frontier.
patched_upload_csv
stringnullable—Present in late-swap mode for paid responses when `entries_csv` was uploaded; 1:1 patched Contest Entries CSV preserving Entry ID, Contest Name, Contest ID, and Fee.
_metadata
objectnullable—Preview envelope (`is_preview`, `preview_limit: 5`, `total_available`, `required_tier`, `required_plan`) for callers without a paid DFS/Pro plan. Absent on paid responses.
POST/api/v1/dfs/contests/{contest_id}/optimizer/lineupsbeta

Build 1-500 lineups priced against this contest's exact payout ladder, field size, and entry cap. Every body field is optional — send {} for optimal lineups tailored to this contest.

Path Parameter
contest_idbigintrequiredThe contest ID (dfs.contests.id).
Request Body (JSON)

Basics

Lineup count, scoring mode, contest target, and output format.

count
integer
20
Number of lineups to build.
1–500
mode
string
sim
"sim" uses full game simulations and contest payouts; "ev" runs faster warm EV pricing; "optimizer" optimizes projections directly (<300ms).
simevoptimizer
contest_id
bigint
—
Optional body copy of the path contest_id (must match if provided).
format
string
json
Return JSON or a DraftKings/FanDuel upload-ready CSV (Pro+).
jsoncsv

Players & Stacks

Per-player locks, fades, custom projections/ownership, stacks, and group rules.

players
object[]
—
Per-player locks, excludes, exposure caps, custom projections, or ownership overrides.
stacks
object[]
—
Team and game stacking rules (e.g. QB + 2 WRs + opposing WR bring-back). Pass [] for no forced stacks.
groups
object[]
—
Group rules: play players together, allow at most 1 of a set (min_players: 0, max_players: 1), or require N from a pool.
liked_only
boolean
false
Build lineups using only players marked like:true or lock:true.
exclude_teams
string[]
—
Exclude all players from these team abbreviations (e.g. ["NYJ", "CAR"]).
exclude_games
integer[]
—
Exclude all players from these game IDs.
allow_offense_vs_dst
boolean
false
NFL only: allow pairing a team defense against opposing offensive players.

Portfolio & Rules

Portfolio style, diversity, exposure caps, uniqueness, salary bounds, and sorting.

style
string
balanced
Portfolio shape: "balanced" (core + leverage), "concentrated" (tighter core), or "contrarian" (wider low-owned leverage).
balancedconcentratedcontrarian
diversity
number
0
Spread exposure across more players and stacks (0.0 = max EV/points; 0.2-0.35 = 20-max; 0.5+ = 150-max).
0.0–1.0
max_exposure
number
100
Global max % of lineups any unlocked player can appear in.
1–100
min_uniques
integer
1
Minimum number of players that must differ between any two lineups.
1–9
min_salary
integer
—
Minimum total salary per lineup in dollars (e.g. leave salary open in Showdown).
max_salary
integer
—
Maximum total salary per lineup in dollars (defaults to site cap).
max_players_per_team
integer
—
Maximum players from any single team in one lineup.
flex_positions
string[]
—
Restrict positions allowed in FLEX / UTIL slots (e.g. ["WR", "TE"]).
sort_by
string
roi
Metric used to rank and pick lineups (defaults to "projected_points" in "optimizer" mode).
roievwin_ratetop_1_pcttop_01_pctcash_rateprojected_pointsp90sharpe
Example Request
curl -sS --compressed -X POST \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -H 'Prefer: wait' \
  'https://api.stat-api.com/api/v1/dfs/contests/81183052/optimizer/lineups' \
  -d '{
  "count": 20
}'

Looking for stacks, player locks, custom projections, game scenarios, or late swap? Open the DFS Lineup Generation Cookbook →

Responses
200Generate DFS lineups calibrated to a specific contest's payouts and field size.application/jsonshow example ▸
202Async job queued — poll GET /api/v1/dfs/jobs/{job_id} until complete.application/json
400Invalid parameter, unknown field name, query string on POST, or conflicting options.
402CSV export (format="csv") requires a Pro or Elite plan.
404Contest not found.
405Any HTTP method other than POST.
503Server busy — retry after the Retry-After header seconds.
Response Schema(19 fields)show schema ▸
228 total fields (27 nested object/array groups)
Focus:
FieldTypeReferencesDescription
mode
string—Execution mode that produced this response (`"sim"`, `"ev"`, or `"optimizer"`).
strategy_summary
objectnullable—Active strategy explanation, model receipt, and locked-holdout evidence when built with a strategy. Omitted when `strategy: "none"`.
applied_settings
objectnullable—Transparent receipt of exact effective settings applied (`mode`, `strategy`, `lineup_count`, salary/exposure/uniqueness/risk/ownership knobs, `stack_rule_count`) and `caller_overrides[]` listing every Tier-2 field that overrode strategy defaults.
slate
object—The slate.
contest
objectnullable—The contest that priced the lineups (omitted in `mode: "fast"`).
contest_targets
objectnullable—Projected Contest Score Targets (`cash_line`, `winning_score`, `top_10_pct_score`, `top_5_pct_score`, `top_1_pct_score`, `top_01_pct_score`, `points_gap_win_to_cash`) matching `/score-targets` verbatim.
source
object—The source of the candidates' projections: `SIM` by default in `sim` mode, `STAT_API_LATEST` in `fast` mode, or `caller` for custom `players[].projected_points`.
sim
objectnullable—Simulation metadata, draw partitions, cache status, and reusable `pool_id` (omitted in `mode: "fast"`).
rules
object—Canonical echo of all effective request inputs with defaults filled in.
warnings
listnullable—Non-fatal notes (`W_LOCK_OVERRIDES_GLOBAL_CAP`, `W_PLAYER_MIN_OVERRIDES_GLOBAL_CAP`, `W_STRATEGY_YIELDED_SALARY`, `W_STRATEGY_YIELDED_UNIQUES`, `W_POLICY_CONSTRAINT_RELAXED`, `W_SIM_UNAVAILABLE_FAST_FALLBACK`, `W_COUNT_ABOVE_ENTRY_CAP`, `W_SCENARIO_WEIGHTS_LOW_ESS`, etc.). Absent when empty.
games
listnullable—Simulated games on the slate with live weighted NFL & NBA skill `correlations` and built-in/custom `scenarios[]` (omitted in `mode: "fast"` and `compact: true`).
player_pool
list—Every eligible pool row on the slate (trimmed to referenced players when `compact: true`). Lineups reference rows by `slate_player_id`.
portfolio
object—Portfolio-level summary: EV, ROI, finish rates, exposures, min-exposure shortfalls, and mathematical diversity metrics.
lineups
list—Ranked lineups in portfolio selection order.
opponent_field
objectnullable—Simulated contest opponent field composition, top stacks, and sample lineups (omitted in `mode: "fast"`).
diagnostics
object—Pool sizes, exclusion breakdown, timings (milliseconds), and candidate funnel summary.
frontier
list<object>nullable—Present on `pool_id` re-selection (`PortfolioSelectResponse`) when `include_diversity_frontier: true`; 4-point EV vs Portfolio Diversity Pareto frontier.
patched_upload_csv
stringnullable—Present in late-swap mode for paid responses when `entries_csv` was uploaded; 1:1 patched Contest Entries CSV preserving Entry ID, Contest Name, Contest ID, and Fee.
_metadata
objectnullable—Preview envelope (`is_preview`, `preview_limit: 5`, `total_available`, `required_tier`, `required_plan`) for callers without a paid DFS/Pro plan. Absent on paid responses.
GET/api/v1/dfs/jobs/{job_id}beta
Parameters
job_idpathstringrequired
Job identifier returned by a `202 Accepted` response (`job_id` / `poll_url`, e.g. `simjob_slate_1045169_1764000000_1`).
Restores the documented defaults (trial keys only accept the unchanged defaults).
Request
curl -sS --compressed \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  'https://api.stat-api.com/api/v1/dfs/jobs/simjob_slate_1045169_1764000000_1'
Responses
200Poll an async DFS optimizer or score-targets jobapplication/jsonshow example ▸
202Job is still `"queued"` or `"running"`. Returns `SimJobStatusResponse` with `Retry-After` and `Location` headers; poll again after `Retry-After` seconds.application/json
402Caller does not hold a paid DFS/Pro plan required to retrieve this job's completed output (e.g. CSV upload).
404Unknown or expired `job_id` (1-hour TTL, max 512 entries).
405Any HTTP method other than GET.
Response Schema(9 fields)show schema ▸
FieldTypeReferencesDescription
job_id
string—Unique async job identifier.
kind
string—Job workload kind (`"sim_lineups"`, `"sim_portfolios_select"`, `"sim_late_swap"`, or `"score_targets"`).
slate_id
bigintnullable—Slate ID associated with the job, when slate-scoped.
contest_id
bigintnullable—Contest ID associated with the job, when contest-scoped.
status
string—Current execution status while pending (`"queued"` or `"running"`). On completion, `200 OK` returns the final result payload directly instead of this envelope.
queue_position
integer—1-based queue position while `"queued"`, or `0` while `"running"`.
retry_after_seconds
integer—Recommended polling delay in seconds (also sent in the HTTP `Retry-After` response header).
poll_url
string—Relative polling path (`/api/v1/dfs/jobs/{job_id}`; also sent in the HTTP `Location` header).
error
stringnullable—Error detail if attached on status responses; worker failures replay their exact HTTP error status and JSON body.