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 IDplayer_name: Player display nameposition: Final leaderboard standinground: Round number (1-4; playoff holes come as an extra round)hole: Hole number (1-18)par: Par for the holescore: Player's score on the holescore_type: BIRDIE, PAR, BOGEY, EAGLE, etc.tournament_id: Event IDfield_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 playerhole_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.
