API Reference¶
Live Tournament Data¶
pga_tour_api.pga_current_tournament(tour: str = 'R') -> str
¶
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. |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_leaderboard(tournament_id: str) -> pd.DataFrame
¶
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. |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_field(tournament_id: str, *, include_withdrawn: bool = True) -> pd.DataFrame
¶
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). |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_field_stats(tournament_id: str, field_stat_type: str = 'CURRENT_FORM') -> pd.DataFrame
¶
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. |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_leaderboard_holes(tournament_id: str, round: int | None = None) -> pd.DataFrame
¶
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. |
Source code in src/pga_tour_api/client.py
1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 | |
pga_tour_api.pga_current_leaders(tournament_id: str) -> pd.DataFrame
¶
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. |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_tee_times(tournament_id: str) -> pd.DataFrame
¶
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. |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_scorecard(tournament_id: str, player_id: str) -> pd.DataFrame
¶
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. |
Source code in src/pga_tour_api/client.py
pga_tour_api.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. |
Source code in src/pga_tour_api/client.py
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 | |
pga_tour_api.pga_odds(tournament_id: str) -> pd.DataFrame
¶
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. |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_odds_markets(tournament_id: str) -> pd.DataFrame
¶
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, …). |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_player_odds(tournament_id: str, player_id: str) -> pd.DataFrame
¶
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, …). |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_coverage(tournament_id: str) -> pd.DataFrame
¶
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. |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_weather(tournament_id: str) -> pd.DataFrame
¶
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 |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_course_stats(tournament_id: str) -> pd.DataFrame
¶
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. |
Source code in src/pga_tour_api/client.py
Statistics & Standings¶
pga_tour_api.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
|
|
Source code in src/pga_tour_api/client.py
pga_tour_api.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. |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_signature_standings(tour: str = 'R') -> pd.DataFrame
¶
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. |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_priority_rankings(tour: str = 'R', year: int | None = None) -> pd.DataFrame
¶
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). |
Source code in src/pga_tour_api/client.py
pga_tour_api.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. |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_course_stats_overview(tour: str = 'R', year: int | None = None) -> pd.DataFrame
¶
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. |
Source code in src/pga_tour_api/client.py
Players & Tournaments¶
pga_tour_api.pga_players(tour: str = 'R') -> pd.DataFrame
¶
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. |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_tournaments(ids: str | list[str]) -> pd.DataFrame
¶
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. |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_schedule(year: int | None = None, tour: str = 'R') -> pd.DataFrame
¶
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. |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_tournament_overview(tournament_id: str) -> dict
¶
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
|
|
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_tournament_past_results(tournament_id: str, year: int | None = None) -> pd.DataFrame
¶
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. |
Source code in src/pga_tour_api/client.py
Player Profiles¶
pga_tour_api.pga_player_profile(player_id: str) -> dict
¶
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
|
|
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_player_career(player_id: str) -> pd.DataFrame
¶
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. |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_player_results(player_id: str, season: int | list[int] | None = None) -> pd.DataFrame
¶
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. |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_player_stats(player_id: str) -> pd.DataFrame
¶
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. |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_player_bio(player_id: str) -> dict
¶
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 |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_player_tournament_status(player_id: str) -> pd.DataFrame
¶
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. |
Source code in src/pga_tour_api/client.py
Content¶
pga_tour_api.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. |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_news_franchises(tour: str = 'R') -> pd.DataFrame
¶
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. |
Source code in src/pga_tour_api/client.py
pga_tour_api.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. |
Source code in src/pga_tour_api/client.py
1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 | |
pga_tour_api.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. |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_content(path: str) -> Any
¶
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. |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_odds_interactivity() -> Any
¶
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.
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_speed_rounds(tour: str = 'R') -> Any
¶
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 |
Source code in src/pga_tour_api/client.py
Errors¶
pga_tour_api.PgaTourError
¶
Records and detailed performance¶
Added on 2026-09-24: four functions and four GraphQL operations. These are unofficial upstream data, not independently validated records.
import pga_tour_api as pga
stats = pga.pga_scorecard_stats("R2026030", "59095", round="-1")
courses = pga.pga_course_stats_details(year=2026)
holes = pga.pga_course_stats_details("TOUGHEST_HOLES", year=2026, round="ONE")
catalog = pga.pga_record_catalog()
records = pga.pga_all_time_records("2-1-11")
Scorecard sections are performance, scoring and strokesGained; the same stat
can appear in more than one section. Round "-1" is the aggregate. Course round
selectors are ALL, ONE, TWO, THREE and FOUR. Availability varies by tour and season.
Display values remain strings; identifiers retain leading zeroes. Table metadata
and original headers are available through DataFrame.attrs.
Course duplicate headers are disambiguated (par/par_1 and dbl_bogey/dbl_bogey_1).
Missing data produces an empty table; mismatched headers raise PgaTourError.
pga_tour_api.pga_scorecard_stats(tournament_id: str, player_id: str, round: str | None = None) -> pd.DataFrame
¶
Return player tournament statistics, one row per round, section and stat.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tournament_id
|
str
|
Event ID, e.g. R2026030. |
required |
player_id
|
str
|
String player ID, preserving leading zeroes. |
required |
round
|
str | None
|
Optional round filter; "-1" selects the tournament aggregate. |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame containing performance, scoring and strokes-gained sections. |
DataFrame
|
Display values remain strings; numeric graph fields are preserved separately. |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_course_stats_details(query_type: str = 'TOUGHEST_COURSE', year: int | None = None, tour: str = 'R', round: str = 'ALL') -> pd.DataFrame
¶
Return complete course or hole rankings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query_type
|
str
|
TOUGHEST_COURSE or TOUGHEST_HOLES. |
'TOUGHEST_COURSE'
|
year
|
int | None
|
Season; None uses the upstream default. |
None
|
tour
|
str
|
Tour code R, S, H or Y; availability varies. |
'R'
|
round
|
str
|
Upstream round selector; ALL combines rounds. |
'ALL'
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
Ranking table with display values and matching *_tendency columns. |
DataFrame
|
Original headers, season/round selectors and other metadata are in attrs. |
DataFrame
|
Duplicate PAR headers become par and par_1; +/- becomes to_par. |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_record_catalog(tour: str = 'R') -> pd.DataFrame
¶
Return the live all-time record catalogue, separate from STAT_IDS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tour
|
str
|
Tour code R, S, H or Y; availability varies. |
'R'
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with record_id, record_name, category_id, category, subcategory. |
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_all_time_records(record_id: str, tour: str = 'R') -> pd.DataFrame
¶
Return an all-time record table, preserving the source's display values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
record_id
|
str
|
ID from pga_record_catalog, e.g. "2-1-11". |
required |
tour
|
str
|
Tour code R, S, H or Y; availability varies. |
'R'
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with player_id and normalized upstream headers. Metadata, |
DataFrame
|
original headers and primaryColumnIndex are retained in attrs. |
DataFrame
|
Source entries may contain anomalies; this is not independent validation. |
Source code in src/pga_tour_api/client.py
PGA TOUR University¶
pga_university_rankings(year=None, week=None) returns player rankings, schools,
movement, averages and tournament history. pga_university_total_points(season=None,
week=None) returns the combined points table and preserves source headers and
navigation metadata in DataFrame.attrs.
pga_tour_api.pga_university_rankings(year: int | None = None, week: int | None = None) -> pd.DataFrame
¶
Return PGA TOUR University rankings and each player's event history.
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_university_total_points(season: int | None = None, week: int | None = None) -> pd.DataFrame
¶
Return PGA TOUR University combined FedExCup/Korn Ferry points.
Source code in src/pga_tour_api/client.py
DP World Tour eligibility¶
pga_dp_world_tour_eligibility(year=None) wraps the PGA site's existing
TourCupSplit operation with ranking ID 2700 and returns Race to Dubai
eligibility standings. The source metadata is retained in DataFrame.attrs.
pga_tour_api.pga_dp_world_tour_eligibility(year: int | None = None, tour: str = 'R') -> pd.DataFrame
¶
Return DP World Tour Race to Dubai PGA TOUR eligibility standings.
Source code in src/pga_tour_api/client.py
Playoff data¶
pga_playoff_scorecard(tournament_id) and pga_playoff_shot_details(tournament_id)
wrap the PGA TOUR playoff-specific operations. A completed event may legitimately
return an empty table when no playoff occurred; compressed shot payloads are decoded
while preserving the upstream message and ID in DataFrame.attrs.
pga_tour_api.pga_playoff_scorecard(tournament_id: str) -> pd.DataFrame
¶
Return playoff scorecard holes and player summaries for an event.
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_playoff_shot_details(tournament_id: str) -> pd.DataFrame
¶
Return decoded playoff shot-level data, one row per stroke.
Source code in src/pga_tour_api/client.py
Team events¶
pga_team_stroke_play_leaderboard(tournament_id) returns team standings and
player membership for team-stroke events. pga_cup_team_roster(tournament_id)
returns cup teams, sections and player match results.
pga_tour_api.pga_team_stroke_play_leaderboard(tournament_id: str) -> pd.DataFrame
¶
Return team-stroke-play standings, including players and round scores.
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_cup_team_roster(tournament_id: str) -> pd.DataFrame
¶
Return cup/team event rosters and player match results.
Source code in src/pga_tour_api/client.py
pga_match_play_leaderboard(tournament_id) flattens the compressed match-play
feed to one row per player per match. It preserves round, bracket/group,
match score, status, tee time, seeds and country fields, and includes an
upcoming flag for scheduled matches. For example, the 2023 WGC-Dell
Technologies Match Play is available as R2023470.
pga_tour_api.pga_match_play_leaderboard(tournament_id: str) -> pd.DataFrame
¶
Return one row per player in each match-play match.
Round and bracket metadata are repeated on each player row, covering both knockout brackets and round-robin groups. Upcoming matches are included when the upstream feed provides them.
Source code in src/pga_tour_api/client.py
Editorial tables¶
pga_power_rankings(path) and pga_expert_picks(path) consume the content
fragment path embedded in a PGA TOUR article, not the public article URL. The
article page supplies paths such as /content/dam/pga-tour/fragments/.../pr-table.
Nested lineups remain lists so the original editorial selection is preserved.
pga_tour_api.pga_power_rankings(path: str) -> pd.DataFrame
¶
Return a structured editorial Power Rankings table for a content path.
Source code in src/pga_tour_api/client.py
pga_tour_api.pga_expert_picks(path: str) -> pd.DataFrame
¶
Return a structured editorial Expert Picks table for a content path.
Source code in src/pga_tour_api/client.py
Season player comparisons¶
pga_tour_api.pga_player_comparison(player_ids: list[str], category: str = 'SCORING', year: int | None = None, tour: str = 'R', tournament_id: str | None = None) -> pd.DataFrame
¶
Compare players using PGA TOUR's season/category comparison table.
Returns one row per statistic and player. Display values remain strings; ranking and highlighting metadata are preserved.