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     2024               1      1 AUS    QB          3139477 Patrick   Mahomes 
#>  2     2024               1      1 AUS    RB          3117251 Christian McCaffr…
#>  3     2024               1      1 AUS    RB          4242335 Jonathan  Taylor  
#>  4     2024               1      1 AUS    WR          3116406 Tyreek    Hill    
#>  5     2024               1      1 AUS    WR          4361370 Chris     Olave   
#>  6     2024               1      1 AUS    TE            15847 Travis    Kelce   
#>  7     2024               1      1 AUS    FLEX        4361529 Isiah     Pacheco 
#>  8     2024               1      1 AUS    D/ST         -16005 Browns    D/ST    
#>  9     2024               1      1 AUS    K           2971573 Ka'imi    Fairbai…
#> 10     2024               1      1 AUS    BE          3116385 Joe       Mixon   
#> 11     2024               1      1 AUS    BE          4047650 DK        Metcalf 
#> 12     2024               1      1 AUS    BE          3054850 Alvin     Kamara  
#> 13     2024               1      1 AUS    BE          4241478 DeVonta   Smith   
#> 14     2024               1      1 AUS    BE          4595348 Malik     Nabers  
#> 15     2024               1      1 AUS    BE          4569173 Rhamondre Stevens…
#> 16     2024               1      1 AUS    BE          4239993 Tee       Higgins 
#> # ℹ 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     2024               1      2 BOS    QB          4429084 Anthony   Richard…
#>  2     2024               1      2 BOS    RB          4430737 Kyren     Williams
#>  3     2024               1      2 BOS    RB          3043078 Derrick   Henry   
#>  4     2024               1      2 BOS    WR          4241389 CeeDee    Lamb    
#>  5     2024               1      2 BOS    WR          4362628 Ja'Marr   Chase   
#>  6     2024               1      2 BOS    TE          4430027 Sam       LaPorta 
#>  7     2024               1      2 BOS    FLEX        4047646 A.J.      Brown   
#>  8     2024               1      2 BOS    D/ST         -16006 Cowboys   D/ST    
#>  9     2024               1      2 BOS    K           3953687 Brandon   Aubrey  
#> 10     2024               1      2 BOS    BE          4426502 Drake     London  
#> 11     2024               1      2 BOS    BE          4697815 Rachaad   White   
#> 12     2024               1      2 BOS    BE          2976212 Stefon    Diggs   
#> 13     2024               1      2 BOS    BE          3915416 DJ        Moore   
#> 14     2024               1      2 BOS    BE          3126486 Deebo     Samuel …
#> 15     2024               1      2 BOS    BE          3916387 Lamar     Jackson 
#> 16     2024               1      2 BOS    BE          4366031 Tank      Dell    
#> # ℹ 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     2024               1      3 CHI    QB          3918298 Josh      Allen   
#>  2     2024               1      3 CHI    RB          4430807 Bijan     Robinson
#>  3     2024               1      3 CHI    RB          4239996 Travis    Etienne…
#>  4     2024               1      3 CHI    WR          4262921 Justin    Jeffers…
#>  5     2024               1      3 CHI    WR          4569618 Garrett   Wilson  
#>  6     2024               1      3 CHI    TE          3116365 Mark      Andrews 
#>  7     2024               1      3 CHI    FLEX        4426515 Puka      Nacua   
#>  8     2024               1      3 CHI    D/ST         -16033 Ravens    D/ST    
#>  9     2024               1      3 CHI    K             15683 Justin    Tucker  
#> 10     2024               1      3 CHI    BE          4432708 Marvin    Harriso…
#> 11     2024               1      3 CHI    BE          4429160 De'Von    Achane  
#> 12     2024               1      3 CHI    BE          4258173 Nico      Collins 
#> 13     2024               1      3 CHI    BE          4360438 Brandon   Aiyuk   
#> 14     2024               1      3 CHI    BE          4567048 Kenneth   Walker …
#> 15     2024               1      3 CHI    BE          3042519 Aaron     Jones   
#> 16     2024               1      3 CHI    BE          4429615 Zay       Flowers 
#> # ℹ 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     2024               1      4 DEN    QB          4040715 Jalen     Hurts   
#>  2     2024               1      4 DEN    RB          4427366 Breece    Hall    
#>  3     2024               1      4 DEN    RB          3929630 Saquon    Barkley 
#>  4     2024               1      4 DEN    WR          4374302 Amon-Ra   St. Bro…
#>  5     2024               1      4 DEN    WR          4035687 Michael   Pittman…
#>  6     2024               1      4 DEN    TE          4361307 Trey      McBride 
#>  7     2024               1      4 DEN    FLEX        4429795 Jahmyr    Gibbs   
#>  8     2024               1      4 DEN    D/ST         -16025 49ers     D/ST    
#>  9     2024               1      4 DEN    K           3050478 Jake      Elliott 
#> 10     2024               1      4 DEN    BE            16800 Davante   Adams   
#> 11     2024               1      4 DEN    BE          4379399 James     Cook    
#> 12     2024               1      4 DEN    BE            16737 Mike      Evans   
#> 13     2024               1      4 DEN    BE          4047365 Josh      Jacobs  
#> 14     2024               1      4 DEN    BE          4372016 Jaylen    Waddle  
#> 15     2024               1      4 DEN    BE          2977187 Cooper    Kupp    
#> 16     2024               1      4 DEN    BE          3925357 Calvin    Ridley  
#> # ℹ 8 more variables: proTeam <fct>, position <fct>, injuryStatus <chr>,
#> #   projectedScore <dbl>, actualScore <dbl>, percentStarted <dbl>,
#> #   percentOwned <dbl>, percentChange <dbl>
#>