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. 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 ID

  • player_name: Player display name

  • position: Final leaderboard standing

  • round: Round number (1-4)

  • 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

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.

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)
# }