Golf v2

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