Skip to main content

Golf — PGA TOUR GraphQL API (orchestrator.pgatour.com; runtime only, public frontend key or $PGA_API_KEY)

sportsdataverse.golf — 10 endpoints.

Note: Runtime only: each call sends one GraphQL query to orchestrator.pgatour.com/graphql. sdv-py publishes no release assets from this API and ships no bulk or backfill tooling for it.

Note: The request body is {operationName, query, variables}; the query document ships in sportsdataverse/golf/pgatour_queries/. Every request also carries an x-api-key header (left out of the example request): the public key pgatour.com's own frontend sends, read from the site on first use. Set the PGA_API_KEY environment variable to supply a key yourself.

Note: Tour codes: R PGA TOUR, S PGA TOUR Champions, H Korn Ferry Tour. Tournament ids are the tour code, the season and the event number (R2026014 is the 2026 Masters): read them from pgatour_schedule.

pgatour_schedule​

A tour's season schedule: one row per tournament (id, dates, course, purse, champion, points on offer), completed events first.

Endpoint URL: POST https://orchestrator.pgatour.com/graphql

Example request: curl -X POST 'https://orchestrator.pgatour.com/graphql' -H 'Content-Type: application/json' -d '{"operationName": "Schedule", "query": "query Schedule($tourCode: String!, $year: String) {\n schedule(tourCode: $tourCode, year: $year) {\n tour\n seasonYear\n completed { ...ScheduleMonthFields }\n upcoming { ...ScheduleMonthFields }\n }\n}\n\nfragment ScheduleMonthFields on ScheduleMonth {\n month\n year\n tournaments {\n id\n tournamentName\n date\n startDate\n sequenceNumber\n tournamentStatus\n courseName\n city\n state\n stateCode\n country\n countryCode\n purse\n champion\n championId\n championEarnings\n tourStandingHeading\n tourStandingValue\n }\n}\n", "variables": {"tourCode": "R", "year": "2026"}}'

API ParameterPythonInPatternRequiredNullableDescription
tourCodetour_codebodyYTour code (R PGA TOUR, S PGA TOUR Champions, H Korn Ferry Tour).
yearyearbodyYSeason year, e.g. 2026; omitted, the current season.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
seasonInt64Season year the schedule belongs to (e.g. 2026).
schedule_statusString"completed" for an event already played, "upcoming" for one still to come.
tournament_idStringPGA TOUR tournament id (tour code + season + event number, e.g. "R2026014"); the id the leaderboard, scorecard, tee-times and shot-details wrappers take.
tournament_nameStringTournament's full name, sponsor included (e.g. "Travelers Championship").
dateStringTournament dates as the site displays them (e.g. "Apr 9 - 12").
start_dateDatetimeTournament start (UTC).
sequence_numberInt64Event's order in the season.
tournament_statusStringTournament status (e.g. "COMPLETED", "IN_PROGRESS", "NOT_STARTED").
course_nameStringCourse hosting the event (e.g. "TPC River Highlands").
cityStringCity the host course is in (e.g. "Cromwell").
stateStringHost state or province.
state_codeStringHost state or province abbreviation.
countryStringCountry the host course is in, spelled out (e.g. "United States of America").
country_codeStringHost country code (e.g. "USA").
purseStringTotal purse as displayed (e.g. "$9,100,000").
championStringWinner's name; null before the event finishes.
champion_idStringWinner's PGA TOUR player id.
champion_earningsStringWinner's share of the purse as displayed.
standing_headingStringSeason points race the event counts toward (e.g. "FEDEXCUP").
standing_valueStringPoints on offer to the winner as displayed (e.g. "500 pts").

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist. The API answered null for the request (an unknown tournament, player or stat id).
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help. The API rejected the query variables.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty. Any other GraphQL error, or a compressed payload that does not decode.

Example​

pgatour_schedule(tour_code='R', year=2026)

pgatour_leaderboard​

One tournament's leaderboard: position, total to par, strokes, holes completed, today's score, round scores and projected FedExCup rank per player.

