Integration GuidesReference Docs
Coverage MatrixDocumentationChange LogLog InContact Us
Reference Docs

Push Statistics

This endpoint retrieves real-time team and player game-level statistics for all live games.

Syntax

https://api.sportradar.com/basketball/{access_level}/stream/statistics/subscribe?api_key={your_api_key}

Parameters

ParameterDescription
access_levelDefines the access level of your API key

production, trial
your_api_keyYour 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.

URL ParametersDescription
channelChannel type

Example: channel=basketball
competition_idCompetition id

Example: competition_id=sr:competition:27230
event_idEvent type

Example: event_id=score_change
formatFormat type

Example: format=json
season_idSeason id

Example: season_id=sr:season:59654
sport_event_idSport event id

Example: sport_event_id=sr:sport_event:17582523
sport_idSport id

Example: sport_id=sr:sport:22


Code Samples

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

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

Samples with Query String Params

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

url = URI("https://api.sportradar.com/basketball/trial/stream/statistics/subscribe?api_key={your_api_key}&format=json&sport_event_id=sr:sport_event_id:17582523")

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/basketball/trial/stream/statistics/subscribe",
    params = {'api_key': 'your_api_key', 'format': 'json', 'sport_event_id': 'sr:sport_event_id:17582523'},
    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.com/basketball/trial/stream/statistics/subscribe?api_key={your_api_key}&format=json&sport_event_id=sr:sport_event_id:17582523'


Response Sample

The above commands return json like this.



Data Points

Metadata:
AttributeParent ElementTypeDescription
channelmetadataStringSport of the stream connection
ex. basketball
competition_idmetadataStringUnique Id of a competition
ex. sr:competition:19980
event_idmetadataStringDescription of a push statistic event. Reference enum_event_type in our Global Basketball OpenAPI Spec for a complete list of event types
ex. match_started, turnover, won_jump_ball
formatmetadataStringFormat type of the response
json, xml
season_idmetadataStringUnique Id of a season
ex. sr:season:106289
sport_event_idmetadataStringUnique Id of a sport event
ex. sr:sport_event_id:49324739
sport_idmetadataStringUnique Id of a sport
ex. sr:sport:1
fromheartbeatIntegerUnix timestamp of the beginning of a heartbeat message
ex. 1713804799
toheartbeatIntegerUnix timestamp of the end of a heartbeat message
ex. 1713804804
intervalheartbeatIntegerInterval of a heartbeat message in seconds
typeheartbeatStringType of heartbeat message
ex. events, statistics
packageheartbeatStringPackage of a heartbeat message
ex. basketball-v2
Sport Event Status:
AttributeParent ElementTypeDescription
away_normaltime_scoresport_event_statusIntegerScore for the away team in normal time
away_scoresport_event_statusIntegerTotal score for the away team in the game
home_normaltime_scoresport_event_statusIntegerScore for the home team in normal time
home_scoresport_event_statusIntegerTotal score for the home team in the game
match_statussport_event_statusStringStatus within a game (sport event). Provides more detail on the state of a sport event when live than status
ex. not_started, 1st_quarter, ended, cancelled

See our FAQ for a complete list of statuses and their definitions.
scount_abandonedsport_event_statusBooleanSignifies a game was abandoned by a scout when true
statussport_event_statusStringStatus of a game
ex. not_started, 2nd_half, ended, awaiting_penalties

