NBA G League Push Clock retrieves a game clock feed with high level scoring and possession information.
Syntax
https://api.sportradar.com/nbdl/{access_level}/stream/`{language_code}`/clock/subscribe |
Parameters
Parameter | Description |
---|---|
| Defines the access level of your API key |
| Optional code for supported languages |
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.
Each query string parameter can be added with a preceding ampersand (&
).
Parameter | Description |
---|---|
| Match id |
| Language returned expressed as a 2-letter code |
| Game status |
Code Samples
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/nbdl/trial/stream/en/clock/subscribe")
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)
request["x-api-key"] = "{your_api_key}" # Replace with your actual key
response = http.request(request)
puts response.read_body
import requests
import json
headers = {
'x-api-key': 'your_api_key' # Replace with your actual key
}
r = requests.get(
"https://api.sportradar.com/nbdl/trial/stream/en/clock/subscribe",
headers=headers,
allow_redirects=False
)
redirect_url = r.headers['Location']
r = requests.get(redirect_url, stream=True, headers=headers)
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 -X GET 'https://api.sportradar.com/nbdl/trial/stream/en/clock/subscribe' \
-H 'x-api-key: {your_api_key}'
Samples with Query String Params
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/nbdl/trial/stream/en/clock/subscribe?&status=inprogress&match=sd:match:76b2e680-7da7-461f-95ad-e7c34dbc4c56")
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)
request["x-api-key"] = "{your_api_key}" # Replace with your actual key
response = http.request(request)
puts response.read_body
import requests
import json
headers = {
'x-api-key': 'your_api_key' # Replace with your actual key
}
r = requests.get("https://api.sportradar.com/nbdl/trial/stream/en/clock/subscribe",
params = {'status': 'inprogress', 'match': 'sd:match:76b2e680-7da7-461f-95ad-e7c34dbc4c56'},
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 -X GET 'api.sportradar.com/nbdl/trial/stream/en/clock/subscribe?&status=inprogress&match=sd:match:76b2e680-7da7-461f-95ad-e7c34dbc4c56'
-H 'x-api-key: {your_api_key}'
Response Sample
The above commands return json like this.
Simulations
Check out our Simulations to replay actual games at any time, on your own schedule. Push simulations are available as well.
Data Points
Game:
Attribute | Parent Element | Type | Description |
---|---|---|---|
|
| String | Coverage level of a game |
|
| GUID | Unique ID of a game |
|
| String | League reference ID of a game |
|
| String | The status of a game |
|
| String | Title of a game |
|
| dateTime | Scheduled date and time of a game |
|
| String | Time zone of the away team |
|
| String | Time zone of the home team |
|
| String | Time zone of the venue |
Metadata:
Attribute | Parent Element | Type | Description |
---|---|---|---|
|
| String | Alias of a league |
|
| String | Language code |
|
| GUID | Unique ID of a game |
|
| String | Operation of an update |
|
| String | The status of a game |
|
| String | Version of the API |
Play-by-Play:
Attribute | Parent Element | Type | Description |
---|---|---|---|
bonus | game - away | Boolean | Signifies a team is in the bonus |
points | game - away | Integer | Total points for the away team |
id | game - away | GUID | Unique ID of the away team ex. 67a79348-041a-45f6-bb12-722d38dc8dbf |
market | game - away | String | Market name of the away team ex. Delaware |
name | game - away | String | Away team name ex. Kings |
remaining_timeouts | game - away | Integer | Remaining timeouts for the away team |
bonus | game - home | Boolean | Signifies a team is in the bonus |
points | game - home | Integer | Total points for the home team |
id | game - home | GUID | Unique ID of the home team ex. 67a79348-041a-45f6-bb12-722d38dc8dbf |
market | game - home | String | Market name of the home team ex. Delaware |
name | game - home | String | Home team name ex. Kings |
remaining_timeouts | game - home | Integer | Remaining timeouts for the home team |
Clock:
Attribute | Parent Element | Type | Description |
---|---|---|---|
game_decimal | clocks | String | Clock value in decimal form when the game clock is under 1:00. Otherwise it displays the same value as clock ex. 00:21.70 |
game | clocks | String | Game clock value for an event ex. 1157 |
running | clocks | Boolean | Signifies the game clock was running when a message was sent |
shot | clocks | String | Shot clock value for an event ex. 11.00 |
Quarter:
Attribute | Parent Element | Type | Description |
---|---|---|---|
number | period | Integer | Number of a quarter |
sequence | period | Integer | Sequential number of a quarter |
type | period | GUID | Type of periodREG , OT |