Read a slate's salaries
A slate's player pool is the menu: every player you may roster, each with a salary the operator set before kickoff. This recipe pages the whole pool and ranks it by salary. Slate 129036 is a real DraftKings NFL main slate from 2025-11-30 — swap in the id the main-slate recipe prints.
- What it is
- Lists every player a slate lets you roster, with the salary the operator charged and the season average that justified it.
- When to use it
- Use it to build the menu before a lineup, to audit how an operator priced a week, or to track one player's price across a season.
- What you get back
- 500 to 700 player rows per NFL slate, each with salary, position, team, injury status, and season average points.
1.Page the whole player pool
A slate holds 500 to 700 players, which is more than one page. The auto-pager follows next_from_id until the pool is exhausted, so you never write the paging loop yourself.
const pool: DFSSlatePlayer[] = []
for await (const row of api.dfs.slate_players.iter({ slate_id: 129036 })) pool.push(row)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, type DFSSlatePlayer } from '@stat-api/client'
const api = new StatApi() // reads STAT_API_KEY from the environment
// Page the whole player pool
const pool: DFSSlatePlayer[] = []
for await (const row of api.dfs.slate_players.iter({ slate_id: 129036 })) pool.push(row)
// Rank by salary, most expensive first
const bysalary = [...pool].sort((a, b) => b.salary - a.salary)
// Take the ten priciest players
const top = bysalary.slice(0, 10)
// Print the salary board
console.log("Highest-salaried players on the slate")
console.log(["display_name", "position", "salary", "avg_points"].join('\t'))
for (const row of top) {
console.log([String(row.display_name ?? ''), String(row.position ?? ''), String(row.salary ?? ''), String(row.avg_points ?? '')].join('\t'))
}