Skip to contents

Get pre-game win probability data from API

Usage

cfbd_metrics_wp_pregame(
  year = NULL,
  week = NULL,
  team = NULL,
  season_type = "both"
)

Arguments

year

(Integer optional): Year, 4 digit format (YYYY)

week

(Integer optional): Week - values from 1-15, 1-14 for seasons pre-playoff, i.e. 2013 or earlier

team

(String optional): D-I Team

season_type

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

Value

cfbd_metrics_wp_pregame() - A data frame with 9 variables:

col_nametypesdescription
seasonintegerSeason of the game.
season_typecharacterSeason type of the game (regular, postseason, etc.).
weekintegerGame week of the season.
game_idintegerReferencing game id.
home_teamcharacterHome team name.
away_teamcharacterAway team name.
spreadnumericBetting line provider spread.
home_win_probnumericHome win probability - pre-game prediction (0-1).
away_win_probnumericAway win probability - pre-game prediction (0-1).

Examples

# \donttest{
  try(cfbd_metrics_wp_pregame(year = 2019, week = 9, team = "Texas A&M"))
#> ── pre-game WP data from CollegeFootballData.com ───────────── cfbfastR 2.3.0 ──
#>  Data updated: 2026-06-13 04:18:18 UTC
#> # A tibble: 1 × 9
#>   season season_type  week   game_id home_team away_team    spread home_win_prob
#>    <int> <chr>       <int>     <int> <chr>     <chr>         <int>         <dbl>
#> 1   2019 regular         9 401110835 Texas A&M Mississippi…    -11         0.776
#> # ℹ 1 more variable: away_win_prob <dbl>
# }