Sleeper fantasy football: scheduled recaps, scores and alerts

Read your Sleeper leagues on a schedule: matchups, rosters, transactions and the players everyone is adding. Sleeper's API is read-only and needs no key or account, only your league id (the number in sleeper.com/leagues/<id>).

Example: a weekly recap in Discord, written by Claude

The AI step gets the league's request templates as tools. It asks for the NFL state to learn the week, reads that week's matchups, and matches roster ids to team names through the league members and rosters.

json
{
  "name": "Sunday Funday recap",
  "cron": { "expression": "0 9 * * 2", "time_zone": "America/New_York" },
  "nodes": [
    { "id": "recap", "ai_generate": {
        "provider": "anthropic", "model": "claude-opus-5-5", "credential_id": "YOUR_ANTHROPIC_KEY_ID", "effort": "low",
        "system": "You write the weekly recap for a fantasy football league's Discord. Be funny but not mean. Discord markdown, no tables.",
        "prompt": "Recap the week that just finished in league 1180208754133606400: every matchup with the score, the top scorer, and the closest game.",
        "text": { "max_chars": 2000 },
        "tools": [
          { "name": "nfl_state", "description": "The current NFL season and week.",
            "step": { "id": "t1", "request_template": { "template_id": "<id of sleeper: NFL state>" } } },
          { "name": "matchups", "description": "A week's matchups. Rosters with the same matchup_id play each other.",
            "parameters": "{\"type\":\"object\",\"properties\":{\"week\":{\"type\":\"integer\"}}}",
            "step": { "id": "t2", "request_template": { "template_id": "<id of sleeper: Matchups>", "values": { "league_id": "1180208754133606400", "week": "{{ $.week }}" } } } },
          { "name": "rosters", "description": "Each roster's owner_id and record.",
            "step": { "id": "t3", "request_template": { "template_id": "<id of sleeper: Rosters>", "values": { "league_id": "1180208754133606400" } } } },
          { "name": "members", "description": "League members: user_id, display name and team name.",
            "step": { "id": "t4", "request_template": { "template_id": "<id of sleeper: League members>", "values": { "league_id": "1180208754133606400" } } } }
        ] } },
    { "id": "post", "request_template": { "template_id": "<id of discord: Send message>", "values": { "webhook_url": "https://discord.com/api/webhooks/123456789012345678/abcDEF_ghi-JKL", "content": "{{ $ }}" } } }
  ]
}

Example: live scores during Sunday's games

Each step gets the previous step's output, so the matchups step reads the week from NFL state as {{ $.week }}.

json
{
  "name": "Sunday scoreboard",
  "cron": { "expression": "*/30 13-23 * * 0", "time_zone": "America/New_York" },
  "nodes": [
    { "id": "state", "request_template": { "template_id": "<id of sleeper: NFL state>" } },
    { "id": "scores", "request_template": { "template_id": "<id of sleeper: Matchups>", "values": { "league_id": "1180208754133606400", "week": "{{ $.week }}" } } },
    { "id": "board", "ai_generate": {
        "provider": "openai", "model": "YOUR_OPENAI_MODEL", "credential_id": "YOUR_OPENAI_KEY_ID", "effort": "low",
        "prompt": "Write a one-line score for each matchup (rosters with the same matchup_id), leader first, with team names: {{ $ }}",
        "text": { "max_chars": 2000 },
        "tools": [
          { "name": "rosters", "description": "Each roster's roster_id and owner_id.",
            "step": { "id": "t1", "request_template": { "template_id": "<id of sleeper: Rosters>", "values": { "league_id": "1180208754133606400" } } } },
          { "name": "members", "description": "League members: user_id, display name and team name.",
            "step": { "id": "t2", "request_template": { "template_id": "<id of sleeper: League members>", "values": { "league_id": "1180208754133606400" } } } }
        ] } },
    { "id": "post", "request_template": { "template_id": "<id of discord: Send message>", "values": { "webhook_url": "https://discord.com/api/webhooks/123456789012345678/abcDEF_ghi-JKL", "content": "{{ $ }}" } } }
  ]
}

Finding your ids

  • League id: open the league on sleeper.com; it's the number in the address. Or run Find user with your username, then User's leagues with the user_id it returns.
  • Players are ids such as "4046". Sleeper's full player list, https://api.sleeper.app/v1/players/nfl, is about 5 MB and Sleeper asks that you fetch it at most once a day, so there's no template for it. Call it with a request step if a job needs player names.

Reference

NFL state: sleeper_nfl_state

The current NFL season and week, for the steps that take a week. No API key needed. Sends GET https://api.sleeper.app/v1/state/nfl. Output for the next step: the response body. No credential.

Add it in the job editor with Use template on a request step. Over the API, find its id with GET /request-templates?partner=sleeper&action=NFL+state and send { "request_template": { "template_id": "<id>", "values": { … } } }; the server copies the template into the step.

It takes no values.

Find user: sleeper_user

