Skip to contents

Get team statistics by game

Usage

cfbd_game_team_stats(
  year = NULL,
  week = NULL,
  season_type = "regular",
  team = NULL,
  conference = NULL,
  game_id = NULL,
  division = "fbs",
  rows_per_team = 1
)

Arguments

year

(Integer required): Year, 4 digit format (YYYY). Required year filter (along with one of week, team, or conference), unless game_id is specified
Minimum value accepted: 2004

week

(Integer optional): Week - values range from 1-15, 1-14 for seasons pre-playoff, i.e. 2013 or earlier. Required if team and conference not specified.

season_type

(String default: regular): Select Season Type - regular, postseason, both, allstar, spring_regular, spring_postseason

team

(String optional): D-I Team. Required if week and conference not specified.

conference

(String optional): Conference abbreviation - Select a valid FBS conference Conference abbreviations P5: ACC, B12, B1G, SEC, PAC Conference abbreviations G5 and FBS Independents: CUSA, MAC, MWC, Ind, SBC, AAC Required if week and team not specified.

game_id

(Integer optional): Game ID filter for querying a single game. When supplied it is sent alone as id; year, week, season_type, team and conference are omitted (CFBD rejects them alongside id). Can be found using the cfbd_game_info() function

division

(String optional): Division abbreviation - Select a valid division: fbs/fcs/ii/iii

rows_per_team

(Integer default 1): Both Teams for each game on one or two row(s), Options: 1 or 2

Value

A data frame with one row per team per game and 78 variables. A team query keeps only that team's rows (CFBD returns both teams of each game); a conference query keeps only the rows of that conference's teams. The box-score statistics are character, as CFBD sends them, and NA when CFBD has no value for that team. Every column from points to possession_time is repeated with the suffix _allowed, holding the opponent's value from the same game. With rows_per_team = 2, opponent, opponent_conference and the _allowed columns are dropped (40 variables). NULL is returned with a warning when CFBD returns no games (e.g. a bye week), and an empty data frame if the request fails.

col_nametypedescription
game_idintegerUnique CFBD game identifier.
schoolcharacterTeam name (CFBD team, renamed).
conferencecharacterConference of the team.
home_awaycharacterhome or away.
opponentcharacterOpponent team name; absent with rows_per_team = 2.
opponent_conferencecharacterConference of the opponent; absent with rows_per_team = 2.
pointsintegerTeam points.
total_yardscharacterTotal offensive yards.
net_passing_yardscharacterNet passing yards.
completion_attemptscharacterCompletions and pass attempts as completions-attempts text (e.g. 21-28).
passing_tdscharacterPassing touchdowns.
yards_per_passcharacterYards per pass attempt.
passes_interceptedcharacterOpponent passes the team intercepted; NA when none recorded.
interception_yardscharacterReturn yards on the team's interceptions.
interception_tdscharacterInterceptions the team returned for a touchdown.
rushing_attemptscharacterRushing attempts.
rushing_yardscharacterRushing yards.
rush_tdscharacterRushing touchdowns.
yards_per_rush_attemptcharacterYards per rushing attempt.
first_downscharacterFirst downs.
third_down_effcharacterThird-down conversions as conversions-attempts text (e.g. 6-11).
fourth_down_effcharacterFourth-down conversions as conversions-attempts text (e.g. 1-1).
punt_returnscharacterPunt returns; NA when none recorded.
punt_return_yardscharacterPunt return yards.
punt_return_tdscharacterPunt return touchdowns.
kick_return_yardscharacterKickoff return yards.
kick_return_tdscharacterKickoff return touchdowns.
kick_returnscharacterKickoff returns.
kicking_pointscharacterPoints from kicking (field goals and extra points).
fumbles_recoveredcharacterFumbles recovered.
fumbles_lostcharacterFumbles lost to the opponent.
total_fumblescharacterTotal fumbles; NA when none recorded.
tacklescharacterTackles.
tackles_for_losscharacterTackles for loss.
sackscharacterSacks by the team's defense.
qb_hurriescharacterQuarterback hurries by the team's defense.
interceptionscharacterInterceptions thrown by the team (counted in turnovers).
passes_deflectedcharacterPasses deflected by the team's defense.
turnoverscharacterTurnovers committed.
defensive_tdscharacterDefensive touchdowns.
total_penalties_yardscharacterPenalties and penalty yards as penalties-yards text (e.g. 8-71).
possession_timecharacterTime of possession as minutes:seconds text (e.g. 36:19).
points_allowedintegerPoints scored by the opponent.
total_yards_allowedcharacterOpponent total offensive yards.
net_passing_yards_allowedcharacterOpponent net passing yards.
completion_attempts_allowedcharacterOpponent completions and pass attempts as completions-attempts text.
passing_tds_allowedcharacterOpponent passing touchdowns.
yards_per_pass_allowedcharacterOpponent yards per pass attempt.
passes_intercepted_allowedcharacterTeam passes the opponent intercepted; NA when none recorded.
interception_yards_allowedcharacterReturn yards on the opponent's interceptions.
interception_tds_allowedcharacterInterceptions the opponent returned for a touchdown.
rushing_attempts_allowedcharacterOpponent rushing attempts.
rushing_yards_allowedcharacterOpponent rushing yards.
rush_tds_allowedcharacterOpponent rushing touchdowns.
yards_per_rush_attempt_allowedcharacterOpponent yards per rushing attempt.
first_downs_allowedcharacterOpponent first downs.
third_down_eff_allowedcharacterOpponent third-down conversions as conversions-attempts text.
fourth_down_eff_allowedcharacterOpponent fourth-down conversions as conversions-attempts text.
punt_returns_allowedcharacterOpponent punt returns; NA when none recorded.
punt_return_yards_allowedcharacterOpponent punt return yards.
punt_return_tds_allowedcharacterOpponent punt return touchdowns.
kick_return_yards_allowedcharacterOpponent kickoff return yards.
kick_return_tds_allowedcharacterOpponent kickoff return touchdowns.
kick_returns_allowedcharacterOpponent kickoff returns.
kicking_points_allowedcharacterOpponent points from kicking.
fumbles_recovered_allowedcharacterOpponent fumbles recovered.
fumbles_lost_allowedcharacterFumbles the opponent lost.
total_fumbles_allowedcharacterOpponent total fumbles; NA when none recorded.
tackles_allowedcharacterOpponent tackles.
tackles_for_loss_allowedcharacterOpponent tackles for loss.
sacks_allowedcharacterSacks by the opponent's defense.
qb_hurries_allowedcharacterQuarterback hurries by the opponent's defense.
interceptions_allowedcharacterInterceptions thrown by the opponent.
passes_deflected_allowedcharacterPasses deflected by the opponent's defense.
turnovers_allowedcharacterTurnovers committed by the opponent.
defensive_tds_allowedcharacterOpponent defensive touchdowns.
total_penalties_yards_allowedcharacterOpponent penalties and penalty yards as penalties-yards text.
possession_time_allowedcharacterOpponent time of possession.

