Skip to main content

Sleeper

@dougschaefer/sleeperv2026.08.21.1· 1d agoMODELSWORKFLOWS
01README

Read fantasy league state from the Sleeper platform's public read-only API — no key, no OAuth, no write surface. Resolve a username to a user ID, list leagues and drafts, and read a league in depth: settings and scoring, rosters with owners joined and standings derived, weekly matchups paired head to head, the transaction log, traded picks, playoff brackets, the draft board, and league-wide add/drop trends. Player IDs are resolved to names from a locally cached catalogue, and a missing record (which Sleeper reports as HTTP 200 with a null body) fails loudly instead of reading as empty.

02Release Notes

First release. Reads the full Sleeper fantasy API surface: user, league, rosters with standings, matchups, transactions, traded picks, brackets, drafts and picks, the cached player catalogue, and add/drop trends. A missing record — which Sleeper reports as HTTP 200 with a null body rather than 404 — fails loudly instead of reading as empty.

03Models1
@dougschaefer/sleeperv2026.08.21.1sleeper/sleeper.ts
fn user(username?: string)
Resolve the configured username to a Sleeper user ID and avatar. Every league and draft lookup keys off this ID, so run it first. A username that does not exist fails here rather than returning an empty result.
ArgumentTypeDescription
username?stringUsername to resolve instead of the model's configured username
fn state()
Read the sport's current season, week, and season type. Methods that default a week ask this endpoint, so it is also the quickest check that the API is reachable.
fn leagues(season?: string, userId?: string)
List every league the user belongs to in a season, with each league's ID, status, and draft ID. Use the returned league IDs with the league, rosters, matchups, and transactions methods.
ArgumentTypeDescription
season?stringSeason to list, e.g. 2026. Defaults to the sport's current season.
userId?stringSleeper user ID to list for, instead of the configured username
fn league(leagueId?: string)
Read one league's full configuration: roster slots, scoring rules, playoff structure, and waiver settings. This is the reference every scoring question resolves against.
ArgumentTypeDescription
leagueId?stringLeague ID. Defaults to the model's defaultLeagueId.
fn rosters(leagueId?: string)
Read every roster in a league in one call, joining each to its owner's display name and team name, and deriving the standings. Before the draft the rosters exist but hold no players — that is reported as playersDrafted false, not as an error.
ArgumentTypeDescription
leagueId?stringLeague ID. Defaults to the model's defaultLeagueId.
fn matchups(leagueId?: string, week?: number)
Read one week of matchups, pairing the two rosters in each and reporting the current margin. Defaults to the live week; in the preseason it defaults to week 1, since no regular-season week has been played.
ArgumentTypeDescription
leagueId?stringLeague ID. Defaults to the model's defaultLeagueId.
week?numberRegular-season week, 1-18. Defaults to the current week.
fn transactions(leagueId?: string, round?: number)
Read the trade, waiver, and free-agent log for one week, resolving added and dropped player IDs to names. Sleeper calls the week a 'round' on this endpoint.
ArgumentTypeDescription
leagueId?stringLeague ID. Defaults to the model's defaultLeagueId.
round?numberWeek of transactions to read. Defaults to the current week.
fn tradedPicks(leagueId?: string)
List every draft pick in the league that has changed hands, including picks in future seasons. Empty in a redraft league that has never traded a pick.
ArgumentTypeDescription
leagueId?stringLeague ID. Defaults to the model's defaultLeagueId.
fn bracket(leagueId?: string, bracket: enum)
Read a league's playoff bracket. Sleeper publishes the bracket structure as soon as the league is created, so seeds and winners read as null until the playoffs are played.
ArgumentTypeDescription
leagueId?stringLeague ID. Defaults to the model's defaultLeagueId.
bracketenumWhich bracket to read: the championship or the consolation side
fn drafts(scope: enum, leagueId?: string, season?: string)
List the drafts attached to a league, or every draft the user took part in during a season. Returns the draft IDs the draft and draftPicks methods need.
ArgumentTypeDescription
scopeenumList a league's drafts, or all of the user's drafts in a season
leagueId?stringLeague ID when scope is 'league'. Defaults to defaultLeagueId.
season?stringSeason when scope is 'user'. Defaults to the current season.
fn draft(draftId: string)
Read one draft's format, timing, and slot-to-roster mapping. Before a draft starts Sleeper leaves draft_order null, which is reported as orderKnown false.
ArgumentTypeDescription
draftIdstringDraft ID, as returned by the drafts or leagues method
fn draftPicks(draftId: string)
Read every pick made in a draft, in order, with player names and positions resolved and a positional breakdown. An un-started draft returns zero picks, reported as empty.
ArgumentTypeDescription
draftIdstringDraft ID, as returned by the drafts or leagues method
fn syncPlayers(position?: string, activeOnly: boolean)
Download the Sleeper player catalogue and cache a trimmed copy locally, so roster, draft, and trending reads can resolve player IDs to names. The full payload is ~14 MB and Sleeper asks that it be fetched no more than once a day.
ArgumentTypeDescription
position?stringFetch only one position, e.g. TE. Narrows the download considerably.
activeOnlybooleanAsk Sleeper for active players only
fn trending(trend: enum, lookbackHours: number, limit: number)
Read the players most added or dropped across every Sleeper league in a lookback window — the platform's waiver-wire signal. Names are resolved from the cached catalogue when syncPlayers has been run.
ArgumentTypeDescription
trendenumWhether to read the most-added or most-dropped players
lookbackHoursnumberSize of the lookback window in hours
limitnumberMaximum number of players to return
fn findPlayers(query: string, position?: string, team?: string, limit: number)
Search the locally cached player catalogue by name, optionally narrowed to a position or NFL team. Reads the copy syncPlayers stored and makes no API call, so it costs nothing against Sleeper's rate limit.
ArgumentTypeDescription
querystringName fragment to match, e.g. 'jefferson'. Case and punctuation are ignored.
position?stringRestrict to one position, e.g. WR
team?stringRestrict to one NFL team abbreviation, e.g. MIN
limitnumberMaximum number of matches to return

