## Golf API Overview
Sportradar’s Golf API offers a comprehensive suite of real-time tournament updates, rankings, and seasonal statistics to power your golf experiences.
We provide full hole-by-hole coverage for the PGA Tour, Euro Tour, LPGA Tour, Champions Tour, Korn Ferry, Olympics, Ryder Cup, and President's Cup. All Majors and World Golf Championships are covered. For further coverage info, click here.
Primary feeds will return schedules, tournament leaderboards, tee times, and hole-by-hole scoring.
Additional feeds provide a host of complementary stats, including:
Player profiles
Seasonal statistics
World golf ranking for the top 200 players
Detailed course information
Real-time customers are also offered two delivery Push Feeds to enhance speed.
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:
>
Call the Tournament Schedule and find the Tournament Id for the chosen tournament
Call the Tee Times Per Round using the Tournament Id and a chosen round number
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.
TTL / Cache:
2 seconds
Update Frequency:
As Necessary
Content Type:
XML or JSON
Match & Tee Time Information:
Match Format
Match Tee Time
Match Title
Round & Tee Time Information:
Pairing Id Pairing Sequence Pairing Starting Point
Pairing Tee Time Round Id
Round Number Round Status
Player Information:
Player Id
Player Name
Tour & Season Information:
Season Id Season Year
Tour Alias Tour Id
Tour Name
Tournament Information:
Course Timezone Event Type
Tournament Id Tournament Name
Purse Currency
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.us/golf/trial/pga/v3/en/2021/02/05/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/trial/pga/v3/en/2021/02/05/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/trial/pga/v3/en/2021/02/05/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.us/golf/`{access_level}`/`{golf_tour}`/`{version}`/`{language_code}`/`{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). |
| `golf_tour` | pga, lpga, champ, pgad, euro, oly, or liv. |
| `version` | Version number of the API you are accessing (Current Version: v3). |
| `language_code` | 2 letter code for supported languages: en (English), ru (Russian), zh (simplified Chinese), de (German), fr (French), it (Italian), es (Spanish), ja (Japanese), nl (Dutch), se (Swedish), no (Norwegian), fi (Finnish), ko (Korean), da (Danish). |
| `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, use the following URL.
https://feed.elasticstats.com/schema/golf/changelog-v1.0.xsd
Return to top
## Official World Golf Ranking
Provides Official World Golf Rankings and points for top the 200 players.
TTL / Cache:
120 seconds
Update Frequency:
As Necessary
Content Type:
XML or JSON
Player Information:
Abbreviated Name Country Representing First Name
Player Id Last Name Prior Rank
Rank Tied
Player Statistics:
Average Points Events Played
Fed Ex / OWGR Points Points Gained
Points Lost
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.us/golf/trial/v3/en/players/wgr/2021/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/trial/v3/en/players/wgr/2021/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.us/golf/trial/v3/en/players/wgr/2021/rankings.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
Access the Official World of Gold Ranking feed by replacing the parameters in the following URL:
https://api.sportradar.us/golf/`{access_level}`/`{version}`/`{language_code}`/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: v3). |
| `language_code` | 2 letter code for supported languages: en (English), ru (Russian), zh (simplified Chinese), de (German), fr (French), it (Italian), es (Spanish), ja (Japanese), nl (Dutch), se (Swedish), no (Norwegian), fi (Finnish), ko (Korean), da (Danish). |
| `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-v3.0.xsd
Return to top
## Player Profile
Provides biographical information and historical tournament statistics for a given player.
TTL / Cache:
120 seconds
Update Frequency:
As Necessary
Content Type:
XML or JSON
Leaderboard & Summary Information:
Leaderboard Position Money Won Overall Score Playoff Score Playoff Strokes Points Earned Round - Birdies Round - Bogeys
Round - Double Bogeys Round - Eagles Round - Holes Completed Round - Holes in One Round - Pars Round Number Round - Score Round - Strokes
Total Strokes Tournament - Money Earned Tournament - Points Earned Tournament - Position Tournament - Tied
Player Information:
Abbreviated Name Birthday Birthplace College Country
First Name Handedness Height Id Last Name
Name Residence Weight Year Turned Pro
Player Statistics:
All Around Ranking Average Drive Distance Birdies Per Round Cuts Made Cuts Missed Drive Accuracy Percentage Earnings Rank Events Played Fed Ex Points Rank Fed Ex / OWGR Points First Place Finishes
Greens in Regulation Percentage Holes Per Eagle Proximity to Hole Average Putting Average Sand Save Percentage Scoring Average Scrambling Percentage Season Earnings Second Place Finishes
Strokes Gained Putting Strokes Gained Tee to Green Strokes Gained Total Third Place Finishes Top 10 Finishes Top 25 Finishes Total Driving Withdrawals World Ranking
Tour & Season Information:
Season Id Season Year
Tour Alias Tour Id
Tour Name
Tournament Information:
Broadcast Network Course Timezone Coverage End Date Event Type
Points Id Name Purse Purse Currency
Scoring System Start Date Status Winners Share
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.us/golf/trial/v3/en/players/ce5a1cd5-bf8c-4f0d-9903-844ec3aa7e10/profile.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/trial/v3/en/players/ce5a1cd5-bf8c-4f0d-9903-844ec3aa7e10/profile.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/trial/v3/en/players/ce5a1cd5-bf8c-4f0d-9903-844ec3aa7e10/profile.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.us/golf/`{access_level}`/`{version}`/`{language_code}`/players/`{player_id}`/profile.`{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: v3). |
| `language_code` | 2 letter code for supported languages: en (English), ru (Russian), zh (simplified Chinese), de (German), fr (French), it (Italian), es (Spanish), ja (Japanese), nl (Dutch), se (Swedish), no (Norwegian), fi (Finnish), ko (Korean), da (Danish). |
| `player_id` | ID for a given player. |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
To retrieve the XML Schema Definition (.XSD) for the Player Profile, use the following URL.
https://feed.elasticstats.com/schema/golf/player/profile-v3.0.xsd
Return to top
## Player Profile Live
Provides biographical information and tournament statistics for currently live tournaments for a given player.
TTL / Cache:
120 seconds
Update Frequency:
As Necessary
Content Type:
XML or JSON
Leaderboard & Summary Information:
Leaderboard Position Money Won Overall Score Playoff Score Playoff Strokes Points Earned Round - Birdies Round - Bogeys
Round - Double Bogeys Round - Eagles Round - Holes Completed Round - Holes in One Round - Pars Round Number Round - Score Round - Strokes
Total Strokes Tournament - Money Earned Tournament - Points Earned Tournament - Position Tournament - Tied
Player Information:
Abbreviated Name Birthday Birthplace College Country
First Name Handedness Height Id Last Name
Name Residence Weight Year Turned Pro
Player Statistics:
All Around Ranking Average Drive Distance Birdies Per Round Cuts Made Cuts Missed Drive Accuracy Percentage Earnings Rank Events Played Fed Ex Points Rank Fed Ex / OWGR Points First Place Finishes
Greens in Regulation Percentage Holes Per Eagle Proximity to Hole Average Putting Average Sand Save Percentage Scoring Average Scrambling Percentage Season Earnings Second Place Finishes
Strokes Gained Putting Strokes Gained Tee to Green Strokes Gained Total Third Place Finishes Top 10 Finishes Top 25 Finishes Total Driving Withdrawals World Ranking
Tour & Season Information:
Season Id Season Year
Tour Alias Tour Id
Tour Name
Tournament Information:
Broadcast Network Course Timezone Coverage End Date Event Type
Points Id Name Purse Purse Currency
Scoring System Start Date Status Winners Share
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.us/golf/trial/v3/en/players/ce5a1cd5-bf8c-4f0d-9903-844ec3aa7e10/live.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/trial/v3/en/players/ce5a1cd5-bf8c-4f0d-9903-844ec3aa7e10/live.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/trial/v3/en/players/ce5a1cd5-bf8c-4f0d-9903-844ec3aa7e10/live.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
Access the Player Profile Live feed by replacing the parameters in the following URL:
https://api.sportradar.us/golf/`{access_level}`/`{version}`/`{language_code}`/players/`{player_id}`/live.`{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: v3). |
| `language_code` | 2 letter code for supported languages: en (English), ru (Russian), zh (simplified Chinese), de (German), fr (French), it (Italian), es (Spanish), ja (Japanese), nl (Dutch), se (Swedish), no (Norwegian), fi (Finnish), ko (Korean), da (Danish). |
| `player_id` | ID for a given player. |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
To retrieve the XML Schema Definition (.XSD) for the Player Profile Live, use the following URL.
https://feed.elasticstats.com/schema/golf/player/live-v3.0.xsd
Return to top
## Player Statistics
Season statistics for all golfers who have earned Fed Ex Cup points in a given year. Season statistics are validated and adjusted on a weekly basis.
TTL / Cache:
120 seconds
Update Frequency:
As Necessary
Content Type:
XML or JSON
Player Information:
Abbreviated Name Country Representing
First Name Player Id
Last Name
Player Statistics:
All Around Ranking Average Drive Distance Birdies Per Round Cuts Made Cuts Missed Drive Accuracy Percentage Earnings Rank Events Played Fed Ex Points Rank Fed Ex / OWGR Points First Place Finishes
Greens in Regulation Percentage Holes Per Eagle Proximity to Hole Average Putting Average Sand Save Percentage Scoring Average Scrambling Percentage Season Earnings Second Place Finishes
Strokes Gained Putting Strokes Gained Tee to Green Strokes Gained Total Third Place Finishes Top 10 Finishes Top 25 Finishes Total Driving Withdrawals World Ranking
Tour & Season Information:
Tour Alias Tour Currency
Tour Id
Tour Name
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.us/golf/trial/pga/v3/en/2021/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/trial/pga/v3/en/2021/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/trial/pga/v3/en/2021/players/statistics.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
Access the Player Statistics feed by replacing the parameters in the following URL:
https://api.sportradar.us/golf/`{access_level}`/`{golf_tour}`/`{version}`/`{language_code}`/`{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). |
| `golf_tour` | pga. |
| `version` | Version number of the API you are accessing (Current Version: v3). |
| `language_code` | 2 letter code for supported languages: en (English), ru (Russian), zh (simplified Chinese), de (German), fr (French), it (Italian), es (Spanish), ja (Japanese), nl (Dutch), se (Swedish), no (Norwegian), fi (Finnish), ko (Korean), da (Danish). |
| `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, use the following URL.
https://feed.elasticstats.com/schema/golf/season/statistics-v3.0.xsd
Return to top
## Players
Provides player biographical information for a given year and tour, for all players. This includes height, weight, place of birth, date of birth, residence, and college.
TTL / Cache:
120 seconds
Update Frequency:
As Necessary
Content Type:
XML or JSON
Player Information:
Abbreviated Name Birthday Birthplace College Country Representing
First Name Gender Handedness Height Id
Last Name Residence Weight Year Turned Pro
Tour & Season Information:
Season Id Season Year
Tour Alias Tour Currency
Tour Id Name
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.us/golf/trial/pga/v3/en/2021/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/trial/pga/v3/en/2021/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/trial/pga/v3/en/2021/players/profiles.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
Access the Players feed by replacing the parameters in the following URL:
https://api.sportradar.us/golf/`{access_level}`/`{golf_tour}`/`{version}`/`{language_code}`/`{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). |
| `golf_tour` | pga, lpga, champ, pgad, euro, oly, or liv. |
| `version` | Version number of the API you are accessing (Current Version: v3). |
| `language_code` | 2 letter code for supported languages: en (English), ru (Russian), zh (simplified Chinese), de (German), fr (French), it (Italian), es (Spanish), ja (Japanese), nl (Dutch), se (Swedish), no (Norwegian), fi (Finnish), ko (Korean), da (Danish). |
| `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 Players, use the following URL.
https://feed.elasticstats.com/schema/golf/season/participant-v3.0.xsd
Return to top
## Scorecards Per Round
Detailed round scoring including player information, course information, player scoring per hole, and overall tournament scoring per player.
Update Frequency:
Realtime
TTL / Cache:
Live - 2s Non-Live - 120s
Note: This endpoint will update to a 2s TTL (time to live) upon a game moving to inprogress. Upon closed, it will transfer to 120s.
Content Type:
XML or JSON
Course Information:
Hole Number Hole Yardage
Id Name Par Score (Course)
Par Score (Hole) Total Yardage
Match & Tee Time Information:
Format Id
Sequence Status
Title Type
Player Information:
Abbreviated Name Country Representing First Name
Id Last Name Name
Team Id Team Name Tournament Seed
Round & Tee Time Information:
Round Id
Round Number
Round Status
Scoring Per Round:
Birdies Bogeys Double Bogeys Eagles Hole Number Hole Outcome Hole Sequence Holes Completed Holes in One Holes Not Played Match Score
Other Scores Par Score Pars Player Sequence Score Starting Hole Strokes Team Birdies Team Bogeys Team Double Bogeys Team Eagles
Team Holes in One Team Other Scores Team Pars Team Score Team Status Team Strokes Team Thru Total Strokes Yardage
Tournament Information:
Course Timezone Coverage End Date Event Type
Points Id Name Purse Purse Currency
Scoring System Start Date Status Winners Share
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.us/golf/trial/pga/v3/en/2020/tournaments/6ba4893c-c82e-4269-a0ab-c99a05c854a8/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/trial/pga/v3/en/2020/tournaments/6ba4893c-c82e-4269-a0ab-c99a05c854a8/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/trial/pga/v3/en/2020/tournaments/6ba4893c-c82e-4269-a0ab-c99a05c854a8/rounds/1/scores.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
Access the Scorecards Per Round feed by replacing the parameters in the following URL:
https://api.sportradar.us/golf/`{access_level}`/`{golf_tour}`/`{version}`/`{language_code}`/`{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). |
| `golf_tour` | pga, lpga, champ, pgad, euro, oly, or liv. |
| `version` | Version number of the API you are accessing (Current Version: v3). |
| `language_code` | 2 letter code for supported languages: en (English), ru (Russian), zh (simplified Chinese), de (German), fr (French), it (Italian), es (Spanish), ja (Japanese), nl (Dutch), se (Swedish), no (Norwegian), fi (Finnish), ko (Korean), da (Danish). |
| `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, use the following URL.
https://feed.elasticstats.com/schema/golf/tournament/scorecard-v3.0.xsd
Return to top
## Seasons
Provides a list of all available seasons for every tour.
TTL / Cache:
2 seconds
Update Frequency:
As Necessary
Content Type:
XML or JSON
Tour & Season Information:
Season Id Season Start Date Season Status
Season Year Tour Alias
Tour Id Tour Name
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.us/golf/trial/v3/en/seasons.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/trial/v3/en/seasons.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/trial/v3/en/seasons.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
Access the Seasons feed by replacing the parameters in the following URL:
https://api.sportradar.us/golf/`{access_level}`/`{version}`/`{language_code}`/seasons.`{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: v3). |
| `language_code` | 2 letter code for supported languages: en (English), ru (Russian), zh (simplified Chinese), de (German), fr (French), it (Italian), es (Spanish), ja (Japanese), nl (Dutch), se (Swedish), no (Norwegian), fi (Finnish), ko (Korean), da (Danish). |
| `format` | xml or json. |
| `your_api_key` | Your API key. |
To retrieve the XML Schema Definition (.XSD) for the Seasons, use the following URL.
https://feed.elasticstats.com/schema/golf/seasons-v3.0.xsd
Return to top
## Tee Times Per Round
Provides tee times for a given round, including pairings and starting positions.
Update Frequency:
Realtime
TTL / Cache:
Live - 2s Non-Live - 120s
Note: This endpoint will update to a 2s TTL (time to live) upon a game moving to inprogress. Upon closed, it will transfer to 120s.
Content Type:
XML or JSON
Course Information:
Course Id Course Name
Par Score (Course)
Total Yardage
Match Information:
Format Id Player Sequence
Sequence Starting Point Status
Tee Time Title Type
Round & Tee Time Information:
Starting Point Round Id
Round Number
Tee Time
Player Information:
Abbreviated Name Country Representing First Name
Player Id Last Name Name
Team Id Team Name Tournament Seed
Tournament Information:
Bracket Id Bracket Name Course Timezone Coverage End Date
Event Type Points Id Name Purse
Purse Currency Scoring System Start Date Status Winners Share
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.us/golf/trial/pga/v3/en/2020/tournaments/6ba4893c-c82e-4269-a0ab-c99a05c854a8/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/trial/pga/v3/en/2020/tournaments/6ba4893c-c82e-4269-a0ab-c99a05c854a8/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/trial/pga/v3/en/2020/tournaments/6ba4893c-c82e-4269-a0ab-c99a05c854a8/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.us/golf/`{access_level}`/`{golf_tour}`/`{version}`/`{language_code}`/`{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). |
| `golf_tour` | pga, lpga, champ, pgad, euro, oly, or liv. |
| `version` | Version number of the API you are accessing (Current Version: v3). |
| `language_code` | 2 letter code for supported languages: en (English), ru (Russian), zh (simplified Chinese), de (German), fr (French), it (Italian), es (Spanish), ja (Japanese), nl (Dutch), se (Swedish), no (Norwegian), fi (Finnish), ko (Korean), da (Danish). |
| `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, use the following URL.
https://feed.elasticstats.com/schema/golf/tournament/teetime-v3.0.xsd
Return to top
## Tournament Hole Statistics
Detailed information on how the field fared on each hole for a given tournament.
Update Frequency:
Realtime
TTL / Cache:
Live - 2s Non-Live - 120s
Note: This endpoint will update to a 2s TTL (time to live) upon a game moving to inprogress. Upon closed, it will transfer to 120s.
Content Type:
XML or JSON
Course Information:
Course Id Course Name
Par Score (Course)
Total Yardage
Tournament Hole Statistics:
Average Difference Birdies Bogeys Double Bogeys Eagles
Hole Number Holes in One Number of Players Other Scores
Par Scores Pars Sequence Strokes Strokes Average
Player Information:
Abbreviated Name
Round & Tee Time Information:
Round Id
Round Number
Round Status
Tournament Information:
Course Timezone Coverage End Date Event Type
Points Id Name Purse Purse Currency
Scoring System Start Date Status Winners Share
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.us/golf/trial/pga/v3/en/2020/tournaments/6ba4893c-c82e-4269-a0ab-c99a05c854a8/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/trial/pga/v3/en/2020/tournaments/6ba4893c-c82e-4269-a0ab-c99a05c854a8/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/trial/pga/v3/en/2020/tournaments/6ba4893c-c82e-4269-a0ab-c99a05c854a8/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.us/golf/`{access_level}`/`{golf_tour}`/`{version}`/`{language_code}`/`{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). |
| `golf_tour` | pga, lpga, champ, pgad, euro, oly, or liv. |
| `version` | Version number of the API you are accessing (Current Version: v3). |
| `language_code` | 2 letter code for supported languages: en (English), ru (Russian), zh (simplified Chinese), de (German), fr (French), it (Italian), es (Spanish), ja (Japanese), nl (Dutch), se (Swedish), no (Norwegian), fi (Finnish), ko (Korean), da (Danish). |
| `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, use the following URL.
https://feed.elasticstats.com/schema/golf/tournament/statistics-v1.0.xsd
Return to top
## Tournament Leaderboard
Provides a real-time leaderboard position for a given tournament, including player statistics at tournament and per-round level.
Update Frequency:
Realtime
TTL / Cache:
Live - 2s Non-Live - 120s
Note: This endpoint will update to a 2s TTL (time to live) upon a game moving to inprogress. Upon closed, it will transfer to 120s.
Content Type:
XML or JSON
Leaderboard & Summary Information:
Leaderboard Position Match - Birdies Match - Bogeys Match - Double Bogeys Match - Eagles Match - Holes Not Played Match - Other Scores Match - Pars Match - Score Match - Thru Money Won Overall Score Part Part Status
Round - Double Bogeys Round - Eagles Round - Holes Completed Round - Holes in One Round - Other Scores Round - Pars Round Number Round - Score Round - Strokes Part Type Playoff Score Playoff Strokes Points Earned Round - Birdies
Round - Bogeys Starting Score Team - Money Team - Points Team - Position Total Strokes Tournament - Losses Tournament - Money Earned Tournament - Points Earned Tournament - Position Tournament - Tied Tournament - Wins
Match & Tee Time Information:
Match Id Sequence
Status Title
Type
Player Information:
Abbreviated Name Country Representing
First Name Id Last Name
Team Id Team Name
Scoring Per Round:
Team Score
Team Status
Team Strokes
Tournament Information:
Course Timezone Coverage Cut Round Cutline End Date Event Type
Points Projected Cutline Id Name Purse Purse Currency
Scoring System Start Date Status Winners Share
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.us/golf/trial/pga/v3/en/2020/tournaments/6ba4893c-c82e-4269-a0ab-c99a05c854a8/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/trial/pga/v3/en/2020/tournaments/6ba4893c-c82e-4269-a0ab-c99a05c854a8/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/trial/pga/v3/en/2020/tournaments/6ba4893c-c82e-4269-a0ab-c99a05c854a8/leaderboard.xml?api_key={your_api_key}"
```
> The above command returns xml structured like this.
Access the Tournament Leaderboard feed by replacing the parameters in the following URL:
https://api.sportradar.us/golf/`{access_level}`/`{golf_tour}`/`{version}`/`{language_code}`/`{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). |
| `golf_tour` | pga, lpga, champ, pgad, euro, oly, or liv. |
| `version` | Version number of the API you are accessing (Current Version: v3). |
| `language_code` | 2 letter code for supported languages: en (English), ru (Russian), zh (simplified Chinese), de (German), fr (French), it (Italian), es (Spanish), ja (Japanese), nl (Dutch), se (Swedish), no (Norwegian), fi (Finnish), ko (Korean), da (Danish). |
| `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, use the following URL.
https://feed.elasticstats.com/schema/golf/tournament/leaderboard-v3.0.xsd
Return to top
## Tournament Schedule
Schedule of tournaments for a given season including date, location, course layouts, and tournament purse.
TTL / Cache:
10 seconds
Update Frequency:
As Necessary
Content Type:
XML or JSON
Course Information:
Hole Number Hole Yardage Id
Name Par Score (Course)
Par Score (Hole) Total Yardage
Player Information (Defending Champ & Winner):
Abbreviated Name Birthday Birthplace College
Country Representing First Name Height Id
Last Name Residence Weight Year Turned Pro
Tour & Season Information:
Season Id Season Year
Tour Alias Tour Id
Tour Name
Tournament Information:
Course Timezone Coverage Cut Round End Date Event Type
Points Id Name Purse Purse Currency
Scoring System Start Date Status Winners Share
Venue Information:
City Country
Id Name
State Zip Code
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.us/golf/trial/pga/v3/en/2021/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/trial/pga/v3/en/2021/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/trial/pga/v3/en/2021/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.us/golf/`{access_level}`/`{golf_tour}`/`{version}`/`{language_code}`/`{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). |
| `golf_tour` | pga, lpga, champ, pgad, euro, oly, or liv. |
| `version` | Version number of the API you are accessing (Current Version: v3). |
| `language_code` | 2 letter code for supported languages: en (English), ru (Russian), zh (simplified Chinese), de (German), fr (French), it (Italian), es (Spanish), ja (Japanese), nl (Dutch), se (Swedish), no (Norwegian), fi (Finnish), ko (Korean), da (Danish). |
| `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, use the following URL.
https://feed.elasticstats.com/schema/golf/schedule-v3.0.xsd
Return to top
## Tournament Summary
Provides information for a given tournament by year, including location, course layout and tournament field.
Update Frequency:
Realtime
TTL / Cache:
Live - 2s Non-Live - 120s
Note: This endpoint will update to a 2s TTL (time to live) upon a game moving to inprogress. Upon closed, it will transfer to 120s.
Content Type:
XML or JSON
Course Information:
Hole Number Hole Yardage Id
Name Par Score (Course)
Par Score (Hole) Total Yardage
Player Information:
Abbreviated Name Country Representing
First Name Id Last Name
Team Id Team Name Tournament Seed
Round & Tee Time Information:
Round Id
Round Number
Round Status
Tournament Information:
Bracket Id Bracket Name Broadcast - Cable Broadcast - End At Broadcast - Internet Broadcast - Network Broadcast - Radio Broadcast - Satellite Broadcast - Start At
Course Timezone Coverage Cut Round Cutline End Date Event Type Points Id Name Projected Cutline Purse Purse Currency
Scoring System Start Date Status Summary Part Summary Status Summary Type Temperature Total Rounds Weather Condition Wind Direction Wind Speed Winners Share
Venue Information:
City Country
Id Name
State Zip Code
```ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.us/golf/trial/pga/v3/en/2020/tournaments/6ba4893c-c82e-4269-a0ab-c99a05c854a8/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/trial/pga/v3/en/2020/tournaments/6ba4893c-c82e-4269-a0ab-c99a05c854a8/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/trial/pga/v3/en/2020/tournaments/6ba4893c-c82e-4269-a0ab-c99a05c854a8/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.us/golf/`{access_level}`/`{golf_tour}`/`{version}`/`{language_code}`/`{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). |
| `golf_tour` | pga, lpga, champ, pgad, euro, oly, or liv. |
| `version` | Version number of the API you are accessing (Current Version: v3). |
| `language_code` | 2 letter code for supported languages: en (English), ru (Russian), zh (simplified Chinese), de (German), fr (French), it (Italian), es (Spanish), ja (Japanese), nl (Dutch), se (Swedish), no (Norwegian), fi (Finnish), ko (Korean), da (Danish). |
| `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, use the following URL.
https://feed.elasticstats.com/schema/golf/tournament-v3.0.xsd
Return to top
## 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.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
```
```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.us/golf/trial/stream/pga/leaderboards/subscribe?api_key={your_api_key}'
```
> The above command returns json like this.
Access the Leaderboard feed by replacing the parameters in the following URL:
https://api.sportradar.us/golf/`{access_level}`/stream/`{golf_tour}`/leaderboards/subscribe?api_key=`{your_api_key}`
| Parameter | Description |
| --------- | ----------- |
| `access_level` | Defines the access level of your API key as Production (production) or Trial (trial). |
| `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.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
```
```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.us/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 |
| `locale` | Locale expressed as 2 letter code: locale={language_code} Example: locale=en Valid codes: en (English), ru (Russian), zh (simplified Chinese), de (German), fr (French), it (Italian), es (Spanish), ja (Japanese), nl (Dutch), se (Swedish), no (Norwegian), fi (Finnish), ko (Korean), da (Danish). |
Return to top
## 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.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
```
```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.us/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.
https://api.sportradar.us/golf/`{access_level}`/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 (production) or Trial (trial). |
| `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.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
```
```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.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'
```
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 |
| `locale` | Locale expressed as 2 letter code: locale={language_code} Example: locale=en Valid codes: en (English), ru (Russian), zh (simplified Chinese), de (German), fr (French), it (Italian), es (Spanish), ja (Japanese), nl (Dutch), se (Swedish), no (Norwegian), fi (Finnish), ko (Korean), da (Danish). |
Return to top
## 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.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 Tour 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 Tour 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 Tour Championship, the top 30 player’s points will reflect the reset value plus points earned in the Tour 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.
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:
Q: What are the possible values for season status?
A: The supported season statuses are:
scheduled
inprogress
closed
Q: How do I locate the TTL (Time to Live)/cache on an API endpoint?
A: The cache (in seconds) can be accessed in the returned header information on each RESTful API call, under cache-control.
ex. cache-control: max-age=1, public, s-maxage=1 or cache-control: public, must-revalidate, max-age=120
Note that, for select game-centric endpoints, the TTL may adjust when an event is live. This information is available for each endpoint on our developer portal.