Skip to content

ffverse/ffhistorian

Repository files navigation

ffhistorian

Overview

ffhistorian is an R package that retrieves and visualizes fantasy football league history data. Built on top of the excellent ffscrapr package, it provides tools to analyze league performance across seasons, track user statistics, and create insightful visualizations of your fantasy football league’s history.

Installation

You can install the development version of ffhistorian from GitHub:

# pak is recommended, see https://github.com/r-lib/pak
pak::pak("ffverse/ffhistorian")

# can also use remotes
remotes::install_github("ffverse/ffhistorian")

Getting Started

The main workflow involves three steps:

  1. Connect to your league using ffscrapr
  2. Pull league history with ff_history()
  3. Analyze and visualize the results

Basic Example

library(ffhistorian)

conn <- ffscrapr::sleeper_connect(2025, "1200503479357952000")
history <- ff_history(conn)

Supported Platforms

ffhistorian supports all platforms available through ffscrapr:

  • Sleeper
  • ESPN (requires authentication)
  • MFL (MyFantasyLeague)
  • Fleaflicker

ESPN Example

ESPN leagues require authentication via espn_s2 and swid cookies:

# Store credentials as environment variables (recommended)
conn <- ffscrapr::espn_connect(
  season = 2025,
  league_id = "your_league_id",
  espn_s2 = Sys.getenv("ESPN_S2"),
  swid = Sys.getenv("SWID")
)

history <- ff_history(conn)
summary(history)

MFL Example

conn <- ffscrapr::mfl_connect(2025, league_id = "12345")
history <- ff_history(conn)
summary(history)

Support

The best places to get help on this package are:

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.

Releases

Packages

Contributors

Languages