knitr::opts_chunk$set( collapse = TRUE, warning = FALSE, message = FALSE, error = FALSE, comment = "#>", fig.path = "man/figures/README-", fig.height = 4, fig.width = 9, out.width = "100%", dpi = 300 ) if (!interactive()) { options(width = 99) }
The fflr package is used to query the ESPN Fantasy Football API. Get data on fantasy football league members, teams, and individual athletes.
This package has been tested with a narrow subset of possible league settings. If a function doesn't work as intended, please file an issue on GitHub.
[!IMPORTANT]
As of 2024-05-17, fflr was removed from CRAN for failure to comply with the policy on internet resources. This issue arose when ESPN changed their API format and adjusted endpoints to account for the end of the 2023 NFL season. I hope to work with CRAN to get the package published again before the 2024 season, but it may not be possible.
The most recent development version can always be installed from GitHub:
# install.packages("remotes") remotes::install_github("k5cents/fflr")
library(fflr) packageVersion("fflr")
Data is only available for public leagues. See this help page on how to make a private league public
Functions require a unique leagueId
, which can be found in any ESPN page URL.
https://fantasy.espn.com/football/league?leagueId=42654852
Use ffl_id()
to set a default fflr.leagueId
option. Your .Rprofile
file
can set this option on startup.
options(fflr.leagueId = NULL)
ffl_id(leagueId = "42654852")
The leagueId
argument defaults to ffl_id()
and can be omitted once set.
league_info() league_teams()
The scoringPeriodId
argument can be used to get data from past weeks.
all_rost <- team_roster(scoringPeriodId = 1) all_rost$CHI[, 5:13][-7]
There are included objects for NFL teams and players.
nfl_teams
[!NOTE]
The fflr project is released with a Contributor Code of Conduct. By contributing, you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.