Retrieves leaderboard data for tournaments. Can load a single tournament or all tournaments for a year.
Usage
load_leaderboard(
year = as.integer(format(Sys.Date(), "%Y")),
tournament = NULL,
tour = "pga",
live = FALSE
)
get_tournament_leaderboard(event_id)Arguments
- year
Season year (e.g., 2026). Defaults to current year.
- tournament
Tournament identifier - either event_id or partial name match. If NULL, returns all tournaments for the year.
- tour
Tour identifier. Currently supports "pga" (default).
- live
If TRUE, skip the hosted data and fetch directly from the ESPN API. Defaults to FALSE.
- event_id
ESPN event identifier (for legacy function)
Value
A tibble with leaderboard data including:
position: Final standingplayer_id: ESPN athlete IDplayer_name: Player display nametotal_score: Total strokesscore_to_par: Score relative to par (e.g., "-11")tournament_id: Event IDtournament_name: Tournament name
A tibble with leaderboard data
Details
For PGA Tour data, completed tournaments are served from pre-built files hosted on GitHub releases (updated daily), which is much faster than querying ESPN tournament by tournament. The live ESPN API is used as a fallback for in-progress tournaments, other tours, or when the hosted data is unavailable.
