Golf v2

Frequently Asked Questions
API API Version Data Entry Workflow XSD Schema
Golf v2 Data Entry Workflow Download
Note: Authentication is required for all API calls.
## Golf API Map To best utilize the Golf API, you will need several parameters to create your API calls. The map below illustrates how you can obtain the parameters you need. >

Examples:

>To find a pairing's tee time for a given tournament: >
  1. Call the Tournament Schedule and find the Tournament Id for the chosen tournament
  2. Call the Tee Times Per Round using the Tournament Id and a chosen round number
  3. Find your chosen pairing and locate the tee_time attribute
>The tee time of the pairing is displayed. >
    The primary feeds require only a date or year to call the endpoints. Those feeds provide Tournament Ids which can be used to access the tournament feeds. ## Tour Coverage Our Golf API provides hole-by-hole coverage for each of the below tours. See below for further information on events covered. PGA Tour calendar events - We cover all PGA Tour events in which Fed Ex Cup points are awarded, including the World Golf Championship events. In addition, we also cover the President’s Cup and Ryder Cup events. DP World Tour calendar events - We cover all traditional match and stroke play events on the Euro Tour schedule that award Race to Dubai points, including Majors and World Golf Championship events. We also cover the President's Cup and Ryder Cup. LPGA Tour calendar events - We cover all traditional match and stroke-play events on the LPGA Tour schedule which award points, including Majors. In addition, we also cover the Solheim Cup. PGA Tour Champions calendar events - We cover all standard stroke and match play PGA Tour Champions events in which points are awarded. Korn Ferry Tour calendar events - We cover all standard stroke and match play Korn Ferry Tour events in which points are awarded. LIV Golf Invitational Series - We cover all standard stroke play events on the LIV Golf Invitational Series schedule. Olympic calendar events – We cover all Olympic Men’s & Women’s Golf events. Hero World Challenge – We cover the Hero World Challenge. This event will not be reflected in player seasonal statistics, as it does not award Fed Ex Cup points. This tournament is listed in our PGA Tour Schedule. The Match exhibitions - We cover these exhibitions within our PGA Tour schedule as a ‘cup’ style event. These events will not be reflected in player seasonal statistics, as they do not award Fed Ex Cup points. ## Daily Change Log Provides IDs and timestamps for players, tournaments, schedules, pairings and statistics that have been modified on a given date. To receive the data updates, use these unique IDs to pull relevant API feeds. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/golf/trial/pga/v2/en/2022/7/21/changes.xml?api_key={your_api_key}") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```python import http.client conn = http.client.HTTPSConnection("api.sportradar.com") conn.request("GET", "/golf/trial/pga/v2/en/2022/7/21/changes.xml?api_key={your_api_key}") res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```shell curl -X GET "https://api.sportradar.com/golf/trial/pga/v2/en/2022/7/21/changes.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Daily Change Log feed by replacing the parameters in the following URL: https://api.sportradar.com/golf/`{access_level}`/`{golf_tour}`/`{version}`/en/`{year}`/`{month}`/`{day}`/changes.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Defines the access level of your API key as Production (production) or Trial (trial). | | `version` | Version number of the API you are accessing (Current Version: v2). | | `golf_tour` | pga, lpga, champ, pgad, euro, oly, or liv. | | `year` | Year in 4 digit format (YYYY). | | `month` | Month in 2 digit format (MM). | | `day` | Day in 2 digit format (DD). | | `format` | xml or json. | | `your_api_key` | Your API key. | To retrieve the XML Schema Definition (.XSD) for the Daily Change Log, replace the parameters in the following URL. https://api.sportradar.com/golf-`{access_level}{version}`/schema/changelog-v1.0.xsd?api_key=`{your_api_key}` Return to API map ## Official World Golf Ranking Provides Official World Golf Rankings and points for top the 200 players. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/golf/trial/v2/en/players/wgr/2017/rankings.xml?api_key={your_api_key}") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```python import http.client conn = http.client.HTTPSConnection("api.sportradar.com") conn.request("GET", "/golf/trial/v2/en/players/wgr/2017/rankings.xml?api_key={your_api_key}") res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```shell curl -X GET "https://api.sportradar.com/golf/trial/v2/en/players/wgr/2017/rankings.xml?api_key={your_api_key}" ``` Access the Official World Golf Ranking feed by replacing the parameters in the following URL: https://api.sportradar.com/golf/`{access_level}`/`{version}`/en/players/wgr/`{year}`/rankings.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Defines the access level of your API key as Production (production) or Trial (trial). | | `version` | Version number of the API you are accessing (Current Version: v2). | | `year` | Year in 4 digit format (YYYY). | | `format` | xml or json. | | `your_api_key` | Your API key. | To retrieve the XML Schema Definition (.XSD) for the Official World Golf Ranking visit. https://feed.elasticstats.us/schema/golf/player/rankings-v1.0.xsd Return to API map ## Player Profiles Detailed player information including height, weight, place of birth, date of birth, residence, and college. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/golf/trial/pga/v2/en/2022/players/profiles.xml?api_key={your_api_key}") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```python import http.client conn = http.client.HTTPSConnection("api.sportradar.com") conn.request("GET", "/golf/trial/pga/v2/en/2022/players/profiles.xml?api_key={your_api_key}") res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```shell curl -X GET "https://api.sportradar.com/golf/trial/pga/v2/en/2022/players/profiles.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Player Profile feed by replacing the parameters in the following URL: https://api.sportradar.com/golf/`{access_level}`/`{golf_tour}`/`{version}`/en/`{year}`/players/profiles.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Defines the access level of your API key as Production (production) or Trial (trial). | | `version` | Version number of the API you are accessing (Current Version: v2). | | `golf_tour` | pga, lpga, champ, pgad, euro, oly, or liv. | | `year` | Year in 4 digit format (YYYY). | | `format` | xml or json. | | `your_api_key` | Your API key. | To retrieve the XML Schema Definition (.XSD) for the Player Profile, replace the parameters in the following URL. https://api.sportradar.com/golf-`{access_level}{version}`/schema/season/participant-v1.0.xsd?api_key=`{your_api_key}` Return to API map ## Player Statistics Season statistics for all golfers who have earned Fed Ex Cup points. Season statistics are validated and corrected on a weekly basis. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/golf/trial/pga/v2/en/2022/players/statistics.xml?api_key={your_api_key}") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```python import http.client conn = http.client.HTTPSConnection("api.sportradar.com") conn.request("GET", "/golf/trial/pga/v2/en/2022/players/statistics.xml?api_key={your_api_key}") res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```shell curl -X GET "https://api.sportradar.com/golf/trial/pga/v2/en/2022/players/statistics.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Format example during a playoff. Access the Player Statistics feed by replacing the parameters in the following URL: https://api.sportradar.com/golf/`{access_level}`/`{golf_tour}`/`{version}`/en/`{year}`/players/statistics.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Defines the access level of your API key as Production (production) or Trial (trial). | | `version` | Version number of the API you are accessing (Current Version: v2). | | `golf_tour` | pga. | | `year` | Year in 4 digit format (YYYY). | | `format` | xml or json. | | `your_api_key` | Your API key. | To retrieve the XML Schema Definition (.XSD) for the Player Statistics, replace the parameters in the following URL. https://api.sportradar.com/golf-`{access_level}{version}`/schema/season/statistics-v1.0.xsd?api_key=`{your_api_key}` Return to API map ## Scorecards Per Round Detailed round scoring including player information, course information, player scoring per hole, and overall tournament scoring per player. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/golf/trial/pga/v2/en/2022/tournaments/b681c361-bf1d-414a-98b5-a341671cd922/rounds/1/scores.xml?api_key={your_api_key}") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```python import http.client conn = http.client.HTTPSConnection("api.sportradar.com") conn.request("GET", "/golf/trial/pga/v2/en/2022/tournaments/b681c361-bf1d-414a-98b5-a341671cd922/rounds/1/scores.xml?api_key={your_api_key}") res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```shell curl -X GET "https://api.sportradar.com/golf/trial/pga/v2/en/2022/tournaments/b681c361-bf1d-414a-98b5-a341671cd922/rounds/1/scores.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Format example durring a playoff. Access the Scorecards Per Round feed by replacing the parameters in the following URL: https://api.sportradar.com/golf/`{access_level}`/`{golf_tour}`/`{version}`/en/`{year}`/tournaments/`{tournament_id}`/`{scorecard_type}`/`{round_number}`/scores.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Defines the access level of your API key as Production (production) or Trial (trial). | | `version` | Version number of the API you are accessing (Current Version: v2). | | `golf_tour` | pga, lpga, champ, pgad, euro, oly, or liv. | | `year` | Year in 4 digit format (YYYY). | | `tournament_id` | ID of a given tournament. | | `scorecard_type` | Rounds or Playoff. | | `round_number` | Number of the round. | | `format` | xml or json. | | `your_api_key` | Your API key. | To retrieve the XML Schema Definition (.XSD) for the Scorecards Per Round, replace the parameters in the following URL. https://api.sportradar.com/golf-`{access_level}{version}`/schema/tournament/scorecard-v1.0.xsd?api_key=`{your_api_key}` Return to API map ## Tee Times Per Round Round information including pairings and starting positions. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/golf/trial/pga/v2/en/2022/tournaments/b681c361-bf1d-414a-98b5-a341671cd922/rounds/1/teetimes.xml?api_key={your_api_key}") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```python import http.client conn = http.client.HTTPSConnection("api.sportradar.com") conn.request("GET", "/golf/trial/pga/v2/en/2022/tournaments/b681c361-bf1d-414a-98b5-a341671cd922/rounds/1/teetimes.xml?api_key={your_api_key}") res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```shell curl -X GET "https://api.sportradar.com/golf/trial/pga/v2/en/2022/tournaments/b681c361-bf1d-414a-98b5-a341671cd922/rounds/1/teetimes.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Tee Times Per Round feed by replacing the parameters in the following URL: https://api.sportradar.com/golf/`{access_level}`/`{golf_tour}`/`{version}`/en/`{year}`/tournaments/`{tournament_id}`/`{teetime_type}`/`{round_number}`/teetimes.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Defines the access level of your API key as Production (production) or Trial (trial). | | `version` | Version number of the API you are accessing (Current Version: v2). | | `golf_tour` | pga, lpga, champ, pgad, euro, oly, or liv. | | `year` | Year in 4 digit format (YYYY). | | `tournament_id` | ID of a given tournament. | | `teetime_type` | Rounds or Playoff. | | `round_number` | Number of the round. | | `format` | xml or json. | | `your_api_key` | Your API key. | To retrieve the XML Schema Definition (.XSD) for the Tee Times Per Round, replace the parameters in the following URL. https://api.sportradar.com/golf-`{access_level}{version}`/schema/tournament/teetime-v1.0.xsd?api_key=`{your_api_key}` Return to API map ## Tournament Hole Statistics Detailed information on how the field fared on each hole of a tournament. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/golf/trial/pga/v2/en/2022/tournaments/b681c361-bf1d-414a-98b5-a341671cd922/hole-statistics.xml?api_key={your_api_key}") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```python import http.client conn = http.client.HTTPSConnection("api.sportradar.com") conn.request("GET", "/golf/trial/pga/v2/en/2022/tournaments/b681c361-bf1d-414a-98b5-a341671cd922/hole-statistics.xml?api_key={your_api_key}") res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```shell curl -X GET "https://api.sportradar.com/golf/trial/pga/v2/en/2022/tournaments/b681c361-bf1d-414a-98b5-a341671cd922/hole-statistics.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Tournament Hole Statistics feed by replacing the parameters in the following URL: https://api.sportradar.com/golf/`{access_level}`/`{golf_tour}`/`{version}`/en/`{year}`/tournaments/`{tournament_id}`/hole-statistics.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Defines the access level of your API key as Production (production) or Trial (trial). | | `version` | Version number of the API you are accessing (Current Version: v2). | | `golf_tour` | pga, lpga, champ, pgad, euro, oly, or liv. | | `year` | Year in 4 digit format (YYYY). | | `tournament_id` | ID of a given tournament. | | `format` | xml or json. | | `your_api_key` | Your API key. | To retrieve the XML Schema Definition (.XSD) for the Tournament Hole Statistics, replace the parameters in the following URL. https://api.sportradar.com/golf-`{access_level}{version}`/schema/tournament/statistics-v1.0.xsd?api_key=`{your_api_key}` Return to API map ## Tournament Leaderboard Detailed tournament statistics including player statistics at tournament and per-round level. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/golf/trial/pga/v2/en/2022/tournaments/b681c361-bf1d-414a-98b5-a341671cd922/leaderboard.xml?api_key={your_api_key}") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```python import http.client conn = http.client.HTTPSConnection("api.sportradar.com") conn.request("GET", "/golf/trial/pga/v2/en/2022/tournaments/b681c361-bf1d-414a-98b5-a341671cd922/leaderboard.xml?api_key={your_api_key}") res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```shell curl -X GET "https://https://api.sportradar.com/golf/trial/pga/v2/en/2022/tournaments/b681c361-bf1d-414a-98b5-a341671cd922/leaderboard.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Format example durring a playoff. Access the Tournament Leaderboard feed by replacing the parameters in the following URL: https://api.sportradar.com/golf/`{access_level}`/`{golf_tour}`/`{version}`/en/`{year}`/tournaments/`{tournament_id}`/leaderboard.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Defines the access level of your API key as Production (production) or Trial (trial). | | `version` | Version number of the API you are accessing (Current Version: v2). | | `golf_tour` | pga, lpga, champ, pgad, euro, oly, or liv. | | `year` | Year in 4 digit format (YYYY). | | `tournament_id` | ID of a given tournament. | | `format` | xml or json. | | `your_api_key` | Your API key. | To retrieve the XML Schema Definition (.XSD) for the Tournament Leaderboard, replace the parameters in the following URL. https://api.sportradar.com/golf-`{access_level}{version}`/schema/tournament/leaderboard-v1.0.xsd?api_key=`{your_api_key}` Return to API map ## Tournament Schedule Schedule of tournaments for the season including date, location, course layouts, and tournament purse. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/golf/trial/pga/v2/en/2022/tournaments/schedule.xml?api_key={your_api_key}") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```python import http.client conn = http.client.HTTPSConnection("api.sportradar.com") conn.request("GET", "/golf/trial/pga/v2/en/2022/tournaments/schedule.xml?api_key={your_api_key}") res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```shell curl -X GET "https://api.sportradar.com/golf/trial/pga/v2/en/2022/tournaments/schedule.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Tournament Schedule feed by replacing the parameters in the following URL: https://api.sportradar.com/golf/`{access_level}`/`{golf_tour}`/`{version}`/en/`{year}`/tournaments/schedule.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Defines the access level of your API key as Production (production) or Trial (trial). | | `version` | Version number of the API you are accessing (Current Version: v2). | | `golf_tour` | pga, lpga, champ, pgad, euro, oly, or liv. | | `year` | Year in 4 digit format (YYYY). | | `format` | xml or json. | | `your_api_key` | Your API key. | To retrieve the XML Schema Definition (.XSD) for Tournaments Schedule, replace the parameters in the following URL. https://api.sportradar.com/golf-`{access_level}{version}`/schema/schedule-v1.0.xsd?api_key=`{your_api_key}` Return to API map ## Tournament Summary Summary information concerning the current tournament including location, course layout and tournament field. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/golf/trial/pga/v2/en/2022/tournaments/b681c361-bf1d-414a-98b5-a341671cd922/summary.xml?api_key={your_api_key}") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```python import http.client conn = http.client.HTTPSConnection("api.sportradar.com") conn.request("GET", "/golf/trial/pga/v2/en/2022/tournaments/b681c361-bf1d-414a-98b5-a341671cd922/summary.xml?api_key={your_api_key}") res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```shell curl -X GET "https://api.sportradar.com/golf/trial/pga/v2/en/2022/tournaments/b681c361-bf1d-414a-98b5-a341671cd922/summary.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Access the Tournament Summary feed by replacing the parameters in the following URL: https://api.sportradar.com/golf/`{access_level}`/`{golf_tour}`/`{version}`/en/`{year}`/tournaments/`{tournament_id}`/summary.`{format}`?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Defines the access level of your API key as Production (production) or Trial (trial). | | `version` | Version number of the API you are accessing (Current Version: v2). | | `golf_tour` | pga, lpga, champ, pgad, euro, oly, or liv. | | `year` | Year in 4 digit format (YYYY). | | `tournament_id` | ID of a given tournament. | | `format` | xml or json. | | `your_api_key` | Your API key. | To retrieve the XML Schema Definition (.XSD) for the Tournaments Summary, replace the parameters in the following URL. https://api.sportradar.com/golf-`{access_level}{version}`/schema/tournament-v1.0.xsd?api_key=`{your_api_key}` Return to API map ## Push Feeds >To best utilize Push feeds, we have included code samples in Ruby, Java and Python which provide an example of a way you can consume the feeds. Using these samples will output the feeds content to STDOUT.
    For Java, we have also provided a Stream Client to assist your integration.

    Note: In the provided Java sample, replace "URL GOES HERE" with the desired Push feed URL. ```ruby require 'httpclient' module Sportradar module HTTP module Stream class Client attr_reader :url, :logger def initialize(url, publisher, logger) @url = url @logger = logger @publisher = publisher @client = ::HTTPClient.new(:agent_name => 'SportsData/1.0') end def start @thread ||= Thread.new do logger.debug "Starting loop" @client.get_content(url, :follow_redirect => true) do |chunk| @publisher.publish(::JSON.parse(chunk)) if @publisher end logger.debug "finished loop" end end def stop @thread.terminate if @thread end end end end end ``` ```java package com.sportradar.http.stream.client; import org.junit.After; import org.junit.Before; import org.junit.Test; public class StreamClientTest { private StreamClient client; private static String SERVICE_URL = ""; @Before public void setup() { client = new StreamClient(); } @After public void cleanup() { client.terminate(); } @Test public void testStream() throws Exception { Handler handler = new ConsoleHandler(); client.stream(SERVICE_URL, handler); System.out.println("Connecting...."); Thread.sleep(1 * 60 * 1000); System.out.println("Disconnecting...."); } } ``` Some of our APIs include Push feeds that allow you to get updates as soon as they are available. Push API feeds automatically send JSON payload to you via a push service, and can dramatically reduce the number of calls you need to make to our RESTful API feeds. The structure of the Push feeds are similar to the structure of the corresponding RESTful API feed (i.e. Push Leaderboard and Tournament Leaderboard). The push service ensures reliable and efficient delivery of the most up to date information. Our Push services are based on a HTTP publish/subscribe model. When making a call to the Push APIs, you "subscribe" to various data feeds provided by our service; whenever new content is available on one of those feeds, the server pushes that information out to your client. When no new information is available on the feed, a heartbeat message is sent every 5 seconds to keep the connection active. If you want to filter the results of the feeds, there are several optional query string parameters that can be applied to the API call. If left unfiltered, than all data for the feed is displayed (i.e. all tournaments). For your applications to accept data from our Push feeds, ensure that your application can: * Can follow a HTTP redirect or use the location provided in the feeds header within one minute of your initial request. * Can accept HTTP data transfer encoded as chunked. Our Push service does not provide a "stateful session", there is no memory of what data has been sent previously. If you are disconnected from the Push session, you can use the RESTful API to catch up or recover from the disconnection. Syntax for using our Push feeds and examples of the JSON payloads can be found below. ## Push - Leaderboard Detailed real-time tournament statistics including player statistics at tournament and per-round level. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/golf/trial/stream/pga/leaderboards/subscribe?api_key={your_api_key}") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```python import requests import json r = requests.get("https://api.sportradar.com/golf/trial/stream/pga/leaderboards/subscribe", params = {'api_key': 'your_api_key'}, allow_redirects=False) redirect_url = r.headers['Location'] r = requests.get(redirect_url, stream=True) for line in r.iter_lines(): # filter out keep-alive new lines if line: decoded_line = line.decode('utf-8') print(json.loads(decoded_line)) ``` ```shell curl -L GET 'api.sportradar.com/golf/trial/stream/pga/leaderboards/subscribe?api_key={your_api_key}' ``` > The above command returns json like this. https://api.sportradar.com/golf/`{access_level}`/stream/`{golf_tour}`/leaderboards/subscribe?api_key=`{your_api_key}` Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `access_level` | Defines the access level of your API key as Production (production) or Trial (trial). | | `version` | Version number of the API you are accessing (Current Version: v2). | | `golf_tour` | pga, lpga, champ, pgad, euro, oly, or liv. | | `your_api_key` | Your API key. | ### Optional Query String Parameters >Example including optional query string parameters: ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/golf/trial/stream/pga/leaderboards/subscribe?api_key={your_api_key}&tournament=sd:tournament:9db12181-b55d-4e4f-8c18-936f4c7c7e2d&scoring_system=stroke") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```python import requests import json r = requests.get("https://api.sportradar.com/golf/trial/stream/pga/leaderboards/subscribe", params = {'api_key': 'your_api_key', 'tournament': 'sd:tournament:9db12181-b55d-4e4f-8c18-936f4c7c7e2d', 'scoring_system': 'stroke'}, allow_redirects=False) redirect_url = r.headers['Location'] r = requests.get(redirect_url, stream=True) for line in r.iter_lines(): # filter out keep-alive new lines if line: decoded_line = line.decode('utf-8') print(json.loads(decoded_line)) ``` ```shell curl -L GET 'api.sportradar.com/golf/trial/stream/pga/leaderboards/subscribe?api_key={your_api_key}&tournament=sd:tournament:9db12181-b55d-4e4f-8c18-936f4c7c7e2d&scoring_system=stroke' ``` In addition to the URL parameters listed above, you can filter the Leaderboard information with one or more of the following optional query string parameters.
    Note: Optional query string parameters must be added after your API key with an ampersand (&). If you are filtering for more than one result, separate the results with a comma (,) and no spaces.
    Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `tournament` | Tournament id expressed as: sd:tournament:{tournament_id}.
    Example: sd:tournament:9db12181-b55d-4e4f-8c18-936f4c7c7e2d | | `tournament_type` | Tournament type expressed as: {tournament_type}.
    Example: tournament_type=stroke | | `scoring_system` | Scoring system expressed as: {scoring_system}.
    Example: scoring_system=match | Return to API map ## Push - Scorecard Detailed real-time round scoring including player information, player scoring per hole, and overall tournament scoring per player. ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/golf/trial/stream/pga/scorecards/subscribe?api_key={your_api_key}") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```python import requests import json r = requests.get("https://api.sportradar.com/golf/trial/stream/pga/scorecards/subscribe", params = {'api_key': 'your_api_key'}, allow_redirects=False) redirect_url = r.headers['Location'] r = requests.get(redirect_url, stream=True) for line in r.iter_lines(): # filter out keep-alive new lines if line: decoded_line = line.decode('utf-8') print(json.loads(decoded_line)) ``` ```shell curl -L GET "https://api.sportradar.com/golf/trial/stream/pga/scorecards/subscribe?api_key={your_api_key}" ``` >The above command returns json like this.
    Note: In case of disconnection with the feed, use the RESTful api Scorecard Per Round feed to recover any potentially missed data.
    Access the Push Scorecard feed by replacing the parameters in the following URL: https://api.sportradar.com/golf/`{access_level}`/stream/`{golf_tour}`/scorecards/subscribe?api_key=`{your_api_key}` | Parameter | Description | | --------- | ----------- | | `access_level` | Defines the access level of your API key as Production (production) or Trial (trial). | | `version` | Version number of the API you are accessing (Current Version: v2). | | `golf_tour` | pga, lpga, champ, pgad, euro, oly, or liv. | | `your_api_key` | Your API key. | ### Optional Query String Parameters >Example including optional query string parameters: ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.com/golf/trial/stream/pga/scorecards/subscribe?api_key={your_api_key}&tournament=sd:tournament:6180b261-9595-4b90-a706-58f54258da71&player=sd:player:45a571da-a1e4-4d48-9f88-47bb5185f0d0") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```python import requests import json r = requests.get("https://api.sportradar.com/golf/trial/stream/pga/scorecards/subscribe", params = {'api_key': 'your_api_key', 'tournament': 'sd:tournament:6180b261-9595-4b90-a706-58f54258da71', 'player': 'sd:player:45a571da-a1e4-4d48-9f88-47bb5185f0d0'}, allow_redirects=False) redirect_url = r.headers['Location'] r = requests.get(redirect_url, stream=True) for line in r.iter_lines(): # filter out keep-alive new lines if line: decoded_line = line.decode('utf-8') print(json.loads(decoded_line)) ``` ```shell curl -L GET 'api.sportradar.com/golf/trial/stream/pga/scorecards/subscribe?api_key={your_api_key}&tournament=sd:tournament:6180b261-9595-4b90-a706-58f54258da71&player=sd:player:45a571da-a1e4-4d48-9f88-47bb5185f0d0' ``` In addition to the URL parameters listed above, you can filter the Scorecard information with one or more of the following optional query string parameters.
    Note: Optional query string parameters must be added after your API key with an ampersand (&). If you are filtering for more than one result, separate the results with a comma (,) and no spaces.
    Replace placeholders with the following query parameters: | Parameter | Description | | --------- | ----------- | | `tournament` | Tournament id expressed as: sd:tournament:{tournament_id}.
    Example: sd:tournament:9db12181-b55d-4e4f-8c18-936f4c7c7e2d | | `tournament_type` | Tournament type expressed as: {tournament_type}.
    Example: tournament_type=stroke | | `scoring_system` | Scoring system expressed as: {scoring_system}.
    Example: scoring_system=match | | `round` | Round sequence expressed as: {round}.
    Example: round=2 | | `player` | Player id expressed as: sd:player:{player_id}.
    Example: sd:player:da226913-b804-48de-adbf-96e956eb75ac | Return to API map ## Frequently Asked Questions

    Q: What format are date fields presented in?

    A: When we present date only values we present these in the ISO 8601 standard format.
    ex: 2013-04-03
    We use these for attributes that have date and no time (such as birthdate). For more information: https://en.wikipedia.org/wiki/ISO_8601

    Q: What format are the date/time fields presented in?

    A: All of our Date/Time attributes are in UTC, presented in the ISO 8601 standard format.
    ex: 2013-04-03T18:15:00+00:00
    For more information: https://en.wikipedia.org/wiki/ISO_8601

    Q: Where do I find a list of golfers participating in a particular tournament?

    A: The Tournament Summary feed gives you a list of those golfers participating in the tournament.

    Q: What are the valid Event types?

    A: Here are the valid event types:

    • stroke
    • match
    • cup
    • team

    Q: What are the valid Match formats?

    A: Here are the valid match formats:

    • singles
    • fourball
    • foursomes

    Q: What are the valid Match types?

    A: Here are the valid match types:

    • regular
    • semifinal
    • championship
    • consolation

    Q: What are the valid player statuses?

    A: The only player status revolves around a player’s status for a particular tournament. If the player is still competing in the tournament, no status attribute will appear. Here are all remaining player statuses and their definitions:

    • CUT – The player has missed the cut of a tournament
    • WD – The player has withdrawn from a tournament
    • MDF – The player made the cut, but did not finish the tournament
    • DQ – The player has been disqualified
    • DNS – The player was scheduled to compete in the tournament, but never started

    Q: What are the valid tournament and round statuses and their definitions?

    A: Here are the valid tournament and round statuses:

    Round

    • scheduled - The round is scheduled to occur.
    • inprogress – The round is in progress.
    • delayed – The round has been delayed.
    • suspended - The round was suspended.
    • cancelled – The round was cancelled.
    • complete – The round is over, but stat validation is not complete.
    • closed – The round is over and the stats have been validated.
    • reopened – The round stats are in the process of being corrected.

    Tournament

    • scheduled - The tournament is scheduled to occur.
    • inprogress – The tournament is in progress.
    • delayed – The tournament was delayed.
    • cancelled – The tournament was cancelled.
    • created – The tournament has been created and we have begun logging the field and tee times when available.
    • complete – The tournament is over, but stat validation is not complete.
    • closed – The tournament is over and the stats have been validated.
    • playoff – The tournament is in a playoff.
    • reopened – The tournament stats are in the process of being corrected.

    Q: Do you provide season statistics for all golfers?

    A: We provide season statistics for all golfers who have earned Fed Ex Cup points. Season statistics are validated and corrected on a weekly basis. World Golf Rank for each season will reflect the players ranking following the completion of the Tour Championship, not the end of the year. For more information on timing, please see our Golf Weekly Workflow document (https://developer.sportradar.com/page/Golf_Workflow).

    Q: Course information in the Tournament Schedule feed does not match the course information for a specific tournament, why is that?

    A: A full list of course attributes can be found in 2 feeds: Tournament Schedule and Tournament Summary. The Tournament Schedule feed provides the generic course layout and yardage. Courses can be changed for a specific tournament. To find the official course layout and yardage for a specific tournament, you need to use the Tournament Summary feed.

    Q: How do you handle the points reset associated with the Coca-Cola Championship and the Fed Ex Cup?

    A: The top 30 players have a point reset applied. We will reset the point total for each player involved in the Coca-Cola Championship tournament. Players ranked 31 and above will have their points reflect their correct total prior to the reset applied to those players who qualified. After the Coca-Cola Championship, the top 30 player’s points will reflect the reset value plus points earned in the Coca-Cola Championship tournament.

    Q: How is playoff data represented within the feeds?

    A: Play-off data will appear within the Tournament Leaderboard feed and Scorecard Per Round. In the Tournament Leaderboard feed, a play-off element will appear that includes all golfers taking part in the play-off. As with other rounds within the tournament, the play-off section will include the golfer’s current score as well as a summary of their current round score. An example is presented on the right.

    <playoff>
    <player first_name="Jordan" last_name="Spieth" country="UNITED STATES" id="3e4963cb-6e80-4393-85cf-2aecec453c4a" position="1" score="-1" strokes="10">
    <rounds>
    <round score="-1" strokes="10" thru="3" eagles="0" birdies="1" pars="2" bogeys="0" double_bogeys="0" other_scores="0" holes_in_one="0" sequence="1"/>
    </rounds>
    </player>
    <player first_name="Sean" last_name="O'Hair" country="UNITED STATES" id="e260788d-657a-4d72-9766-82f27a9c66ba" position="2" tied="true" score="0" strokes="11"> <rounds> <round score="0" strokes="11" thru="3" eagles="0" birdies="0" pars="3" bogeys="0" double_bogeys="0" other_scores="0" holes_in_one="0" sequence="1"/> </rounds> </player> <player first_name="Patrick" last_name="Reed" country="UNITED STATES" id="12195ed9-3fcd-486a-86b4-1ec726d201cd" position="2" tied="true" score="0" strokes="11"> <rounds> <round score="0" strokes="11" thru="3" eagles="0" birdies="0" pars="3" bogeys="0" double_bogeys="0" other_scores="0" holes_in_one="0" sequence="1"/> </rounds> </player> </playoff>

    If a tournament plays a complete playoff round to determine the winner, the golfer’s round information will also be available in the Scorecard Per Round feed. You can generate the Scorecard By Round by substituting the “rounds” variable with “playoff”, like within the following example:

    https://api.sportradar.com/golf-t2/scorecards/pga/2017/tournaments/d0a413de-627a-481c-825a-142ec55239a5/playoff/1/scores.xml?api_key=

    Return to top

    Docs Navigation