Endpoint URL: POST https://orchestrator.pgatour.com/graphql

Example request: curl -X POST 'https://orchestrator.pgatour.com/graphql' -H 'Content-Type: application/json' -d '{"operationName": "LeaderboardCompressedV3", "query": "query LeaderboardCompressedV3($id: ID!) {\n leaderboardCompressedV3(id: $id) {\n id\n payload\n }\n}\n", "variables": {"id": "R2026014"}}'

API ParameterPythonInPatternRequiredNullableDescription
idtournament_idbodyYTournament id (tournament_id in pgatour_schedule), e.g. R2026014.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
tournament_idStringPGA TOUR tournament id.
tournament_statusStringTournament status (e.g. "COMPLETED", "IN_PROGRESS").
sort_orderInt64Leaderboard order (0 = leader).
player_idStringPGA TOUR player id.
first_nameStringPlayer's first name.
last_nameStringPlayer's last name.
display_nameStringPlayer's full name.
short_nameStringPlayer's short name (e.g. "R. McIlroy").
countryStringPlayer's country code (e.g. "NIR").
amateurBooleanTrue for an amateur.
positionStringPosition as displayed ("1", "T3", "CUT", "WD").
totalStringTotal score to par as displayed ("-12", "E", "+6").
to_parInt64Total score to par as an integer (E is 0); null before a score is posted.
total_strokesInt64Total strokes over the rounds played.
thruStringHoles completed in the current round as displayed ("F" when finished, "-" when not started).
todayStringScore to par in the current round as displayed.
current_roundInt64Round in play (or last played).
player_stateStringPlayer's state in the event (e.g. "COMPLETE", "ACTIVE", "CUT").
round_1Int64Strokes in round 1; null when not played.
round_2Int64Strokes in round 2; null when not played.
round_3Int64Strokes in round 3; null when not played (a missed cut, or not started).
round_4Int64Strokes in round 4; null when not played.
fedexcup_officialStringPlayer's official FedExCup rank going into the event, as displayed.
fedexcup_projectedStringPlayer's FedExCup rank projected from this leaderboard, as displayed.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist. The API answered null for the request (an unknown tournament, player or stat id).
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help. The API rejected the query variables.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty. Any other GraphQL error, or a compressed payload that does not decode.

Example​

pgatour_leaderboard(tournament_id='R2026014')

pgatour_scorecard​

One player's scorecard for a tournament: one row per hole per round (par, yardage, strokes, birdie / bogey status, running score to par).

Endpoint URL: POST https://orchestrator.pgatour.com/graphql

Example request: curl -X POST 'https://orchestrator.pgatour.com/graphql' -H 'Content-Type: application/json' -d '{"operationName": "ScorecardCompressedV3", "query": "query ScorecardCompressedV3($tournamentId: ID!, $playerId: ID!) {\n scorecardCompressedV3(tournamentId: $tournamentId, playerId: $playerId) {\n id\n payload\n }\n}\n", "variables": {"tournamentId": "R2026014", "playerId": "28237"}}'

