{"id":18268403,"url":"https://github.com/coreyjs/data-golf-api","last_synced_at":"2025-06-20T08:08:37.621Z","repository":{"id":243522230,"uuid":"796811144","full_name":"coreyjs/data-golf-api","owner":"coreyjs","description":"Unofficial Library for DataGolf.com APIs","archived":false,"fork":false,"pushed_at":"2024-06-27T12:15:11.000Z","size":60,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-09T10:06:22.104Z","etag":null,"topics":["data-golf","data-golf-python","datagolf","golf","ml","pgatour","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coreyjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-06T17:13:36.000Z","updated_at":"2025-02-24T03:19:06.000Z","dependencies_parsed_at":"2024-11-05T11:51:31.553Z","dependency_job_id":null,"html_url":"https://github.com/coreyjs/data-golf-api","commit_stats":null,"previous_names":["coreyjs/data-golf-api"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/coreyjs/data-golf-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coreyjs%2Fdata-golf-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coreyjs%2Fdata-golf-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coreyjs%2Fdata-golf-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coreyjs%2Fdata-golf-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coreyjs","download_url":"https://codeload.github.com/coreyjs/data-golf-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coreyjs%2Fdata-golf-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260907160,"owners_count":23080613,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-golf","data-golf-python","datagolf","golf","ml","pgatour","python"],"created_at":"2024-11-05T11:31:21.511Z","updated_at":"2025-06-20T08:08:32.609Z","avatar_url":"https://github.com/coreyjs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Data-Golf-API](https://github.com/coreyjs/data-golf-api/actions/workflows/python-app.yml/badge.svg)](https://github.com/coreyjs/data-golf-api/actions/workflows/python-app.yml)\n[![PyPI version](https://badge.fury.io/py/data_golf.svg)](https://badge.fury.io/py/data_golf)\n\n\n# Data Golf API (Unofficial)\n\n### An Unofficial API Library for DataGolf.com APIs\n\nThis is a Python library for interacting with the DataGolf APIs. DataGolf is a golf analytics platform that provides a wide range of data and analytics for golf tournaments, players, and courses.\n\n**This is an unofficial API lib, and it is not affiliated with DataGolf in any way.**\n\n\nThis is being built to support some ML projects I am working on.  I will be \ncontinuing to add more endpoints as I need them.  If you have a specific endpoint you need, please open a ticket for submit a PR.\n\n---\n## Developer Note:\nThis is in development.  Code structure will change as I get\nall the endpoints added.  So expect some renaming and convention changes.\n\n### Contact\nIm available on [Bluesky](https://bsky.app/profile/coreyjs.dev) for any questions or just general chats about enhancements.\n\n---\n# Usage + Installation \u0026 Setup\n(Currently this only supports JSON formats, CSV is on the roadmap)\n\n```python\npip install data_golf\n```\n\n```python\nfrom data_golf import DataGolfClient\n\nclient = DataGolfClient(api_key=\"YOUR_API_KEY\")\n\n# For more request logging\nclient = DataGolfClient(api_key=\"YOUR_API_KEY\", verbose=True)\n```\n\n---\n\n# Main Modules\n\nThese modules map directly to the [DataGolf API Documentation](https://datagolf.com/api-access) available on their site:\n\n1. General\n2. Predictions\n3. Live Predictions\n4. Betting\n5. Historical\n\nThe Data Golf API is a paid service via [DataGolf.com](https://datagolf.com/api-access), there they will provide you with an API Key.  This library is\nonly a helper utility, to make interacting and consuming the API easier.\n\n---\n\n# General APIs\n\n### Player List\n\n\u003cdetails\u003e\n    \u003csummary\u003eAPI Endpoint Info\u003c/summary\u003e\n\n**Endpoint:** `/get-player-list`  \n**Method:** GET  \n**Formats:** JSON\n\n\u003c/details\u003e\n\n```python\nplayers = client.general.player_list()\n```\n\n\n### Current Season Tour Schedule\n\n\u003cdetails\u003e\n    \u003csummary\u003eAPI Endpoint Info\u003c/summary\u003e\n\n**Endpoint:** `/get-schedule`  \n**Method:** GET  \n**Formats:** JSON\n\n| Param | Type   | Ex                                                                        |\n|-------|--------|---------------------------------------------------------------------------|\n| tour  | str    | all, pga, euro, kft, alt, liv |\n\n\u003c/details\u003e\n\n```python\n# Can use optinal parameter 'tour' to filter by tour: pga, euro, kft, alt, liv\ntour_schedule = client.general.tour_schedule()\ntour_schedule = client.general.tour_schedule(tour=\"pga\")\ntour_schedule = client.general.tour_schedule(tour=\"liv\")\n```\n\n### Field Updates\n\n\u003cdetails\u003e\n    \u003csummary\u003eAPI Endpoint Info\u003c/summary\u003e\n\n**Endpoint:** `/field-updates`  \n**Method:** GET  \n**Formats:** JSON\n\n| Param | Type   | Ex                                                                        |\n|-------|--------|---------------------------------------------------------------------------|\n| tour  | str    | all, pga, euro, kft, alt, liv |\n\n\u003c/details\u003e\n\n```python\n# tour = pga (default), euro, kft, opp, alt\nrsp = client.general.field_updates() # defaults to pga\nrsp = client.general.field_updates(tour=\"kft\")\n```\n\n---\n\n# Model Prediction APIs\n\n## Rankings\n\n\u003cdetails\u003e\n    \u003csummary\u003eAPI Endpoint Info\u003c/summary\u003e\n\n\n**Endpoint:** `/preds/get-dg-rankings`  \n**Method:** GET  \n**Formats:** JSON\n\n\u003c/details\u003e\n\n```python\nrankings = client.predictions.rankings()\n```\n\n## Pre Tournament Predictions\n\n\u003cdetails\u003e\n    \u003csummary\u003eAPI Endpoint Info\u003c/summary\u003e\n\n**Endpoint:** `/preds/pre-tournament`  \n**Method:** GET  \n**Formats:** JSON\n\n\u003c/details\u003e\n\n```python\nrsp = client.predictions.pre_tournament()\n\nrsp = client.predictions.pre_tournament(\n    tour='pga',\n    dead_heat=True,\n    odds_format='american'\n)\n```\n\n## Pre Tournament Prediction Archive\n\n\u003cdetails\u003e\n    \u003csummary\u003eAPI Endpoint Info\u003c/summary\u003e\n\n**Endpoint:** `/preds/pre-tournament-archive`  \n**Method:** GET  \n**Formats:** JSON\n\n\u003c/details\u003e\n\n```python\n# Supports optional parameters event_id:, year:, odds_format:\nrsp = client.predictions.pre_tournament_pred_archive()\n\nrsp = client.predictions.pre_tournament_pred_archive(\n    year=2021,\n)\n```\n\n## Player Skill Decomposition\n\n\u003cdetails\u003e\n    \u003csummary\u003eAPI Endpoint Info\u003c/summary\u003e\n\n**Endpoint:** `/preds/player-decompositions`  \n**Method:** GET  \n**Formats:** JSON\n\n\u003c/details\u003e\n\n```python\n# Supports optional parameters tour:\nrsp = client.predictions.player_skill_decompositions()\nrsp = client.predictions.player_skill_decompositions(tour='alt')\n```\n\n## Player Skill Ratings\n\n\u003cdetails\u003e\n    \u003csummary\u003eAPI Endpoint Info\u003c/summary\u003e\n\n**Endpoint:** `/preds/skill-ratings`  \n**Method:** GET  \n**Formats:** JSON\n\n\u003c/details\u003e\n\n```python\n# Supports optional param display: (value, rank)\nrsp = client.predictions.player_skill_ratings()\nrsp = client.predictions.player_skill_ratings(display=\"rank\")\n```\n\n## Detailed Approach Skill\n\n\u003cdetails\u003e\n    \u003csummary\u003eAPI Endpoint Info\u003c/summary\u003e\n\n**Endpoint:** `/preds/approach-skill`  \n**Method:** GET  \n**Formats:** JSON\n\n| Param  | Type   | Ex                                                                        |\n|--------|--------|---------------------------------------------------------------------------|\n| period | str    | l24 (last 24 months) (default), \u003cbr/\u003e l12 (last 12 months), ytd (year to date) |\n\n\u003c/details\u003e\n\n```python\nrsp = client.predictions.detailed_approach_skill()\nrsp = client.predictions.detailed_approach_skill(period='ytd')\n```\n\n## Fantasy Projections\n\u003cdetails\u003e\n    \u003csummary\u003eAPI Endpoint Info\u003c/summary\u003e\n\n\n**Endpoint:** `/preds/fantasy-projection-defaults`  \n**Method:** GET  \n**Formats:** JSON\n\n| Param | Type | Ex                                                            |\n|-------|-----|---------------------------------------------------------------|\n| tour  | str | pga (default), euro, opp (opposite field PGA TOUR event), alt |\n| site  | str |  draftkings (default), fanduel, yahoo  |\n| slate | str | main (default), showdown, showdown_late, weekend, captain |\n\n\u003c/details\u003e\n\n```python\nrsp = client.predictions.fantasy_projection()\nrsp = client.predictions.fantasy_projection(tour='pga', site='fanduel', slate='showdown')\n```\n\n---\n\n# Live Predictions\n\n\n### Live Model Predictions\n\n\u003cdetails\u003e\n    \u003csummary\u003eAPI Endpoint Info\u003c/summary\u003e\n\n\n**Endpoint:** `/preds/in-play`  \n**Method:** GET  \n**Formats:** JSON\n\n| Param       | Type | Ex                                                            |\n|-------------|------|---------------------------------------------------------------|\n| tour        | str  | pga (default), euro, opp (opposite field PGA TOUR event), alt |\n| dead_head   | bool | False (default), True                                         |\n| odds_format | str  | percent (default), american, decimal, fraction                                                             |\n\n\u003c/details\u003e\n\n```python\ndata = dg.live_predictions.live_in_play()\ndata = dg.live_predictions.live_in_play(tour='kft', odds_format='american')\n```\n\n\n### Live Tournament Stats\n\nReturns live strokes-gained and traditional stats for every player during PGA Tour tournaments.\n\n\n\u003cdetails\u003e\n    \u003csummary\u003eAPI Endpoint Info\u003c/summary\u003e\n\n\n**Endpoint:** `/preds/live-tournament-stats`  \n**Method:** GET  \n**Formats:** JSON\n\n| Param   | Type    | Ex                                                            |\n|---------|---------|---------------------------------------------------------------|\n| stats   | csv str | Comma-separated list of statistics to be returned. Supports: sg_putt, sg_arg, sg_app, sg_ott, sg_t2g, sg_bs, sg_total, \u003cbr/\u003edistance, accuracy, gir, prox_fw, prox_rgh, scrambling |\n| round   | str     | event_avg, 1, 2, 3, 4                                       |\n| display | str     | value (default), rank                |\n\n\u003c/details\u003e\n\n```python\ndata = dg.live_predictions.live_tournament_stats()\ndata = dg.live_predictions.live_tournament_stats(stats=\"sq_arg, sg_bs\", disppaly=\"rank\")\n```\n\n\n### Live Hole Scoring Distruibution\n\nReturns live hole scoring averages and distrubutions (birdies, pars, bogeys, etc.) broken down by tee time wave.\n\n\n\u003cdetails\u003e\n    \u003csummary\u003eAPI Endpoint Info\u003c/summary\u003e\n\n\n**Endpoint:** `/preds/live-hole-stats`  \n**Method:** GET  \n**Formats:** JSON\n\n| Param   | Type | Ex                                                           |\n|---------|------|--------------------------------------------------------------|\n| tour    | str  |  pga (default), euro, opp (opposite field PGA TOUR event), kft, alt |\n| round   | str  | event_avg, 1, 2, 3, 4                                      |\n| display | str  | value (default), rank               |\n\n\u003c/details\u003e\n\n```python\ndata = dg.live_predictions.live_hole_stats()\ndata = dg.live_predictions.live_hole_stats(tour='kft')\n```\n\n\n---\n\n# Betting\n\n### Outright Odds\n\nReturns the most recent win, top 5, top 10, top 20, make/miss cut, and\n         first round leader odds offered at 11 sportsbooks alongside the corresponding\n          predictions from the DG model.\n\n\u003cdetails\u003e\n    \u003csummary\u003eAPI Endpoint Info\u003c/summary\u003e\n\n\n**Endpoint:** `/betting-tools/outrights`  \n**Method:** GET  \n**Formats:** JSON\n\n| Param   | Type | Ex                                                           |\n|---------|------|--------------------------------------------------------------|\n| tour    | (str, optional)  |  pga (default), euro, opp (opposite field PGA TOUR event), kft, alt |\n| market  | (str, required)  | Specifies the match-up market. Supports values: win, top_5, top_10, top_20, mc, make_cut, frl                                     |\n| odds_format | (str, optional)   |  Specifies the odds format. Supports values: percent, american, decimal (default), fraction               |\n\n\u003c/details\u003e\n\n```python\ndata = dg.betting.outright_odds(market='win')\ndata = dg.betting.outright_odds(market='top_5', tour='euro')\n```\n\n\n### Matchup Odds\n\n\nReturns the most recent tournament match-up, round match-up, and 3-ball odds offered at 8\n            sportsbooks alongside the corresponding prediction from our model.\n\n\u003cdetails\u003e\n    \u003csummary\u003eAPI Endpoint Info\u003c/summary\u003e\n\n\n**Endpoint:** `/betting-tools/matchups`  \n**Method:** GET  \n**Formats:** JSON\n\n| Param   | Type | Ex                                                           |\n|---------|------|--------------------------------------------------------------|\n| tour    | (str, optional)  |  pga (default), euro, opp (opposite field PGA TOUR event), kft, alt |\n| market  | (str, required)  | Specifies the match-up market. Supports values: tournament_matchups, round_matchups, 3_balls                                     |\n| odds_format | (str, optional)   |  Specifies the odds format. Supports values: percent, american, decimal (default), fraction               |\n\n\u003c/details\u003e\n\n```python\ndata = dg.betting.matchup_odds(market='tournament_matchups')\ndata = dg.betting.matchup_odds(market='3_balls', tour='euro')\n```\n\n### Matchup Odds - All Pairings\n\n\nReturns Data Golf matchup / 3-ball odds for every pairing in the next round of\n            current PGA Tour and European Tour events.\n\n\u003cdetails\u003e\n    \u003csummary\u003eAPI Endpoint Info\u003c/summary\u003e\n\n\n**Endpoint:** `/betting-tools/matchups-all-pairings`  \n**Method:** GET  \n**Formats:** JSON\n\n| Param   | Type | Ex                                                           |\n|---------|------|--------------------------------------------------------------|\n| tour    | (str, optional)  |  pga (default), euro, opp (opposite field PGA TOUR event), kft, alt |\n| odds_format | (str, optional)   |  Specifies the odds format. Supports values: percent, american, decimal (default), fraction               |\n\n\u003c/details\u003e\n\n```python\ndata = dg.betting.matchup_odds_all_pairings(tour='pga')\ndata = dg.betting.matchup_odds_all_pairings(tour='euro', odds_format='american')\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoreyjs%2Fdata-golf-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoreyjs%2Fdata-golf-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoreyjs%2Fdata-golf-api/lists"}