Golf v2

Frequently Asked Questions
API API Version Data Entry Workflow
Golf v2 Data Entry Workflow
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. ## Daily Change Log ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/golf-t2/changelog/pga/2015/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.us") conn.request("GET", "/golf-t2/changelog/pga/2015/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.us/golf-t2/changelog/pga/2015/7/21/changes.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Daily Change Log. https://api.sportradar.us/golf-`{access_level}{version}`/changelog/`{golf_tour}`/`{year}`/`{month}`/`{day}`/changes.`{format}`?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 (p) or Trial (t). | | `version` | Version number of the API you are accessing (Current Version: 2). | | `golf_tour` | pga, lpga, champ, web, or euro. | | `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.us/golf-`{access_level}{version}`/schema/changelog-v1.0.xsd?api_key=`{your_api_key}` Return to API map ## Official World Golf Ranking ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("http://api.sportradar.us/golf-t2/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.us") conn.request("GET", "/golf-t2/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 "http://api.sportradar.us/golf-t2/players/wgr/2017/rankings.xml?api_key={your_api_key}" ``` This endpoint retrieves the Official World Golf Ranking. https://api.sportradar.us/golf-`{access_level}{version}`/players/wgr/`{year}`/rankings.`{format}`?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 (p) or Trial (t). | | `version` | Version number of the API you are accessing (Current Version: 2). | | `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. http://feed.elasticstats.us/schema/golf/player/rankings-v1.0.xsd Return to API map ## Player Profiles ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/golf-t2/profiles/pga/2015/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.us") conn.request("GET", "/golf-t2/profiles/pga/2015/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.us/golf-t2/profiles/pga/2015/players/profiles.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves a Player Profiles. https://api.sportradar.us/golf-`{access_level}{version}`/profiles/`{golf_tour}`/`{year}`/players/profiles.`{format}`?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 (p) or Trial (t). | | `version` | Version number of the API you are accessing (Current Version: 2). | | `golf_tour` | pga, lpga, champ, web, or euro. | | `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.us/golf-`{access_level}{version}`/schema/season/participant-v1.0.xsd?api_key=`{your_api_key}` Return to API map ## Player Statistics ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/golf-t2/seasontd/pga/2015/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.us") conn.request("GET", "/golf-t2/seasontd/pga/2015/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.us/golf-t2/seasontd/pga/2015/players/statistics.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. Format example during a playoff. This endpoint retrieves the Player Statistics. https://api.sportradar.us/golf-`{access_level}{version}`/seasontd/`{golf_tour}`/`{year}`/players/statistics.`{format}`?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 (p) or Trial (t). | | `version` | Version number of the API you are accessing (Current Version: 2). | | `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.us/golf-`{access_level}{version}`/schema/season/statistics-v1.0.xsd?api_key=`{your_api_key}` Return to API map ## Scorecards Per Round ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/golf-t2/scorecards/pga/2015/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.us") conn.request("GET", "/golf-t2/scorecards/pga/2015/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.us/golf-t2/scorecards/pga/2015/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. This endpoint retrieves the Scorecards Per Round. https://api.sportradar.us/golf-`{access_level}{version}`/scorecards/`{golf_tour}`/`{year}`/tournaments/`{tournament_id}`/`{scorecard_type}`/`{round_number}`/scores.`{format}`?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 (p) or Trial (t). | | `version` | Version number of the API you are accessing (Current Version: 2). | | `golf_tour` | pga, lpga, champ, web, or euro. | | `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.us/golf-`{access_level}{version}`/schema/tournament/scorecard-v1.0.xsd?api_key=`{your_api_key}` Return to API map ## Tee Times Per Round ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/golf-t2/teetimes/pga/2015/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.us") conn.request("GET", "/golf-t2/teetimes/pga/2015/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.us/golf-t2/teetimes/pga/2015/tournaments/b681c361-bf1d-414a-98b5-a341671cd922/rounds/1/teetimes.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Tee Times Per Round. https://api.sportradar.us/golf-`{access_level}{version}`/teetimes/`{golf_tour}`/`{year}`/tournaments/`{tournament_id}`/`{teetime_type}`/`{round_number}`/teetimes.`{format}`?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 (p) or Trial (t). | | `version` | Version number of the API you are accessing (Current Version: 2). | | `golf_tour` | pga, lpga, champ, web, or euro. | | `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.us/golf-`{access_level}{version}`/schema/tournament/teetime-v1.0.xsd?api_key=`{your_api_key}` Return to API map ## Tournament Hole Statistics ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/golf-t2/hole_stats/pga/2015/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.us") conn.request("GET", "/golf-t2/hole_stats/pga/2015/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.us/golf-t2/hole_stats/pga/2015/tournaments/b681c361-bf1d-414a-98b5-a341671cd922/hole-statistics.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Tournament Hole Statistics. https://api.sportradar.us/golf-`{access_level}{version}`/hole_stats/`{golf_tour}`/`{year}`/tournaments/`{tournament_id}`/hole-statistics.`{format}`?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 (p) or Trial (t). | | `version` | Version number of the API you are accessing (Current Version: 2). | | `golf_tour` | pga, lpga, champ, web, or euro. | | `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.us/golf-`{access_level}{version}`/schema/tournament/statistics-v1.0.xsd?api_key=`{your_api_key}` Return to API map ## Tournament Leaderboard ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/golf-t2/leaderboard/pga/2015/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.us") conn.request("GET", "/golf-t2/leaderboard/pga/2015/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://api.sportradar.us/golf-t2/leaderboard/pga/2015/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. This endpoint retrieves the Tournament Leaderboard. https://api.sportradar.us/golf-`{access_level}{version}`/leaderboard/`{golf_tour}`/`{year}`/tournaments/`{tournament_id}`/leaderboard.`{format}`?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 (p) or Trial (t). | | `version` | Version number of the API you are accessing (Current Version: 2). | | `golf_tour` | pga, lpga, champ, web, or euro. | | `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.us/golf-`{access_level}{version}`/schema/tournament/leaderboard-v1.0.xsd?api_key=`{your_api_key}` Return to API map ## Tournament Schedule ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/golf-t2/schedule/pga/2015/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.us") conn.request("GET", "/golf-t2/schedule/pga/2015/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.us/golf-t2/schedule/pga/2015/tournaments/schedule.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Tournaments Schedule. https://api.sportradar.us/golf-`{access_level}{version}`/schedule/`{golf_tour}`/`{year}`/tournaments/schedule.`{format}`?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 (p) or Trial (t). | | `version` | Version number of the API you are accessing (Current Version: 2). | | `golf_tour` | pga, lpga, champ, web, or euro. | | `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.us/golf-`{access_level}{version}`/schema/schedule-v1.0.xsd?api_key=`{your_api_key}` Return to API map ## Tournament Summary ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("https://api.sportradar.us/golf-t2/summary/pga/2015/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.us") conn.request("GET", "/golf-t2/summary/pga/2015/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.us/golf-t2/summary/pga/2015/tournaments/b681c361-bf1d-414a-98b5-a341671cd922/summary.xml?api_key={your_api_key}" ``` > The above command returns xml structured like this. This endpoint retrieves the Tournament Summary. https://api.sportradar.us/golf-`{access_level}{version}`/summary/`{golf_tour}`/`{year}`/tournaments/`{tournament_id}`/summary.`{format}`?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 (p) or Trial (t). | | `version` | Version number of the API you are accessing (Current Version: 2). | | `golf_tour` | pga, lpga, champ, web, or euro. | | `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.us/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 and Java which provides 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 ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("http://api.sportradar.us/golf-t2/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 http.client conn = http.client.HTTPSConnection("api.sportradar.us") conn.request("GET", "/golf-t2/stream/pga/leaderboards/subscribe?api_key={your_api_key}") res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```shell curl -L GET api.sportradar.us/golf-t2/stream/pga/leaderboards/subscribe?api_key={your_api_key} ``` > The above command returns json like this. This endpoint retrieves the Leaderboard information via Push. http://api.sportradar.us/golf-`{access_level}{version}`/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 (p) or Trial (t). | | `version` | Version number of the API you are accessing (Current Version: 2). | | `golf_tour` | pga, lpga, champ, web, or euro. | | `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("http://api.sportradar.us/golf-t2/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 http.client conn = http.client.HTTPSConnection("api.sportradar.us") conn.request("GET", "/golf-t2/stream/pga/leaderboards/subscribe?api_key={your_api_key}&tournament=sd:tournament:9db12181-b55d-4e4f-8c18-936f4c7c7e2d&scoring_system=stroke") res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```shell curl -L GET 'api.sportradar.us/golf-t2/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 ```ruby require 'uri' require 'net/http' require 'openssl' url = URI("http://api.sportradar.us/golf-t2/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 http.client conn = http.client.HTTPSConnection("api.sportradar.us") conn.request("GET", "/golf-t2/stream/pga/scorecards/subscribe?api_key={your_api_key}") res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```shell curl -L GET "http://api.sportradar.us/golf-t2/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.
    This endpoint retrieves the Scorecard information via Push. http://api.sportradar.us/golf-`{access_level}{version}`/stream/`{golf_tour}`/scorecards/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 (p) or Trial (t). | | `version` | Version number of the API you are accessing (Current Version: 2). | | `golf_tour` | pga, lpga, champ, web, or euro. | | `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("http://api.sportradar.us/golf-t2/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 http.client conn = http.client.HTTPSConnection("api.sportradar.us") conn.request("GET", "/golf-t2/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") res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```shell curl -L GET 'api.sportradar.us/golf-t2/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_sequence` | Round sequence expressed as: {round_sequence}.
    Example: round_sequence=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.
    • 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 (http://developer.sportradar.us/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:

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

    Return to top