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. 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)
- 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)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 ID
A tibble with hole-by-hole scoring data
Details
For PGA Tour data, completed tournaments 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.
