DataGolf APIdatagolf.com ↗
Access DataGolf.com player rankings and round-level strokes gained (SG) data by tournament, round, and category via a simple REST API.
What is the DataGolf API?
This 2-endpoint API surfaces DataGolf.com player rankings and detailed historical strokes gained (SG) data for professional golfers. The get_top_players endpoint returns each player's unique dg_id, rank, and country, while get_player_sg_data delivers per-round SG breakdowns across five categories — OTT, APP, ARG, PUTT, and total — organized by tournament and sorted newest first.
No input parameters required.
curl -X GET 'https://api.parse.bot/scraper/903e8876-c2eb-4278-ad16-a13a031e2c86/get_top_players' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace datagolf-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: Data Golf SG Analytics — bounded, re-runnable; every call capped."""
from parse_apis.data_golf_sg_analytics_api import DataGolf, PlayerNotFound
client = DataGolf()
# List top-ranked players — limit caps total items fetched.
for player in client.players.list(limit=5):
print(player.name, player.rank, player.country)
# Drill into one player's strokes gained profile.
top_player = client.players.list(limit=1).first()
if top_player:
profile = top_player.sg_data()
print(profile.player.name, profile.player.country, profile.player.pro)
# Walk recent tournaments and their rounds.
for tournament in profile.tournaments[:3]:
print(tournament.event_name, tournament.year, tournament.finish)
for rnd in tournament.rounds:
print(f" R{rnd.round_num}: score={rnd.score}, SG total={rnd.sg_metrics.total}")
# Typed error handling: construct a player by ID and attempt sg_data.
try:
unknown = client.player(dg_id="99999999")
unknown.sg_data()
except PlayerNotFound as exc:
print(f"Player not found: dg_id={exc.dg_id}")
print("exercised: players.list / player.sg_data / typed error catch")
Fetch the current top-ranked players from Data Golf, including their unique dg_id, rank, and country. Returns all players listed on the rankings page.
No input parameters required.
{
"type": "object",
"fields": {
"players": "array of player objects each containing dg_id, name, rank, and country"
},
"sample": {
"data": {
"players": [
{
"name": "Scottie Scheffler",
"rank": 1,
"dg_id": "18417",
"country": "USA"
},
{
"name": "Rory McIlroy",
"rank": 2,
"dg_id": "10091",
"country": "NIR"
},
{
"name": "Jon Rahm",
"rank": 8,
"dg_id": "19195",
"country": "ESP"
}
]
},
"status": "success"
}
}About the DataGolf API
Player Rankings
The get_top_players endpoint returns the current DataGolf rankings with no required inputs. Each player object in the response includes a dg_id (the stable identifier used across the API), name, rank, and country. This list is the primary way to discover which players are covered and to obtain the dg_id values needed for the second endpoint.
Round-Level Strokes Gained Data
The get_player_sg_data endpoint accepts a single required parameter — dg_id — and returns a player object plus a tournaments array. Tournaments are ordered newest first. Each tournament entry includes event_name, tournament_num, year, tour, course_name, and finish. Within each tournament, a rounds array provides per-round SG figures broken into five categories: off-the-tee (OTT), approach (APP), around-the-green (ARG), putting (PUTT), and total SG.
Data Shape and Coverage
All SG data is tied to the players listed on DataGolf's rankings page. The dg_id field is consistent across both endpoints, making it straightforward to join ranking position with historical performance. Tournament entries include tour and year fields, so filtering to a specific circuit or season is possible client-side once the full array is retrieved.
The DataGolf API is a managed, monitored endpoint for datagolf.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when datagolf.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official datagolf.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a strokes-gained trend chart for a specific player across a full season using the
roundsarray fromget_player_sg_data - Compare approach-shot (APP) SG across top-ranked players to identify ball-striking leaders
- Filter historical tournament data by
tourfield to analyze performance on a specific circuit (PGA, European, etc.) - Rank top players by putting (PUTT) SG to surface short-game specialists from the rankings list
- Cross-reference
finishand total SG per tournament to study how scoring efficiency correlates with final standing - Populate a fantasy golf dashboard with current rankings and each player's recent round-level SG metrics
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does DataGolf have an official developer API?+
What exactly does get_player_sg_data return, and how is it organized?+
tournaments array sorted newest first. Each tournament entry includes event_name, tournament_num, year, tour, course_name, and finish. Inside each tournament is a rounds array with per-round SG values across five categories: OTT (off-the-tee), APP (approach), ARG (around-the-green), PUTT (putting), and total SG.Does this API cover players outside the current DataGolf top rankings?+
get_top_players endpoint returns the players listed on DataGolf's rankings page, and get_player_sg_data is keyed to those same dg_id values. Players not appearing in the current rankings are not directly discoverable through this API. You can fork it on Parse and revise to add an endpoint that accepts a known dg_id directly, bypassing the rankings list.Is live or in-round scoring data available?+
Can I filter tournaments by tour or year within the API?+
get_player_sg_data endpoint returns the full tournament history for a player in a single response; filtering by tour or year is not a server-side parameter. Each tournament object includes tour and year fields, so you can apply that filtering client-side after receiving the array. You can also fork the API on Parse and revise it to add query-time filtering as a parameter.