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.
| Argument | Type | Required | Description |
|---|
| username? | string | no | Username 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.
| Argument | Type | Required | Description |
|---|
| season? | string | no | Season to list, e.g. 2026. Defaults to the sport's current season. |
| userId? | string | no | Sleeper 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.
| Argument | Type | Required | Description |
|---|
| leagueId? | string | no | League 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.
| Argument | Type | Required | Description |
|---|
| leagueId? | string | no | League 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.
| Argument | Type | Required | Description |
|---|
| leagueId? | string | no | League ID. Defaults to the model's defaultLeagueId. |
| week? | number | no | Regular-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.
| Argument | Type | Required | Description |
|---|
| leagueId? | string | no | League ID. Defaults to the model's defaultLeagueId. |
| round? | number | no | Week 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.
| Argument | Type | Required | Description |
|---|
| leagueId? | string | no | League 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.
| Argument | Type | Required | Description |
|---|
| leagueId? | string | no | League ID. Defaults to the model's defaultLeagueId. |
| bracket | enum | yes | Which 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.
| Argument | Type | Required | Description |
|---|
| scope | enum | yes | List a league's drafts, or all of the user's drafts in a season |
| leagueId? | string | no | League ID when scope is 'league'. Defaults to defaultLeagueId. |
| season? | string | no | Season 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.
| Argument | Type | Required | Description |
|---|
| draftId | string | yes | Draft 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.
| Argument | Type | Required | Description |
|---|
| draftId | string | yes | Draft 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.
| Argument | Type | Required | Description |
|---|
| position? | string | no | Fetch only one position, e.g. TE. Narrows the download considerably. |
| activeOnly | boolean | yes | Ask 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.
| Argument | Type | Required | Description |
|---|
| trend | enum | yes | Whether to read the most-added or most-dropped players |
| lookbackHours | number | yes | Size of the lookback window in hours |
| limit | number | yes | Maximum 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.
| Argument | Type | Required | Description |
|---|
| query | string | yes | Name fragment to match, e.g. 'jefferson'. Case and punctuation are ignored. |
| position? | string | no | Restrict to one position, e.g. WR |
| team? | string | no | Restrict to one NFL team abbreviation, e.g. MIN |
| limit | number | yes | Maximum 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