The roster of all teams in a league.

team_roster(
  leagueId = ffl_id(),
  leagueHistory = FALSE,
  scoringPeriodId = NULL,
  ...
)

Arguments

leagueId

Numeric league ID or ESPN fantasy page URL. Defaults to getOption("fflr.leagueId"). Function fails if no ID is found.

leagueHistory

logical; Should the leagueHistory version of the API be called? If TRUE, a list of results is returned, with one element for each historical year of the league.

scoringPeriodId

Integer week of NFL season. By default, NULL will use the current week (see ffl_week()). Scoring periods are always one week in length, whereas matchups might be longer.

...

Additional queries passed to httr::GET(). Arguments are converted to a named list and passed to query alongside view.

Value

A dataframe (or list) with league teams.

See also

Other roster functions: best_roster(), roster_score(), start_roster()

Examples

team_roster(leagueId = "42654852", scoringPeriodId = 1)
#> $AUS
#> # A tibble: 16 × 16
#>    seasonId scoringPeriodId teamId abbrev lineupSlot playerId firstName lastName
#>       <int>           <int>  <int> <fct>  <fct>         <int> <chr>     <chr>   
#>  1     2021               1      1 AUS    QB          3139477 Patrick   Mahomes 
#>  2     2021               1      1 AUS    RB          3117251 Christian McCaffr…
#>  3     2021               1      1 AUS    RB          4242335 Jonathan  Taylor  
#>  4     2021               1      1 AUS    WR            16800 Davante   Adams   
#>  5     2021               1      1 AUS    WR          3925357 Calvin    Ridley  
#>  6     2021               1      1 AUS    TE          3116365 Mark      Andrews 
#>  7     2021               1      1 AUS    FLEX        4360294 Antonio   Gibson  
#>  8     2021               1      1 AUS    D/ST         -16027 Buccanee… D/ST    
#>  9     2021               1      1 AUS    K           2473037 Jason     Myers   
#> 10     2021               1      1 AUS    BE          4259545 D'Andre   Swift   
#> 11     2021               1      1 AUS    BE          4045163 Miles     Sanders 
#> 12     2021               1      1 AUS    BE          3919596 Chris     Carson  
#> 13     2021               1      1 AUS    BE            16799 Allen     Robinso…
#> 14     2021               1      1 AUS    BE            16460 Adam      Thielen 
#> 15     2021               1      1 AUS    BE          3932905 Diontae   Johnson 
#> 16     2021               1      1 AUS    BE          3128429 Courtland Sutton  
#> # … with 8 more variables: proTeam <fct>, position <fct>, injuryStatus <chr>,
#> #   projectedScore <dbl>, actualScore <dbl>, percentStarted <dbl>,
#> #   percentOwned <dbl>, percentChange <dbl>
#> 
#> $BOS
#> # A tibble: 16 × 16
#>    seasonId scoringPeriodId teamId abbrev lineupSlot playerId firstName lastName
#>       <int>           <int>  <int> <fct>  <fct>         <int> <chr>     <chr>   
#>  1     2021               1      2 BOS    QB          2577417 Dak       Prescott
#>  2     2021               1      2 BOS    RB          3116593 Dalvin    Cook    
#>  3     2021               1      2 BOS    RB          3051392 Ezekiel   Elliott 
#>  4     2021               1      2 BOS    WR          3116406 Tyreek    Hill    
#>  5     2021               1      2 BOS    WR          4047650 DK        Metcalf 
#>  6     2021               1      2 BOS    TE          3040151 George    Kittle  
#>  7     2021               1      2 BOS    FLEX        3128720 Nick      Chubb   
#>  8     2021               1      2 BOS    D/ST         -16023 Steelers  D/ST    
#>  9     2021               1      2 BOS    K             16339 Brandon   McManus 
#> 10     2021               1      2 BOS    BE          4242214 Clyde     Edwards…
#> 11     2021               1      2 BOS    BE          3121422 Terry     McLaurin
#> 12     2021               1      2 BOS    BE          2976499 Amari     Cooper  
#> 13     2021               1      2 BOS    BE          4039359 Darrell   Henders…
#> 14     2021               1      2 BOS    BE            13982 Julio     Jones   
#> 15     2021               1      2 BOS    BE          2977187 Cooper    Kupp    
#> 16     2021               1      2 BOS    BE          2974858 Kenny     Golladay
#> # … with 8 more variables: proTeam <fct>, position <fct>, injuryStatus <chr>,
#> #   projectedScore <dbl>, actualScore <dbl>, percentStarted <dbl>,
#> #   percentOwned <dbl>, percentChange <dbl>
#> 
#> $CHI
#> # A tibble: 16 × 16
#>    seasonId scoringPeriodId teamId abbrev lineupSlot playerId firstName lastName
#>       <int>           <int>  <int> <fct>  <fct>         <int> <chr>     <chr>   
#>  1     2021               1      3 CHI    QB          3918298 Josh      Allen   
#>  2     2021               1      3 CHI    RB          3929630 Saquon    Barkley 
#>  3     2021               1      3 CHI    RB          3043078 Derrick   Henry   
#>  4     2021               1      3 CHI    WR            15795 DeAndre   Hopkins 
#>  5     2021               1      3 CHI    WR          4262921 Justin    Jeffers…
#>  6     2021               1      3 CHI    TE          2576925 Darren    Waller  
#>  7     2021               1      3 CHI    FLEX        3068267 Austin    Ekeler  
#>  8     2021               1      3 CHI    D/ST         -16033 Ravens    D/ST    
#>  9     2021               1      3 CHI    K             15683 Justin    Tucker  
#> 10     2021               1      3 CHI    BE          3116385 Joe       Mixon   
#> 11     2021               1      3 CHI    BE            15818 Keenan    Allen   
#> 12     2021               1      3 CHI    BE            16737 Mike      Evans   
#> 13     2021               1      3 CHI    BE          4047365 Josh      Jacobs  
#> 14     2021               1      3 CHI    BE          3886818 Myles     Gaskin  
#> 15     2021               1      3 CHI    BE          4362628 Ja'Marr   Chase   
#> 16     2021               1      3 CHI    BE          4360438 Brandon   Aiyuk   
#> # … with 8 more variables: proTeam <fct>, position <fct>, injuryStatus <chr>,
#> #   projectedScore <dbl>, actualScore <dbl>, percentStarted <dbl>,
#> #   percentOwned <dbl>, percentChange <dbl>
#> 
#> $DEN
#> # A tibble: 16 × 16
#>    seasonId scoringPeriodId teamId abbrev lineupSlot playerId firstName lastName
#>       <int>           <int>  <int> <fct>  <fct>         <int> <chr>     <chr>   
#>  1     2021               1      4 DEN    QB          3917315 Kyler     Murray  
#>  2     2021               1      4 DEN    RB          3054850 Alvin     Kamara  
#>  3     2021               1      4 DEN    RB          3042519 Aaron     Jones   
#>  4     2021               1      4 DEN    WR          2976212 Stefon    Diggs   
#>  5     2021               1      4 DEN    WR          4047646 A.J.      Brown   
#>  6     2021               1      4 DEN    TE            15847 Travis    Kelce   
#>  7     2021               1      4 DEN    FLEX        4241457 Najee     Harris  
#>  8     2021               1      4 DEN    D/ST         -16025 49ers     D/ST    
#>  9     2021               1      4 DEN    K           3055899 Harrison  Butker  
#> 10     2021               1      4 DEN    BE          4035538 David     Montgom…
#> 11     2021               1      4 DEN    BE          4241985 J.K.      Dobbins 
#> 12     2021               1      4 DEN    BE            15880 Robert    Woods   
#> 13     2021               1      4 DEN    BE          4241389 CeeDee    Lamb    
#> 14     2021               1      4 DEN    BE          3915416 DJ        Moore   
#> 15     2021               1      4 DEN    BE          3116165 Chris     Godwin  
#> 16     2021               1      4 DEN    BE          2577327 Tyler     Lockett 
#> # … with 8 more variables: proTeam <fct>, position <fct>, injuryStatus <chr>,
#> #   projectedScore <dbl>, actualScore <dbl>, percentStarted <dbl>,
#> #   percentOwned <dbl>, percentChange <dbl>
#>