Learn R Programming

sleeperapi: R Package Wrapper Around Sleeper API

Sleeper offers a free, non-authenticated read-only HTTP API for users to gather information from their platform. Their API documentation goes into basic GET requests using terminal commands, but those wishing to use R might want a simpler way to gather the data they would like to analyze should they be unfamiliar with how to go about this in R.

This package attempts to solve this issue through various functions that gather data from Sleeper's API into lists and data frames (well known objects for R users) just by knowing basics like league or user IDs.

For example, using only the league ID that I am familiar with for the "Know It Alls" fantasy football league, I can easily call functions like get_winner_playoff_bracket or get_league_drafts to get the data in a readily usable object to jumpstart our analysis. By executing get_winner_playoff_bracket(688281863499907072), it returns a nice data frame detailing everything that Sleeper's API provides us concerning the playoff bracket for the Know It Alls league.

Copy Link

Version

Install

install.packages('sleeperapi')

Monthly Downloads

62

Version

1.0.4

License

MIT + file LICENSE

Maintainer

Nick Bultman

Last Published

September 14th, 2022

Functions in sleeperapi (1.0.4)

get_trending_players

Gather Trending Player Information
get_user

Gather User Data
get_user_drafts

Gather User Draft Information
get_sport_state

Gather Sport State
get_rosters

Gather Roster Data for League
get_user_leagues

Gather Leagues for User
get_winner_playoff_bracket

Gather Winner Playoff Bracket
get_traded_picks

Gather League Trades
get_transactions

Gather League Transactions for Specific Round
get_all_nfl_players

Gather NFL Player Data
get_draft

Gather Draft Information
get_avatar_picture

Display Avatar
get_loser_playoff_bracket

Gather Loser Playoff Bracket
get_league

Gather League Data
get_league_users

Gather User Data for League
get_league_drafts

Gather League Draft Information
get_draft_picks

Gather Draft Picks
get_matchups

Gather Matchup Data in a League for a Week
get_draft_pick_trades

Gather Draft Pick Trades