STAT-API

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.

  1. 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.

    curl -sS --compressed \
      -H 'Authorization: Bearer YOUR_API_KEY' \
      'https://api.stat-api.com/api/v1/dfs/slate_players?slate_id=129036'
  2. 2. Rank by salary, most expensive first

    The API does not let a caller choose the sort order — rows arrive by id. Ranking is client-side, on the rows you already hold.

    const bysalary = [...pool].sort((a, b) => b.salary - a.salary)
  3. 3. Take the ten priciest players

    const top = bysalary.slice(0, 10)
  4. 4. 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'))
    }