Skip to contents

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: `"pga"` (default), `"liv"`, `"lpga"`, `"euro"`, or `"champions"`.

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 standing

  • player_id: ESPN athlete ID

  • player_name: Player display name

  • total_score: Total strokes

  • score_to_par: Score relative to par (e.g., "-11")

  • tournament_id: Event ID

  • tournament_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.

Functions

  • get_tournament_leaderboard(): Deprecated, use `load_leaderboard()` instead

Examples

# \donttest{
# Load specific tournament by name
sony <- load_leaderboard(2026, "Sony")
# }