An R Client for Fantasy Football League APIs
Helps access various Fantasy Football APIs (currently MFL, Sleeper, Fleaflicker, and ESPN - eventually Yahoo, potentially others) by handling authentication/rate-limiting/caching, forming appropriate calls, and returning tidy dataframes which can be easily connected to other data sources.
Install the stable version of this package from CRAN or the ffverse r-universe repository:
install.packages("ffscrapr") # CRAN
install.packages("ffscrapr", repos = "https://ffverse.r-universe.dev")
Install the development version from GitHub with:
The dev version has a separate documentation site here.
All ffscrapr
functions start with a connection object created by ff_connect()
, which stores connection, authentication, and other user-defined parameters. This object is used by all other functions to help return the correct data.
library(ffscrapr)
ssb <- ff_connect(platform = "mfl", league_id = "54040", season = 2020)
# Get a summary of league settings
ff_league(ssb) %>% str()
# Get rosters
ff_rosters(ssb)
# Get transactions
ff_transactions(ssb)
Platform-specific guides on getting started with ffscrapr are here:
There are also some more advanced guides for custom API calls in the Articles section, as well as some guides on optimizing ffscrapr’s performance.
The best places to get help on this package are:
Many hands make light work! Here are some ways you can contribute to this project:
You can open an issue if you’d like to request specific data or report a bug/error.
You can sponsor this project with donations!
If you’d like to contribute code, please check out the contribution guidelines.
The R code for this package is released as open source under the MIT license.
The APIs and data accessed by this package belong to their respective owners, and are governed by their terms of use.