Detailed real-time tournament statistics including player statistics at tournament and per-round level.
Syntax
https://api.sportradar.com/golf/{access_level}/stream/{golf_tour}/leaderboards/subscribe?api_key={your_api_key}&locale=en |
Parameters
Parameter | Description |
---|---|
access_level | Defines the access level of your API keyproduction , trial |
golf_tour | Golf tourpga , lpga , champ , pgad , euro , oly , liv |
your_api_key | Your API key |
Optional Query String Parameters
By default, a Push feed will provide all data available for all in progress games. If needed, you can filter the data returned by including query strings.
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.
Parameter | Description |
---|---|
tournament | Tournament id Example: sd:tournament:9db12181-b55d-4e4f-8c18-936f4c7c7e2d |
tournament_type | Tournament type Example: tournament_type=stroke |
scoring_system | Scoring system Example: scoring_system=match |
locale | Language returned expressed as a 2-letter codezh (Chinese - simplified), zht (Chinese - traditional), da (Danish), nl (Dutch), en (English), fi (Finnish), fr (French), de (German), it (Italian), ja (Japanese), ko (Korean), no (Norwegian), es (Spanish), se (Swedish)Example: locale=en Click here for a tabular list of available languages per competition. |
Code Samples
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.us/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
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))
curl -L GET 'api.sportradar.us/golf/trial/stream/pga/leaderboards/subscribe?api_key={your_api_key}'
Samples with Query String Params
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.us/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
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))
curl -L GET 'api.sportradar.us/golf/trial/stream/pga/leaderboards/subscribe?api_key={your_api_key}&tournament=sd:tournament:9db12181-b55d-4e4f-8c18-936f4c7c7e2d&scoring_system=stroke'
Response Sample
The above commands return json like this.
Data Points
Round Scoring:
Attribute | Parent Element | Type | Description |
---|---|---|---|
birdies | leaderboard - rounds | Integer | Number of birdies for a player in a tournament round |
bogeys | leaderboard - rounds | Integer | Number of bogeys for a player in a tournament round |
double_bogeys | leaderboard - rounds | Integer | Number of double bogeys for a player in a tournament round |
eagles | leaderboard - rounds | Integer | Number of eagles for a player in a tournament round |
thru | leaderboard - rounds | Integer | Number of holes completed for a player in a tournament round |
holes_in_one | leaderboard - rounds | Integer | Number of holes in one for a player in a tournament round |
other_scores | leaderboard - rounds | Integer | Number of other scores for a player in a tournament round (non- pars, birdies, eagles, holes in one, bogeys, double bogeys) |
pars | leaderboard - rounds | Integer | Number of pars for a player in a tournament round |
sequence | leaderboard - rounds | Integer | Tournament round number |
score | leaderboard - rounds | Integer | Player score in a round ex. -4 |
strokes | leaderboard - rounds | Short | Player strokes in a round ex. 68 |
part | part | Integer | Sequential number of a tournament section/part. Used only in mix format events. ex. 1 or 2 |
status | part | String | Status of a tournament section/part. Used only in mix format events. ex. inprogress or closed |
type | part | String | Type of a tournament section/part. Used only in mix format events. ex. stroke or match |
Metadata:
Attribute | Parent Element | Type | Description |
---|---|---|---|
locale | metadata | String | Language code ex. en (English) |
scoring_system | metadata | String | Scoring system for a tournamentstroke , stableford |
status | metadata | String | The status of a tournament ex. inprogress |
tour | metadata | String | Name of tour ex. pga |
tournament | metadata | GUID | Unique ID(s) of a tournament ex. sd:tournament:0d986e18-cc3d-4391-a37c-903e9097129f,sr:stage:721700 |
tournament_type | metadata | String | Type of a tournament ex. stroke |
version | metadata | String | Version of the API ex. v2 |
Player:
Attribute | Parent Element | Type | Description |
---|---|---|---|
abbr_name | leaderboard | String | Abbreviated name of a player ex. R.McIlroy |
amateur | leaderboard | Boolean | Signifies a player is in amateur status when true |
country | leaderboard | String | Country of a player ex. NORTHERN IRELAND |
first_name | leaderboard | String | First name of a player ex. Rory |
id | leaderboard | GUID | Unique player ID ex. da226913-b804-48de-adbf-96e956eb75ac |
last_name | leaderboard | String | Last name of a player ex. McIlroy |
name | leaderboard | String | Name of a player ex. McIlroy, Rory |
points | leaderboard | Float | FedEX points earned for a player in a tournament |
position | leaderboard | Short | Leaderboard position for a player |
money | leaderboard | Float | Tournament money won (in US dollars) for a player |
score | leaderboard | Integer | Overall player score in a tournament or playoff ex. -10 |
status | leaderboard | String | Status of a player for a particular tournamentCUT , WD , MDF , DQ , DNS See our Golf FAQ for more info and definitions of each status |
strokes | leaderboard | Short | Overall player strokes in a tournament or playoff |
sr_id | leaderboard | GUID | Unique Sportradar ID of a player ex. sr:competitor:46702 |
tied | leaderboard | Boolean | Signifies a tie for a leaderboard spot |
Tournament:
Attribute | Parent Element | Type | Description |
---|---|---|---|
coverage | payload | String | Coverage of a tournament. Click *here for a complete breakdown of our tour coverage. ex. full |
currency | payload | String | Prize money currency type of a tournament ex. USD |
end_date | payload | dateTime | End date of a tournament ex. 2022-11-20 |
event_type | payload | dateTime | Scoring type of a tournamentstroke , match , cup , team , mix |
id | payload | GUID | Unique ID of a tournament ex. 42b7bbc2-858a-4c0d-85dc-b30179bb5e9a |
name | payload | String | Name of a tournament ex. Wells Fargo Championship |
parent_id | payload | GUID | Unique parent ID for a tournament. Use this ID to tie reoccurring events across seasons. ex. 5c8d8f92-8da7-4d5d-860b-e820d57ff640 (ID for The Masters) |
points | payload | Integer | Total number of FedEX Cup points for a tournament |
purse | payload | Float | Total prize money for a tournament ex. 15000000.0 |
start_date | payload | dateTime | Start date of a tournament ex. 2022-11-20 |
status | payload | GUID | Status of a tournamentscheduled , inprogress , delayed , cancelled , created , complete , closed , playoff , reopened |
winning_share | payload | Float | Prize money for first place in a tournament ex. 1080000.0 |