Docs
Coverage MatrixDocumentationRelease LogLog In

Push Clock

NBA Push Clock Subscribe to real-time NBA game clock updates, providing access to live game timing information.

Syntax

https://api.sportradar.com/nba/{access_level}/stream/{language_code}/clock/subscribe?api_key={your_api_key}

Replace the placeholders with the following path parameters.

ParameterDescription
access_levelDefines the access level of your API key as Production (production), Trial (trial), or Simulation (simulation).
language_codeOptional code for supported languages: en (English) or translations (Any other language translations. See optional query string parameters for locale.)
your_api_keyYour API key.

Optional Query String Parameters

In addition to the URL parameters listed above, you can filter the Clock 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:

ParameterDescription
localeLocale expressed as 2 letter code: locale={language_code}
Example: locale=en
matchMatch id expressed as: sd:match:{match_id}.
Example: match=sd:match:76b2e680-7da7-461f-95ad-e7c34dbc4c56
statusStatus type expressed as: inprogress or created.
Example: status=inprogress

Code Samples

require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.sportradar.com/nba/trial/stream/en/clock/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/nba/trial/stream/en/clock/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/nba/trial/stream/en/clock/subscribe?api_key={your_api_key}'

Samples with Query String Params

require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.sportradar.com/nba/trial/stream/en/clock/subscribe?api_key={your_api_key}&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)

response = http.request(request)
puts response.read_body
import requests
import json

url = "https://api.sportradar.com/nba/trial/stream/en/clock/subscribe"
params = {
    'api_key': 'your_api_key',
    'status': 'inprogress',
    'match': 'sd:match:76b2e680-7da7-461f-95ad-e7c34dbc4c56'
}

r = requests.get(url, params=params, 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.com/nba/trial/stream/en/clock/subscribe?api_key={your_api_key}&status=inprogress&match=sd:match:76b2e680-7da7-461f-95ad-e7c34dbc4c56'

Response Samples

The above commands return json like this.

Reference the below samples.



Data Points

Game:
AttributeParent ElementTypeDescription
coveragegameStringCoverage level of a game
full, extended_boxscore
idgameGUIDUnique ID of a game
ex. 1f730a9a-8221-48ff-a259-ac2103fb58b0
referencegameStringLeague reference ID of a game
ex. 1610612758
sr_idgameGUIDUnique Sportradar ID of a game
ex. sr:match:35431817
statusgameStringThe status of a game
scheduled, created, inprogress, halftime, complete, closed, cancelled, delayed, postponed, time-tbd, if-necessary, unnecessary

Please see our FAQ section for a list of game status definitions
titlegameStringTitle of a game
ex. Game 3
scheduledgamedateTimeScheduled date and time of a game
ex. 2022-09-25T20:10:00+00:00
awaygame - time_zonesStringTime zone of the away team
ex. US/Pacific
homegame - time_zonesStringTime zone of the home team
ex. US/Eastern
venuegame - time_zonesStringTime zone of the venue
ex. US/Eastern
Metadata:
AttributeParent ElementTypeDescription
leaguemetadataStringAlias of a league
ex. NBA
localemetadataStringLanguage code
ex. en (English)
matchmetadataGUIDUnique ID of a game
ex. sd:match:d8539eb6-3e27-40c8-906f-9cd1736321d8
operationmetadataStringOperation of an update
update, delete
statusmetadataStringThe status of a game
scheduled, created, inprogress, halftime, complete, closed, cancelled, delayed, postponed, time-tbd, if-necessary, unnecessary

Please see our FAQ section for a list of game status definitions
versionmetadataStringVersion of the API
ex. v7
Play-by-Play:
AttributeParent ElementTypeDescription
bonusgame - awayBooleanSignifies a team is in the bonus
pointsgame - awayIntegerTotal points for the away team
idgame - awayGUIDUnique ID of the away team
ex. 583ed0ac-fb46-11e1-82cb-f4ce4684ea4c
marketgame - awayStringMarket name of the away team
ex. Sacramento
namegame - awayStringAway team name
ex. Kings
referencegame - awayStringLeague reference ID of the away team
ex. 1610612750
remaining_timeoutsgame - awayIntegerRemaining timeouts for the away team
sr_idgame - awayGUIDUnique Sportradar ID of the away team
ex. sr:team:3415
bonusgame - homeBooleanSignifies a team is in the bonus
pointsgame - homeIntegerTotal points for the home team
idgame - homeGUIDUnique ID of the home team
ex. 583ed0ac-fb46-11e1-82cb-f4ce4684ea4c
marketgame - homeStringMarket name of the home team
ex. Sacramento
namegame - homeStringHome team name
ex. Kings
referencegame - homeStringLeague reference ID of the home team
ex. 1610612750
remaining_timeoutsgame - homeIntegerRemaining timeouts for the home team
sr_idgame - homeGUIDUnique Sportradar ID of the home team
ex. sr:team:3415
Clock:
AttributeParent ElementTypeDescription
game_decimalclocksStringClock value in decimal form when the game clock is under 1:00. Otherwise it displays the same value as clock
ex. 00:21.70
gameclocksStringGame clock value for an event
ex. 1157
runningclocksBooleanSignifies the game clock was running when a message was sent
shotclocksStringShot clock value for an event
ex. 11.00
Quarter:
AttributeParent ElementTypeDescription
numberperiodIntegerNumber of a quarter
sequenceperiodIntegerSequential number of a quarter
typeperiodGUIDType of period
REG, OT