ffscrapr

An R Client for Fantasy Football League APIs

CRAN status Dev status Lifecycle: stable Codecov test coverage R build status API status nflverse discord

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.

Installation

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:

remotes::install_github("ffverse/ffscrapr", ref = "dev")

The dev version has a separate documentation site here.

Usage

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.

Support

The best places to get help on this package are:

Contributing

Many hands make light work! Here are some ways you can contribute to this project:

Terms of Use

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.