API Reference¶
Live Tournament Data¶
pgatourpy.pga_current_tournament ¶
Return this week's tournament ID for a tour.
Reads defaultTournaments from the PGA Tour web-config document
(the same source the frontend uses). Raises PgaTourError if
that tour has no default event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tour
|
str
|
Tour code. Defaults to |
'R'
|
Returns:
| Type | Description |
|---|---|
str
|
Tournament ID (e.g. |
pgatourpy.pga_leaderboard ¶
Get tournament leaderboard.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tournament_id
|
str
|
Tournament ID (e.g., "R2026475"). |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with one row per player. |
pgatourpy.pga_field ¶
Get the tournament field.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tournament_id
|
str
|
Tournament ID (e.g., |
required |
include_withdrawn
|
bool
|
Include withdrawn players. |
True
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with one row per player (field + alternates). |
pgatourpy.pga_field_stats ¶
Get field-level current-form or course-fit stats.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tournament_id
|
str
|
Tournament ID. |
required |
field_stat_type
|
str
|
|
'CURRENT_FORM'
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with one row per player. Shape varies by type. |
pgatourpy.pga_leaderboard_holes ¶
Get hole-by-hole scores for the whole field.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tournament_id
|
str
|
Tournament ID. |
required |
round
|
int | None
|
Round number. Defaults to the API's current round. |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with one row per player per hole. |
pgatourpy.pga_current_leaders ¶
Get current leaders snapshot (top 15).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tournament_id
|
str
|
Tournament ID (e.g., "R2026475"). |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame of current leaders. |
pgatourpy.pga_tee_times ¶
Get tee times for a tournament.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tournament_id
|
str
|
Tournament ID (e.g., "R2026475"). |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with one row per player per round. |
pgatourpy.pga_scorecard ¶
Get hole-by-hole scorecard.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tournament_id
|
str
|
Tournament ID (e.g., "R2026475"). |
required |
player_id
|
str
|
Player ID (e.g., "39971"). |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with one row per hole per round. |
pgatourpy.pga_shot_details ¶
pga_shot_details(tournament_id: str, player_id: str, round: int, *, include_radar: bool = False) -> pd.DataFrame
Get shot-level tracking data with coordinates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tournament_id
|
str
|
Tournament ID (e.g., "R2026475"). |
required |
player_id
|
str
|
Player ID (e.g., "39971"). |
required |
round
|
int
|
Round number (1-4). |
required |
include_radar
|
bool
|
Include radar data. |
False
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with one row per stroke. |
pgatourpy.pga_odds ¶
Get odds to win for a tournament.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tournament_id
|
str
|
Tournament ID (e.g., "R2026475"). |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with player odds data. |
pgatourpy.pga_odds_markets ¶
Get the available betting-market catalog for a tournament.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tournament_id
|
str
|
Tournament ID. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame of market types (To Win, matchups, finishes, …). |
pgatourpy.pga_player_odds ¶
Get FanDuel markets for one player in a tournament.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tournament_id
|
str
|
Tournament ID. |
required |
player_id
|
str
|
Player ID. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame of market lines (finish, matchups, props, …). |
pgatourpy.pga_coverage ¶
Get broadcast/streaming coverage info.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tournament_id
|
str
|
Tournament ID (e.g., "R2026475"). |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame of coverage entries. |
pgatourpy.pga_weather ¶
Get hourly and daily weather for a tournament.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tournament_id
|
str
|
Tournament ID. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with a |
pgatourpy.pga_course_stats ¶
Get per-hole course stats for a tournament.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tournament_id
|
str
|
Tournament ID. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with one row per hole (or summary row) per round. |
Statistics & Standings¶
pgatourpy.pga_stats ¶
pga_stats(stat_id: str | list[str], year: int | list[int] | None = None, tour: str = 'R', *, event_query: str | None = None) -> pd.DataFrame
Get PGA Tour statistics.
Accepts a single stat ID or a list, and a single year or a list. The
upstream StatDetails operation only accepts one (statId, year)
pair per call, so multi-stat or multi-year requests loop client-side
and concatenate. Each row carries stat_id and year columns so
chunks remain distinguishable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stat_id
|
str | list[str]
|
Stat ID (e.g., "02675" for SG: Total) or list of stat IDs. |
required |
year
|
int | list[int] | None
|
Season year or list of years. Defaults to current season. |
None
|
tour
|
str
|
Tour code. Defaults to "R". |
'R'
|
event_query
|
str | None
|
Optional event filter forwarded to the GraphQL
|
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with |
DataFrame
|
rankings. For a single-call result, metadata is also available via |
DataFrame
|
|
DataFrame
|
|
pgatourpy.pga_fedex_cup ¶
pga_fedex_cup(year: int | None = None, tour: str = 'R', *, event_query: str | None = None) -> pd.DataFrame
Get FedExCup standings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
year
|
int | None
|
Season year. Defaults to current year. |
None
|
tour
|
str
|
Tour code. Defaults to "R". |
'R'
|
event_query
|
str | None
|
Optional event filter forwarded to the GraphQL
|
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with player standings. |
pgatourpy.pga_signature_standings ¶
Get Signature Event standings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tour
|
str
|
Tour code. Defaults to |
'R'
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame of official (and interim, if present) standings. |
pgatourpy.pga_priority_rankings ¶
Get priority / exemption rankings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tour
|
str
|
Tour code. Defaults to |
'R'
|
year
|
int | None
|
Season year. Defaults to the current season. |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with one row per (category, player). |
pgatourpy.pga_scorecard_comparison ¶
pga_scorecard_comparison(tournament_id: str, player_ids: list[str], category: str = 'SCORING') -> pd.DataFrame
Get scorecard stat comparison between players.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tournament_id
|
str
|
Tournament ID (e.g., "R2026475"). |
required |
player_ids
|
list[str]
|
List of player IDs to compare. |
required |
category
|
str
|
Comparison category (e.g., "SCORING", "DRIVING"). |
'SCORING'
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame of comparison category pills. |
pgatourpy.pga_course_stats_overview ¶
Get the season course-stats hub.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tour
|
str
|
Tour code. Defaults to |
'R'
|
year
|
int | None
|
Season year. Defaults to the current season. |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
Long DataFrame of category items and their detail labels. |
Players & Tournaments¶
pgatourpy.pga_players ¶
Get PGA Tour player directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tour
|
str
|
Tour code. Defaults to "R". |
'R'
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with one row per player. |
pgatourpy.pga_tournaments ¶
Get tournament metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ids
|
str | list[str]
|
One or more tournament IDs (e.g., "R2026475"). |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with one row per tournament. |
pgatourpy.pga_schedule ¶
Get season schedule.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
year
|
int | None
|
Season year. Defaults to current year. |
None
|
tour
|
str
|
Tour code. Defaults to "R". |
'R'
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with one row per tournament including dates, purse, |
DataFrame
|
course, champion, and FedExCup points. |
pgatourpy.pga_tournament_overview ¶
Get tournament overview tiles and champions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tournament_id
|
str
|
Tournament ID. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
Dict with |
dict
|
(dict or |
dict
|
scalars ( |
dict
|
|
pgatourpy.pga_tournament_past_results ¶
Get historical finishes for a tournament.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tournament_id
|
str
|
Tournament ID (perm id, e.g. |
required |
year
|
int | None
|
Season year. Defaults to the most recent year the API returns. |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with one row per player. |
Player Profiles¶
pgatourpy.pga_player_profile ¶
Get player profile overview.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
player_id
|
str
|
Player ID (e.g., "52955" for Ludvig Aberg). |
required |
Returns:
| Type | Description |
|---|---|
dict
|
Dict with flat bio scalars ( |
dict
|
|
dict
|
|
dict
|
|
dict
|
|
pgatourpy.pga_player_career ¶
Get player career data.
Returns career achievements including starts, cuts, wins, finish distribution, and earnings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
player_id
|
str
|
Player ID. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame of career statistics. |
pgatourpy.pga_player_results ¶
Get player tournament results.
The upstream REST endpoint returns one season per call. Pass
season to request specific years, or omit it to loop every
season listed in resultPills (the 0.2.0 "every season"
contract). Each row carries a season column. Dynamic header
labels are coerced to snake_case and deduplicated so column names
never collide.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
player_id
|
str
|
Player ID. |
required |
season
|
int | list[int] | None
|
Season year, list of years, or |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with one row per tournament across the requested |
DataFrame
|
seasons. |
pgatourpy.pga_player_stats ¶
Get player stats profile.
Returns a player's full statistical profile with ranks and values for 130+ stats in a single call.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
player_id
|
str
|
Player ID. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with one row per stat. |
pgatourpy.pga_player_bio ¶
Get player bio.
Returns biographical text, amateur highlights, and widget data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
player_id
|
str
|
Player ID. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
Dict with |
dict
|
(list of strings), and |
pgatourpy.pga_player_tournament_status ¶
Get player tournament status.
Returns the player's status in the current tournament (if playing).
Returns an empty DataFrame when the API returns no status, or when
every scalar field on the status object is null — callers can rely
on len(df) > 0 to detect "player is in a tournament right now."
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
player_id
|
str
|
Player ID. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with one row, or empty if not currently in a tournament. |
Content¶
pgatourpy.pga_news ¶
pga_news(tour: str = 'R', franchises: list[str] | None = None, player_ids: list[str] | None = None, limit: int = 20, offset: int = 0) -> pd.DataFrame
Get news articles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tour
|
str
|
Tour code. Defaults to "R". |
'R'
|
franchises
|
list[str] | None
|
Filter by franchise categories. |
None
|
player_ids
|
list[str] | None
|
Filter by player IDs. |
None
|
limit
|
int
|
Max articles. Defaults to 20. |
20
|
offset
|
int
|
Pagination offset. |
0
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with one row per article. |
pgatourpy.pga_news_franchises ¶
Get news franchise/category list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tour
|
str
|
Tour code. Defaults to "R". |
'R'
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with franchise and label columns. |
pgatourpy.pga_videos ¶
pga_videos(player_ids: list[str] | None = None, tournament_id: str | None = None, tour: str = 'R', season: str | None = None, franchises: list[str] | None = None, limit: int = 18, offset: int = 0) -> pd.DataFrame
Get player video highlights.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
player_ids
|
list[str] | None
|
Player IDs to filter by. |
None
|
tournament_id
|
str | None
|
Tournament ID (numeric part only, e.g., "475"). |
None
|
tour
|
str
|
Tour code. Defaults to "R". |
'R'
|
season
|
str | None
|
Season year as string. |
None
|
franchises
|
list[str] | None
|
Franchise filters. |
None
|
limit
|
int
|
Max videos. Defaults to 18. |
18
|
offset
|
int
|
Pagination offset. |
0
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame of videos. |
pgatourpy.pga_tourcast_videos ¶
pga_tourcast_videos(tournament_id: str, player_id: str, round: int, *, hole: int | None = None, shot: int | None = None) -> pd.DataFrame
Get shot-by-shot video clips for a player round.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tournament_id
|
str
|
Tournament ID (e.g., "R2026475"). |
required |
player_id
|
str
|
Player ID. |
required |
round
|
int
|
Round number. |
required |
hole
|
int | None
|
Specific hole number. |
None
|
shot
|
int | None
|
Specific shot number. |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame of video clips. |
pgatourpy.pga_content ¶
Fetch a CMS content fragment from the GraphQL GenericContentCompressed op.
The shape of the returned object varies by path — it is whatever
the CMS publishes for that URL. Returned as the raw parsed JSON,
not a DataFrame, since the schema isn't stable across paths.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
CMS path (e.g. a tournament landing-page slug). |
required |
Returns:
| Type | Description |
|---|---|
Any
|
Parsed JSON from the decompressed payload, or |
Any
|
operation returns no payload. |
pgatourpy.pga_odds_interactivity ¶
Fetch the odds-interactivity widget configuration (REST).
Returns the raw parsed JSON — schema is whatever the widget needs and isn't worth coercing into a DataFrame.
pgatourpy.pga_speed_rounds ¶
Fetch the speed-rounds video index for a tour (REST).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tour
|
str
|
Tour code. Defaults to "R". |
'R'
|
Returns:
| Type | Description |
|---|---|
Any
|
Raw parsed JSON from |
Errors¶
pgatourpy.PgaTourError ¶
Bases: RuntimeError
Raised when a PGA Tour API call fails in a way the caller may want to handle.