API ParameterPythonInPatternRequiredNullableDescription
tournamentIdtournament_idbodyYTournament id, e.g. R2026014.
playerIdplayer_idbodyYPGA TOUR player id (player_id in pgatour_leaderboard), e.g. 28237.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
tournament_idStringPGA TOUR tournament id (the answer's own id carries the player id too; it is stripped).
player_idStringPGA TOUR player id.
round_numberInt64Tournament round the hole was played in (1-4).
course_idStringCourse id (an event played on more than one course carries one per round).
course_nameStringCourse the round was played on (e.g. "Augusta National Golf Club").
hole_numberInt64Hole number (1-18).
parInt64Par of the hole (3, 4 or 5).
yardageInt64Hole length in yards that round.
scoreInt64Strokes on the hole; null when the hole is not yet played.
score_statusStringResult on the hole (e.g. "BIRDIE", "PAR", "BOGEY", "EAGLE", "DOUBLE_BOGEY").
round_to_parStringRunning score to par for the round after this hole, as displayed.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist. The API answered null for the request (an unknown tournament, player or stat id).
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help. The API rejected the query variables.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty. Any other GraphQL error, or a compressed payload that does not decode.

Example​

pgatour_scorecard(player_id='28237', tournament_id='R2026014')

pgatour_tee_times​

A tournament's tee times: one row per player per group per round (tee time in UTC, starting tee, course).

Endpoint URL: POST https://orchestrator.pgatour.com/graphql

Example request: curl -X POST 'https://orchestrator.pgatour.com/graphql' -H 'Content-Type: application/json' -d '{"operationName": "TeeTimesCompressedV2", "query": "query TeeTimesCompressedV2($id: ID!) {\n teeTimesCompressedV2(id: $id) {\n id\n payload\n }\n}\n", "variables": {"id": "R2026014"}}'

API ParameterPythonInPatternRequiredNullableDescription
idtournament_idbodyYTournament id, e.g. R2026014.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
tournament_idStringPGA TOUR tournament id.
round_numberInt64Tournament round the tee times are for (1-4).
round_statusStringRound status (e.g. "COMPLETE", "IN_PROGRESS", "UPCOMING").
group_numberInt64Tee-time group number within the round.
tee_timeDatetimeGroup's tee time (UTC).
start_teeInt64Starting hole (1, or 10 for a two-tee start).
back_nineBooleanTrue when the group starts on the back nine.
course_idStringPGA TOUR course id of the course the group tees off on (e.g. "014").
course_nameStringCourse the group tees off on (e.g. "Augusta National Golf Club").
player_idStringPGA TOUR player id.
display_nameStringPlayer's full name.
countryStringPlayer's country code.
amateurBooleanTrue for an amateur.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist. The API answered null for the request (an unknown tournament, player or stat id).
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help. The API rejected the query variables.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty. Any other GraphQL error, or a compressed payload that does not decode.

Example​

pgatour_tee_times(tournament_id='R2026014')

pgatour_player​

One player's profile: name, country, world ranking, height, weight, birth date and place, year turned pro, school, residence.

Endpoint URL: POST https://orchestrator.pgatour.com/graphql

Example request: curl -X POST 'https://orchestrator.pgatour.com/graphql' -H 'Content-Type: application/json' -d '{"operationName": "Player", "query": "query Player($id: ID!) {\n player(id: $id) {\n id\n firstName\n lastName\n displayName\n country\n countryFlag\n bioLink\n owgr\n playerBio {\n heightImperial\n heightMeters\n weightImperial\n weightKilograms\n age\n born\n birthplace { city state country }\n turnedPro\n school\n degree\n graduationYear\n residence { city state country }\n family\n }\n }\n}\n", "variables": {"id": "28237"}}'

API ParameterPythonInPatternRequiredNullableDescription
idplayer_idbodyYPGA TOUR player id, e.g. 28237.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
player_idStringPGA TOUR player id.
first_nameStringPlayer's first (given) name.
last_nameStringPlayer's last (family) name.
display_nameStringPlayer's full name as the site displays it (e.g. "Rory McIlroy").
countryStringCountry the player represents.
country_codeStringCountry code (e.g. "NIR").
owgrStringOfficial World Golf Ranking position as displayed.
heightStringHeight in feet and inches as displayed.
height_metersStringHeight in meters.
weightStringWeight in pounds.
weight_kilogramsStringWeight in kilograms.
ageStringPlayer's age in years, as text (e.g. "37").
bornStringBirth date as displayed (e.g. "May 4, 1989").
birthplace_cityStringBirthplace city.
birthplace_stateStringBirthplace state or province.
birthplace_countryStringBirthplace country.
turned_proStringYear the player turned professional.
schoolStringCollege or university.
residence_cityStringCity of residence.
residence_stateStringState or province of residence.
residence_countryStringCountry of residence.
familyStringFamily as listed on the profile.
bio_linkStringThe player's pgatour.com profile URL.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist. The API answered null for the request (an unknown tournament, player or stat id).
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help. The API rejected the query variables.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty. Any other GraphQL error, or a compressed payload that does not decode.

Example​

pgatour_player(player_id='28237')

pgatour_player_directory​

A tour's player directory: one row per player (id, name, country, age, college, year turned pro).

Endpoint URL: POST https://orchestrator.pgatour.com/graphql

Example request: curl -X POST 'https://orchestrator.pgatour.com/graphql' -H 'Content-Type: application/json' -d '{"operationName": "PlayerDirectory", "query": "query PlayerDirectory($tourCode: TourCode!, $active: Boolean) {\n playerDirectory(tourCode: $tourCode, active: $active) {\n tourCode\n players {\n id\n isActive\n firstName\n lastName\n shortName\n displayName\n country\n countryFlag\n playerBio { age education turnedPro }\n }\n }\n}\n", "variables": {"tourCode": "R"}}'

API ParameterPythonInPatternRequiredNullableDescription
tourCodetour_codebodyYTour code (R PGA TOUR, S PGA TOUR Champions, H Korn Ferry Tour).
activeactivebodyYTrue for active players only; omitted, every player in the directory.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
tour_codeStringTour code (R PGA TOUR, S PGA TOUR Champions, H Korn Ferry Tour).
player_idStringPGA TOUR player id.
is_activeBooleanTrue for a player active on the tour.
first_nameStringPlayer's first (given) name.
last_nameStringPlayer's last (family) name.
short_nameStringPlayer's first initial and last name (e.g. "L Åberg").
display_nameStringPlayer's full name as the site displays it (e.g. "Ludvig Åberg").
countryStringCountry the player represents.
country_codeStringThree-letter code of the country the player represents (e.g. "SWE").
ageStringPlayer's age in years, as text (e.g. "27"); null when the profile gives none.
educationStringCollege or university.
turned_proStringYear the player turned professional.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist. The API answered null for the request (an unknown tournament, player or stat id).
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help. The API rejected the query variables.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty. Any other GraphQL error, or a compressed payload that does not decode.

Example​

pgatour_player_directory(tour_code='R')

pgatour_stat_catalog​

Every stat a tour publishes: category, sub-category, stat id and title. The stat ids are what pgatour_stat_details takes.

Endpoint URL: POST https://orchestrator.pgatour.com/graphql

Example request: curl -X POST 'https://orchestrator.pgatour.com/graphql' -H 'Content-Type: application/json' -d '{"operationName": "StatOverview", "query": "query StatOverview($tourCode: TourCode!, $year: Int) {\n statOverview(tourCode: $tourCode, year: $year) {\n tourCode\n year\n categories {\n category\n displayName\n subCategories {\n displayName\n stats { statId statTitle }\n }\n }\n }\n}\n", "variables": {"tourCode": "R", "year": 2026}}'

API ParameterPythonInPatternRequiredNullableDescription
tourCodetour_codebodyYTour code (R PGA TOUR, S PGA TOUR Champions, H Korn Ferry Tour).
yearyearbodyYSeason year; omitted, the current season.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
tour_codeStringTour the catalog lists stats for (R PGA TOUR, S PGA TOUR Champions, H Korn Ferry Tour).
yearInt64Season the catalog lists stats for (e.g. 2026).
categoryStringStat category key (e.g. "STROKES_GAINED", "SCORING").
category_nameStringStat category name (e.g. "Strokes Gained").
sub_categoryStringSub-category the stat is listed under.
stat_idStringPGA TOUR stat id (e.g. "02675" for SG Total); the id pgatour_stat_details takes.
stat_titleStringStat's display name (e.g. "Approaches from 50-125 yards").

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist. The API answered null for the request (an unknown tournament, player or stat id).
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help. The API rejected the query variables.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty. Any other GraphQL error, or a compressed payload that does not decode.

Example​

pgatour_stat_catalog(tour_code='R', year=2026)

pgatour_stat_details​

One stat's season table, long form: one row per player per stat column (rank, column name, value as displayed).

Endpoint URL: POST https://orchestrator.pgatour.com/graphql

Example request: curl -X POST 'https://orchestrator.pgatour.com/graphql' -H 'Content-Type: application/json' -d '{"operationName": "StatDetails", "query": "query StatDetails($tourCode: TourCode!, $statId: String!, $year: Int) {\n statDetails(tourCode: $tourCode, statId: $statId, year: $year) {\n tourCode\n year\n statId\n statType\n statTitle\n statDescription\n tourAvg\n lastProcessed\n statHeaders\n rows {\n __typename\n ... on StatDetailsPlayer {\n playerId\n playerName\n country\n countryFlag\n rank\n rankDiff\n rankChangeTendency\n stats { statName statValue }\n }\n }\n }\n}\n", "variables": {"statId": "120", "tourCode": "R", "year": 2026}}'

API ParameterPythonInPatternRequiredNullableDescription
statIdstat_idbodyYStat id (stat_id in pgatour_stat_catalog), as a string (leading zeros matter), e.g. '120' (scoring average) or '02675' (SG Total).
tourCodetour_codebodyYTour code (R PGA TOUR, S PGA TOUR Champions, H Korn Ferry Tour).
yearyearbodyYSeason year; omitted, the current season.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
tour_codeStringTour the stat table is for (R PGA TOUR, S PGA TOUR Champions, H Korn Ferry Tour).
yearInt64Season the stat table covers (e.g. 2026).
stat_idStringPGA TOUR stat id.
stat_titleStringStat name (e.g. "Scoring Average").
stat_typeStringStat window (e.g. "YTD").
tour_averageStringTour average for the stat, as displayed.
player_idStringPGA TOUR player id.
player_nameStringPlayer's full name.
countryStringPlayer's country.
country_codeStringPlayer's country code.
rankInt64Player's rank in the stat.
rank_changeStringChange in rank since the last update, as displayed.
stat_nameStringThe stat table's column (e.g. "Avg", "Total Strokes", "Total Rounds").
stat_valueStringThat column's value as displayed (e.g. "68.619", "5,293").

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist. The API answered null for the request (an unknown tournament, player or stat id).
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help. The API rejected the query variables.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty. Any other GraphQL error, or a compressed payload that does not decode.

Example​

pgatour_stat_details(stat_id='120', tour_code='R', year=2026)

pgatour_tour_cup​

A season-long points race (the FedExCup by default): one row per player with official and projected rank and points.

Endpoint URL: POST https://orchestrator.pgatour.com/graphql

Example request: curl -X POST 'https://orchestrator.pgatour.com/graphql' -H 'Content-Type: application/json' -d '{"operationName": "TourCupCombined", "query": "query TourCupCombined($tourCode: TourCode!, $id: String, $year: Int) {\n tourCupCombined(tourCode: $tourCode, id: $id, year: $year) {\n id\n title\n season\n description\n players {\n __typename\n ... on TourCupCombinedPlayer {\n id\n firstName\n lastName\n displayName\n shortName\n country\n countryFlag\n rankingData { projected official event movement movementAmount }\n pointData { projected official event movement movementAmount }\n }\n }\n }\n}\n", "variables": {"tourCode": "R", "id": "02671", "year": 2025}}'

API ParameterPythonInPatternRequiredNullableDescription
tourCodetour_codebodyYTour code (R PGA TOUR, S PGA TOUR Champions, H Korn Ferry Tour).
idcup_idbodyYPoints race id, as a string (leading zeros matter); 02671 (the default) is the FedExCup, 02698 the FedExCup Fall.
yearyearbodyYSeason year; omitted, the current season.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
cup_idStringPoints race id with season (e.g. "R-02671-2025" for the 2025 FedExCup).
titleStringPoints race name (e.g. "FedExCup Standings").
seasonInt64Season year (read from the race's title, e.g. "2025 Standings").
player_idStringPGA TOUR player id.
first_nameStringPlayer's first (given) name.
last_nameStringPlayer's last (family) name.
display_nameStringPlayer's full name as the site displays it (e.g. "Wyndham Clark").
countryStringCountry the player represents.
country_codeStringThree-letter code of the country the player represents (e.g. "IRL").
rank_officialStringOfficial rank as displayed ("-" for none).
rank_projectedStringRank projected from live results, as displayed.
rank_movementStringDirection of the projected rank change (e.g. "UP", "DOWN", "CONSTANT").
points_officialStringOfficial points as displayed.
points_projectedStringPoints projected from live results, as displayed.
points_eventStringPoints earned at the current event, as displayed.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist. The API answered null for the request (an unknown tournament, player or stat id).
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help. The API rejected the query variables.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty. Any other GraphQL error, or a compressed payload that does not decode.

Example​

pgatour_tour_cup(tour_code='R', year=2025)

pgatour_shot_details​

ShotLink shot tracking for one player's round: one row per stroke with description, distance, lie and start / end coordinates.

Endpoint URL: POST https://orchestrator.pgatour.com/graphql

Example request: curl -X POST 'https://orchestrator.pgatour.com/graphql' -H 'Content-Type: application/json' -d '{"operationName": "ShotDetailsV4Compressed", "query": "query ShotDetailsV4Compressed($tournamentId: ID!, $playerId: ID!, $round: Int!, $includeRadar: Boolean) {\n shotDetailsV4Compressed(tournamentId: $tournamentId, playerId: $playerId, round: $round, includeRadar: $includeRadar) {\n id\n payload\n }\n}\n", "variables": {"tournamentId": "R2026006", "playerId": "59095", "round": 4}}'

API ParameterPythonInPatternRequiredNullableDescription
tournamentIdtournament_idbodyYTournament id, e.g. R2026006.
playerIdplayer_idbodyYPGA TOUR player id, e.g. 59095.
roundroundbodyYRound number (1-4).

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
tournament_idStringPGA TOUR tournament id.
player_idStringPGA TOUR player id.
round_numberInt64Tournament round the shots were played in (1-4).
hole_numberInt64Hole the shots were played on (1-18).
parInt64Par of the hole (3, 4 or 5).
yardageInt64Hole length in yards.
hole_scoreInt64Strokes on the hole.
hole_statusStringResult on the hole (e.g. "BIRDIE", "PAR").
stroke_numberInt64Stroke number on the hole.
stroke_typeStringStroke kind (e.g. "STROKE", "PENALTY", "DROP").
play_by_playStringShotLink description of the shot (e.g. "356 yds to left fairway, 134 yds to hole").
distanceStringShot distance as displayed (e.g. "356 yds").
distance_remainingStringDistance to the hole after the shot, as displayed.
from_location_codeStringShotLink lie code the shot was played from (e.g. "OTB" tee box).
from_locationStringLie the shot was played from (e.g. "Tee Box").
to_location_codeStringShotLink lie code the shot finished in (e.g. "ELF" left fairway).
to_locationStringLie the shot finished in (e.g. "Left Fairway").
final_strokeBooleanTrue for the stroke that holed out.
from_xFloat64ShotLink tourcast x coordinate of the shot's start.
from_yFloat64ShotLink tourcast y coordinate of the shot's start.
from_zFloat64ShotLink tourcast z (elevation) coordinate of the shot's start.
to_xFloat64ShotLink tourcast x coordinate where the shot finished.
to_yFloat64ShotLink tourcast y coordinate where the shot finished.
to_zFloat64ShotLink tourcast z (elevation) coordinate where the shot finished.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist. The API answered null for the request (an unknown tournament, player or stat id).
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help. The API rejected the query variables.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty. Any other GraphQL error, or a compressed payload that does not decode.

Example​

pgatour_shot_details(player_id='59095', round=4, tournament_id='R2026006')