See our FAQ for a complete list of statuses and their definitions.
winner_idsport_event_statusStringUnique ID of the game winner
ex. sr:competitor:44
Sport Event Situation:
AttributeParent ElementTypeDescription
playedsport_event_status - clockStringGame time played in a quarter/period, in minutes
ex. 00:36
remainingsport_event_status - clockStringTime remaining in a quarter/period, in minutes
ex. 9:21
away_scoresport_event_status - period_scoresIntegerAway team period score
home_scoresport_event_status - period_scoresIntegerHome team period score
numbersport_event_status - period_scoresIntegerPeriod number
typesport_event_status - period_scoresStringPeriod type
regular_period, overtime, 1st_quarter, 2nd_quarter, 3rd_quarter, 4th_quarter, 1st_half, 2nd_half, penalties, 1st_pause, 2nd_pause, 3rd_pause, awaiting_extra, awaiting_penalties, interrupted, 1st_extra, 2nd_extra
Player:
AttributeParent ElementTypeDescription
idstatistics - competitor - playersStringUnique ID of a player
ex. sr:player:608026
namestatistics - competitor - playersStringName of a player
ex. Tavares, Edy
Competitor:
AttributeParent ElementTypeDescription
abbreviationstatistics - competitorsStringAbbreviation for a competitor name
ex. RMA (Real Madrid)
age_groupstatistics - competitorsStringAge group of a competitor, when applicable
ex. U23
countrystatistics - competitorsStringCountry of a competitor
ex. Spain
country_codestatistics - competitorsStringCountry code of a competitor
ex. ESP (Spain)
divisionstatistics - competitorsIntegerDivision number for a competitor
genderstatistics - competitorsStringGender for a competitor
male, female
idstatistics - competitorsStringUnique ID for a competitor
ex. sr:competitor:3540 (Real Madrid)
namestatistics - competitorsStringName for a competitor
ex. Real Madrid
qualifierstatistics - competitorsStringDesignation of a competitor for a sport event
home, away
statestatistics - competitorsStringState of a competitor
ex. TX (Texas)
Game Stats (Team):
AttributeParent ElementTypeDescription
assistscompetitors - statisticsIntegerNumber of assists for a team in a game
ball_possessioncompetitors - statisticsIntegerPercentage of team ball possession for a game
biggest_leadcompetitors - statisticsIntegerBiggest lead in points for a team in a game
defensive_reboundscompetitors - statisticsIntegerNumber of defensive rebounds for a team in a game
foulscompetitors - statisticsIntegerNumber of fouls for a team in a game
free_throw_attempts_successfulcompetitors - statisticsIntegerNumber of free throws for a team in a game
free_throw_attempts_totalcompetitors - statisticsIntegerNumber of free throw attempts for a team in a game
offensive_reboundscompetitors - statisticsIntegerNumber of offensive rebounds for a team in a game
reboundscompetitors - statisticsIntegerNumber of total rebounds (offense + defense) for a team in a game
shots_blockedcompetitors - statisticsIntegerNumber of shots blocked for a team in a game
stealscompetitors - statisticsIntegerNumber of steals for a team in a game
team_leadscompetitors - statisticsIntegerNumber of times a team had a lead in a game
team_reboundscompetitors - statisticsIntegerNumber of team rebounds in a game
team_turnoverscompetitors - statisticsIntegerNumber of team turnovers in a game
three_point_attempts_successfulcompetitors - statisticsIntegerNumber of three pointers for a team in a game
three_point_attempts_totalcompetitors - statisticsIntegerNumber of three point attempts for a team in a game
time_spent_in_leadcompetitors - statisticsIntegerNumber of minutes a team led in a game
timeoutscompetitors - statisticsIntegerNumber of timeouts used for a team in a game
turnoverscompetitors - statisticsIntegerNumber of turnovers for a team in a game
two_point_attempts_successfulcompetitors - statisticsIntegerNumber of two pointers for a team in a game
two_point_attempts_totalcompetitors - statisticsIntegerNumber of two point attempts for a team in a game
Game Stats (Player):
AttributeParent ElementTypeDescription
assistsplayers - statisticsIntegerNumber of assists for a player in a game
blocksplayers - statisticsIntegerNumber of shots blocked for a player in a game
defensive_reboundsplayers - statisticsIntegerNumber of defensive rebounds for a player in a game
field_goals_attemptedplayers - statisticsIntegerNumber of field goal attempts for a player in a game
field_goals_madeplayers - statisticsIntegerNumber of field goals for a player in a game
free_throws_attemptedplayers - statisticsIntegerNumber of free throw attempts for a player in a game
free_throws_madeplayers - statisticsIntegerNumber of free throws for a player in a game
minutesplayers - statisticsIntegerNumber of minutes played for a player in a game
offensive_reboundsplayers - statisticsIntegerNumber of offensive rebounds for a player in a game
personal_foulsplayers - statisticsIntegerNumber of personal fouls for a player in a game
pointsplayers - statisticsIntegerNumber of points for a player in a game
stealsplayers - statisticsIntegerNumber of steals for a player in a game
technical_foulsplayers - statisticsIntegerNumber of technical fouls for a player in a game
three_pointers_attemptedplayers - statisticsIntegerNumber of three point attempts for a player in a game
three_pointers_madeplayers - statisticsIntegerNumber of three pointers for a player in a game
total_reboundsplayers - statisticsIntegerNumber of total rebounds (offense + defense) for a player in a game
turnoversplayers - statisticsIntegerNumber of turnovers for a player in a game