How do I get a golf tournament leaderboard in Python?
A tournament's full leaderboard with position, each round, total, earnings and cup points, and the course and purse alongside.
Code verified November 18, 2026. One call to get_leaderboard, 2 credits.
The call
tournament_id comes from list_tournaments or get_schedule. Leave limit out for the whole field.
import requests
import pandas as pd
API_KEY = "YOUR_API_KEY"
resp = requests.post(
"https://mcp.birdieapi.com/v1/get_leaderboard",
headers={"x-api-key": API_KEY},
json={
"tournament_id": "401811941",
"limit": 30,
},
timeout=60,
)
resp.raise_for_status()
data = resp.json()["data"]
t = data["tournament"]
print(t["name"], t["season"], "won by", t["winner_name"], t["winning_to_par"])
board = pd.DataFrame(data["players"])
board["round_scores"] = board["rounds"].apply(lambda rs: [r["strokes"] for r in rs])
print(board[["position_display", "name", "to_par", "total_strokes", "round_scores", "earnings"]].head(10))
Replace YOUR_API_KEY with a key from your dashboard. Python needs requests and pandas (pip install requests pandas). JavaScript runs on Node 18 or newer, or in the browser.
Or use the official client: pip install birdieapi
What comes back
The data object of the response, trimmed to the first rows. Every field is real output from the run above.
{
"tournament": {
"tournament_id": "401811941",
"name": "Masters Tournament",
"season": 2026,
"start_date": "2026-04-09",
"purse": 22500000,
"field_size": 91,
"winner_name": "Rory McIlroy",
"winning_to_par": -12,
"winning_strokes": 276
},
"players": [
{
"position_display": "1",
"player_id": "3470",
"name": "Rory McIlroy",
"to_par": -12,
"total_strokes": 276,
"rounds_played": 4,
"earnings": 4500000,
"rounds": [
{
"round": 1,
"strokes": 67,
"to_par": -5,
"course_id": "21",
"vs_field": 7.65
},
"...3 more"
]
},
"...29 more"
],
"count": 30
}What to do next
- get_scorecard (2 credits). A player's hole-by-hole card for the tournament.
- get_course (2 credits). How each hole played for the whole field.
The data this uses
Every row above comes from Golf leaderboard and results data and PGA Tour hole-by-hole data. Full PGA Tour leaderboards since 2001, every player in every field, with rounds, status and money; the LPGA, LIV and DP World Tour through the same tools.
More guides
The same guide for other sports
- PuckAPI: How do I rank NHL goalies by goals saved above expected?
- FighterAPI: Who lands the most significant strikes per 15 minutes in the UFC?
- StrikerAPI: Who leads the Premier League in expected goals, and how do I rank players in Python?
- FastballAPI: How do I get MLB home run leaders and stat leaders in Python?
- YorkerAPI: How do I get cricket leaderboards in Python?
Rather ask Claude? 16 free Claude skills call these endpoints for you.
Start with 500 free credits every month
No card. REST or MCP.