All Projects → kiernann → fflr

kiernann / fflr

Licence: Unknown, MIT licenses found Licenses found Unknown LICENSE MIT LICENSE.md
Get ESPN fantasy football data in R

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to fflr

ff
A fantasy football draft assistant with projections from ESPN, CBS, and NFL
Stars: ✭ 30 (+76.47%)
Mutual labels:  espn, fantasy-football
ffscrapr
R API Client for Fantasy Football League Platforms
Stars: ✭ 55 (+223.53%)
Mutual labels:  fantasy-football
fantasy-football-scoreboard
Display the score of your fantasy football team on a Raspberry Pi driven RGB LED matrix for maximum ease of disappointment
Stars: ✭ 43 (+152.94%)
Mutual labels:  fantasy-football
cartrolandofc
🎩 CartrolandoFC é um site para consultar os pontos parciais do seu time no Cartola FC.
Stars: ✭ 272 (+1500%)
Mutual labels:  fantasy-football
FFDB
NFL Database Engine for PostgreSql and Mongo (easily works with other custom databases too)
Stars: ✭ 34 (+100%)
Mutual labels:  fantasy-football
FantasyPremierLeague.py
⚽ Statistics for your mini leagues.
Stars: ✭ 123 (+623.53%)
Mutual labels:  fantasy-football
sleeper-api-wrapper
A Python wrapper for the Sleeper Fantasy Football API.
Stars: ✭ 41 (+141.18%)
Mutual labels:  fantasy-football
FPLbot
A bot made for /r/FantasyPL
Stars: ✭ 54 (+217.65%)
Mutual labels:  fantasy-football
league-page
Create a custom league page for your Sleeper fantasy football league!
Stars: ✭ 52 (+205.88%)
Mutual labels:  fantasy-football
fantasy-tools
A suite of tools for fantasy football players
Stars: ✭ 37 (+117.65%)
Mutual labels:  fantasy-football
fflproject
Fantasy Football League Project
Stars: ✭ 32 (+88.24%)
Mutual labels:  fantasy-football
fplscrapR
This package enables those interested in Fantasy Premier League to perform detailed data analysis of the game, using the FPL's JSON API. The fplscrapR functions help R users collect and parse data from the Official Fantasy Premier League website.
Stars: ✭ 64 (+276.47%)
Mutual labels:  fantasy-football

fflr

Lifecycle: experimental CRAN status Downloads Codecov test coverage R build status

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.

Installation

You can install the release version of fflr from CRAN:

install.packages("fflr")

The most recent development version can be installed from GitHub:

# install.packages("remotes")
remotes::install_github("kiernann/fflr")

Usage

library(fflr)
packageVersion("fflr")
#> [1] '2.1.0'

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.

ffl_id(leagueId = "42654852")
#> Temporarily set `fflr.leagueId` option to 42654852
#> [1] "42654852"

The leagueId argument defaults to ffl_id() and can be omitted once set.

league_info()
#> # A tibble: 1 × 6
#>         id seasonId name             isPublic  size finalScoringPeriod
#>      <int>    <int> <chr>            <lgl>    <int>              <int>
#> 1 42654852     2022 FFLR Test League TRUE         4                 17
league_teams()
#> # A tibble: 4 × 5
#>   abbrev teamId location nickname   memberId                              
#>   <fct>   <int> <chr>    <chr>      <chr>                                 
#> 1 AUS         1 Austin   Astronauts {22DFE7FF-9DF2-4F3B-9FE7-FF9DF2AF3BD2}
#> 2 BOS         2 Boston   Buzzards   {22DFE7FF-9DF2-4F3B-9FE7-FF9DF2AF3BD2}
#> 3 CHI         3 Chicago  Crowns     {22DFE7FF-9DF2-4F3B-9FE7-FF9DF2AF3BD2}
#> 4 DEN         4 Denver   Devils     {22DFE7FF-9DF2-4F3B-9FE7-FF9DF2AF3BD2}

The scoringPeriodId argument can be used to get data from past weeks.

all_rost <- team_roster(scoringPeriodId = 1)
all_rost$CHI[, 5:13][-7]
#> # A tibble: 16 × 8
#>    lineupSlot playerId firstName lastName   proTeam position projectedScore actualScore
#>    <fct>         <int> <chr>     <chr>      <fct>   <fct>             <dbl>       <dbl>
#>  1 QB          4038941 Justin    Herbert    LAC     QB                20.8         23.3
#>  2 RB          4242335 Jonathan  Taylor     Ind     RB                21.8         27.5
#>  3 RB          3116593 Dalvin    Cook       Min     RB                16.8         13.8
#>  4 WR          4262921 Justin    Jefferson  Min     WR                17.9         39.4
#>  5 WR          4241389 CeeDee    Lamb       Dal     WR                17.0          4.9
#>  6 TE          4360248 Kyle      Pitts      Atl     TE                11.9          3.9
#>  7 FLEX        3116406 Tyreek    Hill       Mia     WR                15.9         18  
#>  8 D/ST         -16002 Bills     D/ST       Buf     D/ST               5.10        18  
#>  9 K           3055899 Harrison  Butker     KC      K                  8.28         9  
#> 10 BE          3042519 Aaron     Jones      GB      RB                15.7         10.6
#> 11 BE          4239993 Tee       Higgins    Cin     WR                14.6          4.7
#> 12 BE          3121422 Terry     McLaurin   Wsh     WR                14.2         13.8
#> 13 BE          4035538 David     Montgomery Chi     RB                14.5          8  
#> 14 BE          3051392 Ezekiel   Elliott    Dal     RB                13.3          5.9
#> 15 BE          3128429 Courtland Sutton     Den     WR                12.8          0  
#> 16 BE          4243537 Gabe      Davis      Buf     WR                12.3         18.8

There are included objects for NFL teams and players.

nfl_teams
#> # A tibble: 33 × 6
#>    proTeamId abbrev location   name    byeWeek conference
#>        <int> <fct>  <chr>      <chr>     <int> <chr>     
#>  1         0 FA     <NA>       FA            0 <NA>      
#>  2         1 Atl    Atlanta    Falcons      14 NFC       
#>  3         2 Buf    Buffalo    Bills         7 AFC       
#>  4         3 Chi    Chicago    Bears        14 NFC       
#>  5         4 Cin    Cincinnati Bengals      10 AFC       
#>  6         5 Cle    Cleveland  Browns        9 AFC       
#>  7         6 Dal    Dallas     Cowboys       9 NFC       
#>  8         7 Den    Denver     Broncos       9 AFC       
#>  9         8 Det    Detroit    Lions         6 NFC       
#> 10         9 GB     Green Bay  Packers      14 NFC       
#> # … with 23 more rows

The fflr project is released with a Contributor Code of Conduct. By contributing, you agree to abide by its terms.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].