A user by username, with the user_id the league steps take. No API key needed. Sends GET https://api.sleeper.app/v1/user/…. Output for the next step: the response body. No credential.

Add it in the job editor with Use template on a request step. Over the API, find its id with GET /request-templates?partner=sleeper&action=Find+user and send { "request_template": { "template_id": "<id>", "values": { … } } }; the server copies the template into the step.

Value Type Notes
user text, required A username or user id. Up to 40 characters. Placeholders allowed.

User's leagues: sleeper_user_leagues

Every NFL league a user is in for a season, with their league ids. No API key needed. Sends GET https://api.sleeper.app/v1/user/<user_id>/leagues/nfl/<season>. Output for the next step: the response body. No credential.

Add it in the job editor with Use template on a request step. Over the API, find its id with GET /request-templates?partner=sleeper&action=User%27s+leagues and send { "request_template": { "template_id": "<id>", "values": { … } } }; the server copies the template into the step.

Value Type Notes
user_id text, required From Find user: a number, not the username. Up to 24 characters. Placeholders allowed.
season text, required The year the season starts. Placeholders allowed.

League: sleeper_league

A league's name, status, settings, scoring and roster positions. No API key needed. Sends GET https://api.sleeper.app/v1/league/<league_id>. Output for the next step: the response body. No credential.

Add it in the job editor with Use template on a request step. Over the API, find its id with GET /request-templates?partner=sleeper&action=League and send { "request_template": { "template_id": "<id>", "values": { … } } }; the server copies the template into the step.

Value Type Notes
league_id text, required The number in the league's URL: sleeper.com/leagues/. Up to 24 characters. Placeholders allowed.

Rosters: sleeper_rosters

Each team's players, starters and record. owner_id matches a user_id in League members. No API key needed. Sends GET https://api.sleeper.app/v1/league/<league_id>/rosters. Output for the next step: the response body. No credential.

Add it in the job editor with Use template on a request step. Over the API, find its id with GET /request-templates?partner=sleeper&action=Rosters and send { "request_template": { "template_id": "<id>", "values": { … } } }; the server copies the template into the step.

Value Type Notes
league_id text, required The number in the league's URL: sleeper.com/leagues/. Up to 24 characters. Placeholders allowed.

League members: sleeper_league_users

The users in a league, with display names and team names. No API key needed. Sends GET https://api.sleeper.app/v1/league/<league_id>/users. Output for the next step: the response body. No credential.

Add it in the job editor with Use template on a request step. Over the API, find its id with GET /request-templates?partner=sleeper&action=League+members and send { "request_template": { "template_id": "<id>", "values": { … } } }; the server copies the template into the step.

Value Type Notes
league_id text, required The number in the league's URL: sleeper.com/leagues/. Up to 24 characters. Placeholders allowed.

Matchups: sleeper_matchups

A week's matchups and points. Rosters with the same matchup_id play each other. No API key needed. Sends GET https://api.sleeper.app/v1/league/<league_id>/matchups/<week>. Output for the next step: the response body. No credential.

Add it in the job editor with Use template on a request step. Over the API, find its id with GET /request-templates?partner=sleeper&action=Matchups and send { "request_template": { "template_id": "<id>", "values": { … } } }; the server copies the template into the step.

Value Type Notes
league_id text, required The number in the league's URL: sleeper.com/leagues/. Up to 24 characters. Placeholders allowed.
week number, required 1 to 18, or later for the playoffs. After an NFL state step, it's $.week. A number. Placeholders allowed.

Transactions: sleeper_transactions

A week's trades, waiver claims and free agent moves. adds and drops map player ids to roster ids. No API key needed. Sends GET https://api.sleeper.app/v1/league/<league_id>/transactions/<week>. Output for the next step: the response body. No credential.

Add it in the job editor with Use template on a request step. Over the API, find its id with GET /request-templates?partner=sleeper&action=Transactions and send { "request_template": { "template_id": "<id>", "values": { … } } }; the server copies the template into the step.

Value Type Notes
league_id text, required The number in the league's URL: sleeper.com/leagues/. Up to 24 characters. Placeholders allowed.
week number, required 1 to 18, or later for the playoffs. After an NFL state step, it's $.week. A number. Placeholders allowed.

The players added or dropped most across Sleeper, by player id, with how many leagues. No API key needed. Sends GET https://api.sleeper.app/v1/players/nfl/trending/<type>. Output for the next step: the response body. No credential.

Add it in the job editor with Use template on a request step. Over the API, find its id with GET /request-templates?partner=sleeper&action=Trending+players and send { "request_template": { "template_id": "<id>", "values": { … } } }; the server copies the template into the step.

Value Type Notes
type select, required One of add (Most added), drop (Most dropped). The editor starts it as add. Placeholders allowed.
lookback_hours number Hours, 1 to 168. A number. The editor starts it as 24. Placeholders allowed.
limit number 1 to 100. A number. The editor starts it as 25. Placeholders allowed.