Resources

user(infinite)— Sleeper user identity resolved from a username
state(1d)— Current season, week, and season type for a sport
leagueIndex(30d)— Every league a user belongs to in one season
league(30d)— Full settings and scoring rules for one league
rosters(7d)— Every roster in a league, with owners joined and standings
matchups(30d)— One week of matchups in a league, paired head to head
transactions(30d)— Trades, waivers, and free-agent moves for one week
tradedPicks(30d)— Draft picks that have changed hands, including future years
bracket(30d)— A league's winners or losers playoff bracket
draftIndex(30d)— Drafts belonging to a league or to a user in one season
draft(infinite)— Format, timing, and slot mapping for one draft
draftPicks(infinite)— Every pick made in a draft, with player names resolved
playersSummary(infinite)— Counts describing the locally cached player catalogue
trending(1d)— Players most added or dropped across all Sleeper leagues
playerSearch(7d)— Matches from the cached player catalogue for one query

Files

playerIndex(application/json)— Trimmed Sleeper player catalogue, cached locally for name lookups
04Workflows1
@dougschaefer/sleeper-league-snapshotb20ae3d5-b27e-432f-a865-e5bb057cb5ac

Capture the full current state of one Sleeper fantasy league in a single run: the player catalogue, the season's week, the league's settings and scoring, every roster with owners joined and standings derived, this week's matchups and transactions, traded picks, the playoff bracket, and the league-wide add/drop trend. Everything the Sleeper API exposes is read-only, so this run cannot change a lineup or a roster. Refresh the player catalogue first, because the roster, transaction, and trending re

snapshotRefresh the player catalogue, then read the league end to end
1.sync-players${{ inputs.instance }}.syncPlayers— Cache the Sleeper player catalogue so later steps resolve player IDs to names. Allowed to fail: the reads degrade to raw IDs rather than stopping.
2.state${{ inputs.instance }}.state— Read the sport's current season, week, and season type
3.leagues${{ inputs.instance }}.leagues— List every league the user belongs to this season
4.league${{ inputs.instance }}.league— Read the league's settings, roster slots, and scoring rules
5.rosters${{ inputs.instance }}.rosters— Read every roster, joined to owners, with standings derived
6.matchups${{ inputs.instance }}.matchups— Read this week's matchups, paired head to head
7.transactions${{ inputs.instance }}.transactions— Read this week's trades, waivers, and free-agent moves
8.traded-picks${{ inputs.instance }}.tradedPicks— Read every draft pick that has changed hands
9.bracket${{ inputs.instance }}.bracket— Read the championship bracket structure and any decided rounds
10.trending${{ inputs.instance }}.trending— Capture the league-wide waiver-wire signal for the week
05Stats
A
100 / 100
Downloads
0
Archive size
40.2 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
06Platforms
07Labels