Examples

# \donttest{
  try(cfbd_game_team_stats(2022, team = "LSU"))
#> ── Team stats data from CollegeFootballData.com ───────── cfbfastR 3.0.0.9000 ──
#> ℹ Data updated: 2026-10-12 12:59:13 UTC
#> # A tibble: 13 × 78
#>      game_id school conference home_away opponent     opponent_conference points
#>        <int> <chr>  <chr>      <chr>     <chr>        <chr>                <int>
#>  1 401403923 LSU    SEC        home      Ole Miss     SEC                     45
#>  2 401403939 LSU    SEC        away      Arkansas     SEC                     13
#>  3 401403873 LSU    SEC        home      Southern     SWAC                    65
#>  4 401403934 LSU    SEC        home      Alabama      SEC                     32
#>  5 401403885 LSU    SEC        home      Mississippi… SEC                     31
#>  6 401403963 LSU    SEC        away      Texas A&M    SEC                     23
#>  7 401403903 LSU    SEC        away      Auburn       SEC                     21
#>  8 401403867 LSU    SEC        away      Florida Sta… ACC                     23
#>  9 401437036 LSU    SEC        away      Georgia      SEC                     30
#> 10 401426612 LSU    SEC        home      UAB          Conference USA          41
#> 11 401403897 LSU    SEC        home      New Mexico   Mountain West           38
#> 12 401403917 LSU    SEC        away      Florida      SEC                     45
#> 13 401403913 LSU    SEC        home      Tennessee    SEC                     13
#> # ℹ 71 more variables: total_yards <chr>, net_passing_yards <chr>,
#> #   completion_attempts <chr>, passing_tds <chr>, yards_per_pass <chr>,
#> #   passes_intercepted <chr>, interception_yards <chr>, interception_tds <chr>,
#> #   rushing_attempts <chr>, rushing_yards <chr>, rush_tds <chr>,
#> #   yards_per_rush_attempt <chr>, first_downs <chr>, third_down_eff <chr>,
#> #   fourth_down_eff <chr>, punt_returns <chr>, punt_return_yards <chr>,
#> #   punt_return_tds <chr>, kick_return_yards <chr>, kick_return_tds <chr>, …

  try(cfbd_game_team_stats(2013, team = "Florida State"))
#> ── Team stats data from CollegeFootballData.com ───────── cfbfastR 3.0.0.9000 ──
#> ℹ Data updated: 2026-10-12 12:59:14 UTC
#> # A tibble: 13 × 78
#>      game_id school     conference home_away opponent opponent_conference points
#>        <int> <chr>      <chr>      <chr>     <chr>    <chr>                <int>
#>  1 332640052 Florida S… ACC        home      Bethune… MEAC                    54
#>  2 332450221 Florida S… ACC        away      Pittsbu… ACC                     41
#>  3 332710103 Florida S… ACC        away      Boston … ACC                     48
#>  4 332780052 Florida S… ACC        home      Maryland ACC                     63
#>  5 333200052 Florida S… ACC        home      Syracuse ACC                     59
#>  6 333340057 Florida S… ACC        away      Florida  SEC                     37
#>  7 333130154 Florida S… ACC        away      Wake Fo… ACC                     59
#>  8 332920228 Florida S… ACC        away      Clemson  ACC                     51
#>  9 333270052 Florida S… ACC        home      Idaho    FBS Independents        80
#> 10 332990052 Florida S… ACC        home      NC State ACC                     49
#> 11 332570052 Florida S… ACC        home      Nevada   Mountain West           62
#> 12 333060052 Florida S… ACC        home      Miami    ACC                     41
#> 13 333410052 Florida S… ACC        home      Duke     ACC                     45
#> # ℹ 71 more variables: total_yards <chr>, net_passing_yards <chr>,
#> #   completion_attempts <chr>, passing_tds <chr>, yards_per_pass <chr>,
#> #   passes_intercepted <chr>, interception_yards <chr>, interception_tds <chr>,
#> #   rushing_attempts <chr>, rushing_yards <chr>, rush_tds <chr>,
#> #   yards_per_rush_attempt <chr>, first_downs <chr>, third_down_eff <chr>,
#> #   fourth_down_eff <chr>, punt_returns <chr>, punt_return_yards <chr>,
#> #   punt_return_tds <chr>, kick_return_yards <chr>, kick_return_tds <chr>, …
# }