Skip to contents

Retrieves hole-by-hole scoring data for tournaments.

Usage

load_holes(
  year = as.integer(format(Sys.Date(), "%Y")),
  tournament = NULL,
  top_n = NULL,
  tour = "pga",
  live = FALSE
)

get_player_scorecards(event_id, athlete_id)

Arguments

year

Season year (e.g., 2026). Defaults to current year.

tournament

Tournament identifier - either event_id or partial name match.

top_n

Number of top finishers to include. Default NULL returns all.

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)

athlete_id

ESPN athlete identifier (for legacy function)

Value

A tibble with hole-by-hole data including:

  • player_id: ESPN athlete ID

  • player_name: Player display name

  • position: Final leaderboard standing

  • round: Round number (1-4; playoff holes come as an extra round)

  • hole: Hole number (1-18)

  • par: Par for the hole

  • score: Player's score on the hole

  • score_type: BIRDIE, PAR, BOGEY, EAGLE, etc.

  • tournament_id: Event ID

  • field_avg, vs_field, to_par, cume_to_par: Field average on the hole that round, strokes against it, score to par and running score to par (hosted data)

  • win_prob, win_prob_before, wpa: Chance of winning after and before the hole, and the difference (hosted PGA Tour stroke play events)

  • skill_rating: Pre-event rating, strokes per round better than an average tour player

  • hole_order_source: "shotlink" when the player's starting tee is known, else "assumed" (holes 1 to 18)

A tibble with hole-by-hole scoring data

Details

For PGA Tour data, completed tournaments from 2004 on are served from pre-built full-field files hosted on GitHub releases (updated daily), avoiding the one-request-per-player cost of the live ESPN API. The live API is used as a fallback for in-progress tournaments, other tours, or when the hosted data is unavailable. Hosted files also carry win probability for every hole; see [add_win_probability()] for the method.

Functions

  • get_player_scorecards(): Deprecated, use `load_holes()` instead

Examples

# \donttest{
# Load hole-by-hole for top 10 at Sony Open
holes <- load_holes(2026, "Sony", top_n = 10)
# }