Detailed real-time round scoring including player information, player scoring per hole, and overall tournament scoring per player.
Syntax
https://api.sportradar.com/golf/{access_level}/stream/{golf_tour}/scorecards/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 |
Note
In case of disconnection with the feed, use the RESTful api Scorecards Per Round feed to recover any potentially missed data.
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 |
round | Round sequence number Example: round=2 |
player | Player id Example: sd:player:da226913-b804-48de-adbf-96e956eb75ac |
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/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
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))
curl -L GET "https://api.sportradar.us/golf/trial/stream/pga/scorecards/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/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
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))
curl -L GET 'api.sportradar.us/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'
Response Sample
The above commands return json like this.
Data Points
Metadata:
Attribute | Parent Element | Type | Description |
---|---|---|---|
locale | metadata | String | Language code ex. en (English) |
player | metadata | GUID | Unique ID(s) of a player ex. sd:player:8ed30358-ddd0-4704-8b72-3e711b73a73e,sr:competitor:21213 |
round | metadata | Integer | Round number |
scoring_system | metadata | String | Scoring system of a tournamentstroke , match , cup , team |
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 | player | String | Abbreviated name of a player ex. R.McIlroy |
amateur | player | Boolean | Signifies a player is in amateur status when true |
country | player | String | Country of a player ex. NORTHERN IRELAND |
first_name | player | String | First name of a player ex. Rory |
id | player | GUID | Unique player ID ex. da226913-b804-48de-adbf-96e956eb75ac |
last_name | player | String | Last name of a player ex. McIlroy |
name | player | String | Name of a player ex. McIlroy, Rory |
sr_id | player | GUID | Unique Sportradar ID of a player ex. sr:competitor:46702 |
Round:
Attribute | Parent Element | Type | Description |
---|---|---|---|
id | round | GUID | Unique ID of a round ex. 56983b8a-92e6-40b1-8c53-1b38857d712b |
number | round | GUID | Number of a round |
status | round | GUID | Status of a roundscheduled , inprogress , delayed , suspended , cancelled , complete , closed , reopened |
Scoring:
Attribute | Parent Element | Type | Description |
---|---|---|---|
birdies | player | Integer | Number of birdies in a tournament round |
bogeys | player | Integer | Number of bogeys in a tournament round |
double_bogeys | player | Integer | Number of double bogeys in a tournament round |
eagles | player | Integer | Number of eagles in a tournament round |
thru | player | Integer | Number of holes completed in a tournament round |
holes_in_one | player | Integer | Number of holes in one in a tournament round |
other_scores | player | Integer | Number of other scores in a tournament round (non- pars, birdies, eagles, holes in one, bogeys, double bogeys) |
pars | player | Integer | Number of pars in a tournament round |
score | player | Integer | Player score in a round ex. -4 |
starting_hole | player | Integer | Starting hole of a player within a round ex. 1 or 10 |
strokes | player | Short | Player strokes in a round ex. 68 |
number | scores | Integer | Hole number (1-18) |
par | scores | Integer | Par for a hole ex. 5 |
yardage | scores | Integer | Total yardage of a hole ex. 570 |
strokes | scores | Integer | Number of strokes on a hole for a player |
Tournament:
Attribute | Parent Element | Type | Description |
---|---|---|---|
coverage | tournament | String | Coverage of a tournament. Click *here for a complete breakdown of our tour coverage. ex. full |
event_type | tournament | dateTime | Scoring type of a tournamentstroke , match , cup , team , mix |
points | tournament | Integer | Total number of FedEX Cup points for a tournament |
id | tournament | GUID | Unique ID of a tournament ex. 42b7bbc2-858a-4c0d-85dc-b30179bb5e9a |
name | tournament | String | Name of a tournament ex. Wells Fargo Championship |
parent_id | tournament | 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) |
purse | tournament | Float | Total prize money for a tournament ex. 15000000.0 |
currency | tournament | String | Prize money currency type of a tournament ex. USD |
sr_id | tournament | GUID | Unique Sportradar ID of a tournament ex. sr:stage:721700 |
status | tournament | GUID | Status of a tournamentscheduled , inprogress , delayed , cancelled , created , complete , closed , playoff , reopened |
winning_share | tournament | Float | Prize money for first place in a tournament ex. 1080000.0 |