AutomationFlowsSlack & Telegram › View Fantasy Football Roster Details with Sleeper API and Telegram Chatbot

View Fantasy Football Roster Details with Sleeper API and Telegram Chatbot

ByPatrick Jennings @patjennings916 on n8n.io

A Telegram chatbot built to look up your fantasy football team in the Sleeper app and return your roster details, player names, positions, and team info.

Event trigger★★★★☆ complexity17 nodesHTTP RequestTelegramAirtableTelegram Trigger
Slack & Telegram Trigger: Event Nodes: 17 Complexity: ★★★★☆ Added:

This workflow corresponds to n8n.io template #6655 — we link there as the canonical source.

This workflow follows the Airtable → HTTP Request recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "",
  "name": "Sleeper NFL Chatbot Starter",
  "tags": [
    {
      "name": "Sleeper App"
    },
    {
      "name": "NFL"
    },
    {
      "name": "Fantasy Football"
    },
    {
      "name": "Sports Analytics"
    }
  ],
  "nodes": [
    {
      "id": "048ab092-4ba8-4093-a799-058a92719c84",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -704,
        464
      ],
      "parameters": {
        "height": 320,
        "content": "This chatbot will give you the ability to pull your Sleeper team players \n & position & team by typing it into a chatbot in Telegram.\n\nEnsure Telegram credentials are set via your n8n credentials panel before running \n\n\nBe sure to check your Sleeper App for your username & enter your username including upper or lower case letter. If entered incorrectly, no results will present 0 results back."
      },
      "typeVersion": 1
    },
    {
      "id": "cf85115e-62e4-4c87-8a38-f01312515ec0",
      "name": "Extract Username",
      "type": "n8n-nodes-base.code",
      "position": [
        -384,
        240
      ],
      "parameters": {
        "jsCode": "const message = $json.message.text || '';\nconst username = message.replace('/team ', '').trim();\n\nreturn [{ json: { username } }];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "b42b8d81-d198-4a3e-9f8b-38067c76817f",
      "name": "Get Sleeper User ID",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -160,
        240
      ],
      "parameters": {
        "url": "= https://api.sleeper.app/v1/user/{{ $json.username }}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "b403d5d1-a969-4e14-805f-5aa0ef7d99b4",
      "name": "Get Leagues",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "This will need update for upcoming years",
      "position": [
        64,
        240
      ],
      "parameters": {
        "url": "=https://api.sleeper.app/v1/user/{{$json[\"user_id\"]}}/leagues/nfl/2024",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "5133a61d-b60f-4e14-bb1e-366e322960f8",
      "name": "Extract League ID",
      "type": "n8n-nodes-base.code",
      "position": [
        288,
        240
      ],
      "parameters": {
        "jsCode": "const leagues = $input.all();\nconst league = leagues[0].json; // Grab the first league from input items\nreturn [{ json: { league_id: league.league_id, owner_id: league.user_id } }];"
      },
      "typeVersion": 2
    },
    {
      "id": "56aeb158-e61f-4e5a-98ec-1a190de40a95",
      "name": "Get Rosters",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        512,
        240
      ],
      "parameters": {
        "url": "=https://api.sleeper.app/v1/league/{{$json[\"league_id\"]}}/rosters",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "65562cdb-bf4b-4aba-9e8e-16fdc43f6178",
      "name": "Find User Roster",
      "type": "n8n-nodes-base.code",
      "position": [
        736,
        240
      ],
      "parameters": {
        "jsCode": "// Get Sleeper user ID from earlier node (make sure it's passed in!)\nconst sleeperUserId = $items('Get Sleeper User ID')[0].json.user_id;\n\n// All rosters pulled from GET /v1/league/{league_id}/rosters\nconst rosters = $input.all();\n\n// Find the correct user's team\nconst myRoster = rosters.find(roster => roster.json.owner_id === sleeperUserId);\n\nif (!myRoster) {\n  throw new Error(`No roster found for Sleeper User ID: ${sleeperUserId}`);\n}\n\nconst playerIds = myRoster.json.players || [];\n\nconst formula = `OR(${playerIds.map(id => `{player_id} = \"${id}\"`).join(', ')})`;\n\nreturn [{\n  json: {\n    player_ids: playerIds,\n    player_id: playerIds,        // keep for downstream Airtable join\n    airtable_filter: formula,\n    sleeper_user_id: sleeperUserId\n  }\n}];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "c7166e62-b1ca-45ef-90d7-f13598a26973",
      "name": "Send a text message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1408,
        320
      ],
      "parameters": {
        "text": "=You have {{ $items().filter(i => i.json.full_name).length }} players on your roster:\n\n{{ $items()\n  .filter(i => i.json.full_name)\n  .map(i => `${i.json.full_name} (${i.json.position} - ${i.json.team})`)\n  .join(\", \") }}\n",
        "chatId": "={{ $node[\"Send Message to Chatbot\"].json.message.chat.id }}\n",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "executeOnce": true,
      "typeVersion": 1.2
    },
    {
      "id": "b70e7170-b89b-4d7c-a547-acf011239217",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        400
      ],
      "parameters": {
        "width": 150,
        "height": 144,
        "content": "Please note this GET address will reference 2024 and will probably need to be changed for 2025"
      },
      "typeVersion": 1
    },
    {
      "id": "61d63ad0-1554-480b-b2ed-0f30a0c7cc81",
      "name": "Search records",
      "type": "n8n-nodes-base.airtable",
      "position": [
        960,
        240
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appGxp4GkT8p2FXWy",
          "cachedResultUrl": "https://airtable.com/appGxp4GkT8p2FXWy",
          "cachedResultName": "Fantasy Players Daily"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblE6hmNAQGTw3koH",
          "cachedResultUrl": "https://airtable.com/appGxp4GkT8p2FXWy/tblE6hmNAQGTw3koH",
          "cachedResultName": "Table 1"
        },
        "options": {},
        "operation": "search",
        "filterByFormula": "={{ $json.airtable_filter }}"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "a1021d98-5730-4357-8631-49cf0a9860e3",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1184,
        320
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "159d29c9-709a-4bb8-8ca4-f33c515ec865",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1440,
        464
      ],
      "parameters": {
        "width": 304,
        "height": 240,
        "content": "Message back to your Telegram chatbot\n\nYou can change some of the text & information messaging if you want to be creative. \n\nKeep active when you need it on or manually play it through as inactive"
      },
      "typeVersion": 1
    },
    {
      "id": "809f5164-0e2d-407c-9618-7e9b9c9732c2",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        896,
        -48
      ],
      "parameters": {
        "color": 6,
        "height": 256,
        "content": "In Order to make these player_id fields useful, you'll want to add the Sleeper NFL Daily Sync workflow to get a data pull from Sleeper API.\n\nWithout the Airtable, this workflow will pull in player_ids.\n\nAlternatively, swap this node for a Google Sheet search if Airtable isn\u2019t your stack.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "7c986aa9-8373-44e6-9b77-badec62c1298",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        32
      ],
      "parameters": {
        "width": 176,
        "height": 192,
        "content": "Please note that this pulls the first Sleeper league found. For users in multiple leagues, customize logic to prompt selection or filter by name."
      },
      "typeVersion": 1
    },
    {
      "id": "4974c9a5-7659-4630-a8c1-8a95efc31879",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1136,
        -64
      ],
      "parameters": {
        "color": 4,
        "width": 608,
        "height": 320,
        "content": "# Sleeper NFL Chatbot Starter\n**You will need the following to run:**\n\n-Telegram Chatbot via the BotFather or use any Trigger for your messaging you would prefer.\n\n-Also, I use Airtable to sync my Player table. Please see Sleeper NFL Players Daily Sync template for an active player table. You can also use other ways to store the data for Sleeper Player API calls like Google Sheets, Access, etc.\n\nThis should give you a way to look up your team by username & basic information on players in your rosters using Sleeper App.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "73971579-392e-44b0-a421-adb14bacfae1",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        368
      ],
      "parameters": {
        "color": 5,
        "width": 160,
        "height": 144,
        "content": "However, if you want to hardcode a username instead of using Telegram, you can modify this node directly."
      },
      "typeVersion": 1
    },
    {
      "id": "fd549c6f-eaa1-49e4-95f5-f25ccfe5d270",
      "name": "Send Message to Chatbot",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -608,
        320
      ],
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {
          "userIds": ""
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "",
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Leagues": {
      "main": [
        [
          {
            "node": "Extract League ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Rosters": {
      "main": [
        [
          {
            "node": "Find User Roster",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search records": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Extract Username": {
      "main": [
        [
          {
            "node": "Get Sleeper User ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find User Roster": {
      "main": [
        [
          {
            "node": "Search records",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract League ID": {
      "main": [
        [
          {
            "node": "Get Rosters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Sleeper User ID": {
      "main": [
        [
          {
            "node": "Get Leagues",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Message to Chatbot": {
      "main": [
        [
          {
            "node": "Extract Username",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

A Telegram chatbot built to look up your fantasy football team in the Sleeper app and return your roster details, player names, positions, and team info.

Source: https://n8n.io/workflows/6655/ — original creator credit. Request a take-down →

More Slack & Telegram workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Slack & Telegram

Try on any outfit virtually - right inside Telegram. A user sends a person photo, then a garment photo (captioned ), and the bot replies with an AI-generated try-on result image using a dedicated Virt

Telegram Trigger, Telegram, Google Sheets +1
Slack & Telegram

A robust n8n workflow designed to enhance Telegram bot functionality for user management and broadcasting. It facilitates automatic support ticket creation, efficient user data storage in Redis, and a

HTTP Request, Redis, Telegram +1
Slack & Telegram

Transform your digital payment business with a fully-featured Telegram bot that handles everything from product listings to transaction processing. Perfect for entrepreneurs looking to automate their

Telegram Trigger, Telegram, HTTP Request
Slack & Telegram

TGBot. Uses telegram, googleSheets, telegramTrigger, httpRequest. Event-driven trigger; 30 nodes.

Telegram, Google Sheets, Telegram Trigger +1
Slack & Telegram

This template provides a workflow to integrate a Telegram bot with NeurochainAI's inference capabilities, supporting both text processing and image generation. Follow these steps to get started:

Telegram Trigger, HTTP Request, Telegram