{"id":44780330,"url":"https://github.com/lum8rjack/sleeper-go","last_synced_at":"2026-02-16T07:36:03.008Z","repository":{"id":188602559,"uuid":"678830742","full_name":"lum8rjack/sleeper-go","owner":"lum8rjack","description":"Go library for the Sleeper fantasy sports API","archived":false,"fork":false,"pushed_at":"2025-09-23T01:09:51.000Z","size":109,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-23T03:15:36.740Z","etag":null,"topics":["sleeper"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lum8rjack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-08-15T13:36:12.000Z","updated_at":"2025-09-23T01:07:50.000Z","dependencies_parsed_at":"2025-04-28T02:26:22.036Z","dependency_job_id":"a09bd86f-15f3-46d6-a529-bd3ec60765b5","html_url":"https://github.com/lum8rjack/sleeper-go","commit_stats":null,"previous_names":["lum8rjack/sleeper-go"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/lum8rjack/sleeper-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lum8rjack%2Fsleeper-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lum8rjack%2Fsleeper-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lum8rjack%2Fsleeper-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lum8rjack%2Fsleeper-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lum8rjack","download_url":"https://codeload.github.com/lum8rjack/sleeper-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lum8rjack%2Fsleeper-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29502934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T05:57:17.024Z","status":"ssl_error","status_checked_at":"2026-02-16T05:56:49.929Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["sleeper"],"created_at":"2026-02-16T07:36:02.278Z","updated_at":"2026-02-16T07:36:03.000Z","avatar_url":"https://github.com/lum8rjack.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sleeper-go\nGo library for the [Sleeper](https://sleeper.com/) fantasy sports free read-only API. According to their [documentation](https://docs.sleeper.com), stay under 1000 API calls per minute, otherwise, you risk being IP-blocked.\n\n## Usage\nExample code that gets the users for the specified league and outputs their display name and team name.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/lum8rjack/sleeper-go\"\n)\n\nfunc main() {\n    leagueID := \"123456789012345678\" // Fake league Id\n\tbotClient := sleeper.NewClient()\n\n\tleagueUsers, err := botClient.GetLeagueUsers(leagueID)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfor _, user := range leagueUsers {\n\t\tfmt.Printf(\"%s (Team name: %s)\\n\", user.DisplayName, user.Metadata.TeamName)\n\t}\n}\n\n```\n\nSample output:\n```bash\n2KSports (Team name: Game of End Zones)\nTOBOT (Team name: Saving Matt Ryan)\n...\n```\n\n## Custom Methods\n\nI created a few custom methods that require correlating results from multiple API calls in order to receive the data.\n\n### GetMatchups\n\nThis method gets the matchups for the specified week and returns each team and their wins and losses.\n```go\ntype TeamMatchup struct {\n\tTeamname1   string\n\tTeamname2   string\n\tTeam1Losses int\n\tTeam2Losses int\n\tTeam1Wins   int\n\tTeam2Wins   int\n}\n\nfunc (c *Client) GetTeamMatchups(league_id string, week int) ([]TeamMatchup, error)\n```\n\n### GetScoreboards\n\nThis method gets the scoreboard for each matchup for the specified week and returns each team and points.\n```go\ntype Scoreboard struct {\n\tTeamname1 string  `json:\"teamname_1\"`\n\tTeamname2 string  `json:\"teamname_2\"`\n\tPoints1   float32 `json:\"points_1\"`\n\tPoints2   float32 `json:\"points_2\"`\n}\n\nfunc (c *Client) GetScoreboards(league_id string, week int) ([]Scoreboard, error)\n```\n\n### Players\n\nThe players API is not intended to be called every time you need to look up players due to the large file size. It should not be called more than once per day.\n\nWith this in mind, I have created additional methods to save the players information to disk and read the saved file from disk. \n\n```go\n// Get all players - use this sparingly\nfunc (c *Client) GetAllPlayers(sport string) (Players, error)\n\n// Get all players and save the details to a file\nfunc (c *Client) SaveAllPlayers(sport string, file string) (bool, error)\n\n// Get all players from a saved file\nfunc GetAllPlayers(file string) (Players, error)\n```\n\n## Sleeper API Implementation Status\n\nThe following table shows the implementation status of all known Sleeper API endpoints in this library. The table includes both officially documented endpoints from Sleeper's API documentation as well as several undocumented endpoints that were discovered during development. All endpoints, both documented and undocumented, have been fully implemented.\n\n| Category       | Function                                                                 | Description                                                                 | Implemented |\n|----------------|--------------------------------------------------------------------------|-----------------------------------------------------------------------------|-------------|\n| User           | `GetUserByUsername(username string)`                                     | Get user details by username                                                | ✅          |\n| User           | `GetUserByID(userID string)`                                             | Get user details by user ID                                                 | ✅          |\n| Avatars        | `GetAvatar(avatarID string)`                                             | Get full-size avatar image                                                  | ✅          |\n| Avatars        | `GetAvatarThumbnail(avatarID string)`                                    | Get thumbnail avatar image                                                  | ✅          |\n| Leagues        | `GetAllLeaguesForUser(userID string, sport string, season int)`           | Get all leagues a user is in for a specific sport and season                | ✅          |\n| Leagues        | `GetLeague(leagueID string)`                                             | Get details of a specific league                                            | ✅          |\n| Leagues        | `GetRosters(leagueID string)`                                            | Get all rosters in a league                                                 | ✅          |\n| Leagues        | `GetLeagueUsers(leagueID string)`                                        | Get all users in a league                                                   | ✅          |\n| Leagues        | `GetMatchups(leagueID string, week int)`                                 | Get all matchups for a specific week in a league                            | ✅          |\n| Leagues        | `GetPlayoffsWinnersBracket(leagueID string)`                             | Get the winners bracket for league playoffs                                 | ✅          |\n| Leagues        | `GetPlayoffsLosersBracket(leagueID string)`                              | Get the losers bracket for league playoffs                                  | ✅          |\n| Leagues        | `GetTransactions(leagueID string, round int)`                            | Get all transactions for a specific round in a league                       | ✅          |\n| Leagues        | `GetTradedPicks(leagueID string)`                                        | Get all traded draft picks in a league                                      | ✅          |\n| Leagues        | `GetSportState(sport string)`                                            | Get current state of a sport (season, week, etc.)                           | ✅          |\n| Drafts         | `GetDraftsForUser(userID string, sport string, season int)`              | Get all drafts a user is in for a specific sport and season                 | ✅          |\n| Drafts         | `GetDraftsForLeague(leagueID string)`                                    | Get all drafts in a league                                                  | ✅          |\n| Drafts         | `GetDraft(draftID string)`                                               | Get details of a specific draft                                             | ✅          |\n| Drafts         | `GetAllDraftPicks(draftID string)`                                       | Get all picks in a draft                                                    | ✅          |\n| Drafts         | `GetDraftTradedPicks(draftID string)`                                    | Get all traded picks in a draft                                             | ✅          |\n| Players        | `GetAllPlayers(sport string)`                                            | Get all players for a sport (large response, use sparingly)                 | ✅          |\n| Players        | `GetTrendingPlayers(sport string, type string, hours int, limit int)`    | Get trending players with optional lookback hours and limit                 | ✅          |\n| Undocumented   | `GetNflProjections(year int, week int)`                                  | Get player projections for a specific NFL season and week                   | ✅          |\n| Undocumented   | `GetNflPlayerSeasonStats(playerID int, year int, postseason bool)`       | Get season stats for a specific NFL player                                  | ✅          |\n| Undocumented   | `GetNflPlayer(playerID int)`                                             | Get detailed information for a specific NFL player                          | ✅          |\n| Undocumented   | `GetNflPlayerResearch(year int, week int, postseason bool)`              | Get player research data (ownership, start rates) for a specific week       | ✅          |\n| Undocumented   | `GetNflTeamDepthChart(team string)`                                      | Get depth chart for a specific NFL team                                     | ✅          |\n| Undocumented   | `GetNflSchedule(year int, postseason bool)`                              | Get NFL schedule for a specific season (regular or postseason)              | ✅          |\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flum8rjack%2Fsleeper-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flum8rjack%2Fsleeper-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flum8rjack%2Fsleeper-go/lists"}