Rank NFL season leaders
season_player_stats holds one row per player per season. Resolve the current season, page through all of it with the auto-pager, then sort client-side to build any leaderboard.
1. Resolve the current season
curl -sS --compressed \ -H 'Authorization: Bearer YOUR_API_KEY' \ 'https://api.stat-api.com/api/v1/nfl/seasons?limit=200'2. Page through the whole season
The auto-paging iterator follows the keyset cursor across every page, so you accumulate the full season of rows without a manual loop.
curl -sS --compressed \ -H 'Authorization: Bearer YOUR_API_KEY' \ 'https://api.stat-api.com/api/v1/nfl/season_player_stats?season_id=2026'3. Rank by passing yards
Sort the accumulated rows by any numeric column — here, passing yards.
const ranked = [...rows].sort((a, b) => b.passing_yds - a.passing_yds)4. Take the top ten
const leaders = ranked.slice(0, 10)5. Print the leaderboard
console.log("NFL passing yards leaders") console.log(["player_id", "passing_yds"].join('\t')) for (const row of leaders) { console.log([String(row.player_id ?? ''), String(row.passing_yds ?? '')].join('\t')) }