Skip to contents

This function allows you to scrape each team's payroll from Spotrac.

Usage

sptrc_league_payrolls(year = most_recent_mlb_season())

Arguments

year

Year to load

Value

A data frame of contract data.

col_nametypesdescription
yearcharacterPayroll season.
teamcharacterFull team name.
team_abbrcharacterTeam abbreviation.
ranknumericLeague rank by total payroll allocations.
recordcharacterTeam win-loss record for the season.
avg_age_teamcharacterRoster-weighted average age of the team.
total_payroll_allocationsnumericTotal payroll allocations across all roster statuses (USD).
active_26_mannumericPayroll allocated to the active 26-man roster (USD).
injurednumericPayroll allocated to players on the injured list (USD).
retainednumericRetained salary owed to players no longer on the roster (USD).
buriednumericPayroll for players assigned to the minors ("buried" contracts) (USD).

Column names after rank mirror Spotrac's current league-payroll table and may change as Spotrac updates its layout.

Examples

# \donttest{
  try(sptrc_league_payrolls(year = most_recent_mlb_season()))
#>  2026-09-10 00:50:35.156743: Invalid arguments or no contract data available!
#> data frame with 0 columns and 0 rows
# }