NBA Push Statistics retrieves detailed, real-time game stats at the team and player level for all live games.
Syntax
https://api.sportradar.com/nba/{access_level}/stream/{language_code}/statistics/subscribe?api_key={your_api_key} |
Parameters
Parameter | Description |
---|---|
access_level | Defines the access level of your API keyproduction , trial |
language_code | Optional code for supported languagesen (English) |
your_api_key | Your 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.
Parameter | Description |
---|---|
locale | Language returned expressed as a 2-letter codeen (English)Example: locale=en |
match | Match id Example: match=sd:match:0f4a0ce6-9abb-44ac-867f-75cc2154bb40 |
players | Player id Example: players=sd:player:92ec1ed2-95f7-45da-a923-71fd541d6cdb |
stats_type | Stat type Example: stats_type=player |
team | Team id Example: team=sd:team:583eca2f-fb46-11e1-82cb-f4ce4684ea4c |
status | Game statusinprogress , created Example: status=inprogress |
Code Samples
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.sportradar.com/nba/trial/stream/en/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/nba/trial/stream/en/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.us/nba/trial/stream/en/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/nba/trial/stream/en/statistics/subscribe?api_key={your_api_key}&status=inprogress&match=sd:match:0f4a0ce6-9abb-44ac-867f-75cc2154bb40")
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/statistics/subscribe",
params = {'api_key': 'your_api_key', 'status': 'inprogress', 'match': 'sd:match:0f4a0ce6-9abb-44ac-867f-75cc2154bb40'},
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/statistics/subscribe?api_key={your_api_key}&status=inprogress&match=sd:match:0f4a0ce6-9abb-44ac-867f-75cc2154bb40'
Response Sample
The above commands return json like this.
Data Points
Starters & Activity:
Attribute | Parent Element | Type | Description |
---|---|---|---|
active | player | Boolean | Signifies a player is on the active roster |
ejected | player | Boolean | Signifies a player is ejected from a game |
fouled_out | player | Boolean | Signifies a player is fouled out of a game |
not_playing_description | player | String | Text description of a "Not Playing" player ex. Left Hamstring; Strain |
not_playing_reason | player | String | Text description of a "Not Playing" reason ex. Inactive - Injury/Illness See our FAQ for a complete list of reasons |
on_court | player | Boolean | Signifies a player is currently on the court |
played | player | Boolean | Signifies a player played in a game |
starter | player | Boolean | Signifies a player started a game |
Game:
Attribute | Parent Element | Type | Description |
---|---|---|---|
coverage | game | String | Coverage level of a gamefull , extended_boxscore |
id | game | GUID | Unique ID of a game ex. 1f730a9a-8221-48ff-a259-ac2103fb58b0 |
reference | game | String | League reference ID of a game ex. 1610612758 |
sr_id | game | GUID | Unique Sportradar ID of a game ex. sr:match:35431817 |
status | game | String | The status of a gamescheduled , 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 |
title | game | String | Game title ex. Game 6 |
scheduled | game | dateTime | Scheduled date and time of a game ex. 2024-02-14T05:00:00Z |
away | game - time_zones | String | Time zone of the away team ex. US/Pacific |
home | game - time_zones | String | Time zone of the home team ex. US/Eastern |
venue | game - time_zones | String | Time zone of the venue ex. US/Eastern |
Player Statistics (Game):
Attribute | Parent Element | Type | Description |
---|---|---|---|
assists | player - statistics | Integer | Number of assists |
assists_turnover_ratio | player - statistics | Decimal | Assist to turnover ratio |
blocked_att | player - statistics | Integer | Number of blocked attempts |
blocks | player - statistics | Integer | Number of shots blocked |
coach_ejections | player - statistics | Integer | Number of coach ejections |
coach_tech_fouls | player - statistics | Integer | Number of coach technical fouls |
defensive_rating | player - statistics | Decimal | Defensive Rating ex. 106.11873436165 |
defensive_rebounds | player - statistics | Integer | Number of defensive rebounds |
defensive_rebounds_pct | player - statistics | Decimal | Defensive rebound percentage ex. 27.7537372335189 |
double_double | player - statistics | Boolean | Signifies a double-double |
effective_fg_pct | player - statistics | Decimal | Effective Field Goal Percentage (FG + 0.5 * 3P) / FGA |
efficiency | player - statistics | Decimal | Player Efficiency Rating (sPoints + sAssists + sBlocks + sSteals + sFoulsDrawn + sReboundsTotal) - (sTurnovers + sBlocksReceived + sFoulsPersonal + sFoulsTechnical + (sTwoPointersAttempted - sTwoPointersMade) + (sThreePointersAttempted - sThreePointersMade) + (sFreeThrowsAttempted-sFreeThrowsMade)) |
efficiency_game_score | player - statistics | Decimal | Player Efficiency Game Score sPoints + 0.4 sFieldGoalsMade - 0.7 sFieldGoalsAttempted - 0.4 ( sFreeThrowsAttempted - sFreeThrowsMade) + 0.7 sReboundsOffensive + 0.3 sReboundsDefensive + sSteals + 0.7 sAssists + 0.7 sBlocks - 0.4 sFoulsPersonal - sTurnovers |
fast_break_att | player - statistics | Integer | Number of fast break attempts |
fast_break_made | player - statistics | Integer | Number of fast break baskets |
fast_break_pct | player - statistics | Decimal | Fast break percentage ex. 100.0 |
fast_break_pts | player - statistics | Integer | Number of fast break points |
field_goals_att | player - statistics | Integer | Number of field goal attempts |
field_goals_made | player - statistics | Integer | Number of field goals made |
field_goals_pct | player - statistics | Decimal | Field goal percentage ex. 56.5 |
flagrant_fouls | player - statistics | Integer | Number of flagrant fouls |
fouled_out | player - statistics | Boolean | Signifies a fouled out player |
fouls_drawn | player - statistics | Integer | Number of fouls drawn |
free_throws_att | player - statistics | Integer | Number of free throw attempts |
free_throws_made | player - statistics | Integer | Number of free throws made |
free_throws_pct | player - statistics | Decimal | Free throw percentage ex. 100.0 |
minus | player - statistics | Integer | Number of team points against while a player is on the court |
minutes | player - statistics | String | Number of minutes played ex. 40:07 |
offensive_fouls | player - statistics | Integer | Number of offensive fouls |
offensive_rating | player - statistics | Decimal | Offensive Rating ex. 171.93820667994 |
offensive_rebounds | player - statistics | Integer | Number of offensive rebounds |
offensive_rebounds_pct | player - statistics | Decimal | Offensive rebound percentage ex. 20.0 |
personal_fouls | player - statistics | Integer | Number of personal fouls |
plus | player - statistics | Integer | Number of team points scored while a player is on the court |
pls_min | player - statistics | Integer | Plus/Minus (Team scoring while a player is on the court) ex. -1 or 12 |
points | player - statistics | Integer | Number of points |
points_in_paint | player - statistics | Integer | Number of points in the paint |
points_in_paint_att | player - statistics | Integer | Number of points in the paint attempts |
points_in_paint_made | player - statistics | Integer | Number of points in the paint baskets |
points_in_paint_pct | player - statistics | Decimal | Points in the paint percentage ex. 28.6 |
points_off_turnovers | player - statistics | Integer | Number of points off turnovers |
rebounds | player - statistics | Integer | Number of rebounds |
rebounds_pct | player - statistics | Decimal | Rebound percentage ex. 26.7857142857143 |
second_chance_att | player - statistics | Integer | Number of second chance attempts |
second_chance_made | player - statistics | Integer | Number of second chance baskets |
second_chance_pct | player - statistics | Decimal | Second chance percentage ex. 20.0 |
second_chance_pts | player - statistics | Integer | Number of second chance points |
steals | player - statistics | Integer | Number of steals |
steals_pct | player - statistics | Decimal | Steal percentage ex. 1.23425509677491 |
tech_fouls | player - statistics | Integer | Number of total unsportsmanlike technical fouls |
tech_fouls_non _unsportsmanlike | player - statistics | Integer | Number of non-unsportsmanlike technical fouls |
three_points_att | player - statistics | Integer | Number of 3-point attempts |
three_points_made | player - statistics | Integer | Number of 3-point baskets |
three_points_pct | player - statistics | Decimal | 3-point percentage ex. 100.0 |
triple_double | player - statistics | Boolean | Signifies a triple-double |
true_shooting_att | player - statistics | Decimal | Number of attempts used to determine true shooting percentage sFieldGoalsAttempted + (0.44 * sFreeThrowsAttempted) |
true_shooting_pct | player - statistics | Decimal | True Shooting Percentage 100 sPoints / (2 sTrueShootingAttempts ) |
turnovers | player - statistics | Integer | Number of turnovers |
turnovers_pct | player - statistics | Decimal | Turnover Percentage ex. 3.88198757763975 |
two_points_att | player - statistics | Integer | Number of 2-point attempts |
two_points_made | player - statistics | Integer | Number of 2-point baskets |
two_points_pct | player - statistics | Decimal | 2-point percentage ex. 100.0 |
Team Statistics (Game):
Attribute | Parent Element | Type | Description |
---|---|---|---|
assists | team - statistics | Integer | Number of assists |
assists_turnover_ratio | team - statistics | Decimal | Assist to turnover ratio |
bench_points | team - statistics | Integer | Number of bench points |
biggest_lead | team - statistics | Integer | Largest lead in points for a team |
blocked_att | team - statistics | Integer | Number of blocked attempts |
blocks | team - statistics | Integer | Number of shots blocked |
coach_ejections | team - statistics | Integer | Number of coach ejections |
coach_tech_fouls | team - statistics | Integer | Number of coach technical fouls |
defensive_points_per_possession | team - statistics | Integer | Average defensive points per position |
defensive_rating | team - statistics | Decimal | Defensive Rating ex. 106.11873436165 |
defensive_rebounds | team - statistics | Integer | Number of defensive rebounds |
effective_fg_pct | team - statistics | Decimal | Effective Field Goal Percentage (FG + 0.5 * 3P) / FGA |
efficiency | team - statistics | Decimal | Player Efficiency Rating (sPoints+sAssists+sBlocks+sSteals+sFoulsDrawn+sReboundsTotal)-(sTurnovers+sBlocksReceived+sFoulsPersonal+sFoulsTechnical+(sTwoPointersAttempted-sTwoPointersMade)+(sThreePointersAttempted-sThreePointersMade)+(sFreeThrowsAttempted-sFreeThrowsMade)) |
efficiency_game_score | team - statistics | Decimal | Player Efficiency Game Score sPoints + 0.4 sFieldGoalsMade - 0.7 sFieldGoalsAttempted - 0.4 ( sFreeThrowsAttempted - sFreeThrowsMade) + 0.7 sReboundsOffensive + 0.3 sReboundsDefensive + sSteals + 0.7 sAssists + 0.7 sBlocks - 0.4 sFoulsPersonal - sTurnovers |
ejections | team - statistics | Integer | Number of ejections |
fast_break_att | team - statistics | Integer | Number of fast break attempts |
fast_break_made | team - statistics | Integer | Number of fast break baskets |
fast_break_pct | team - statistics | Decimal | Fast break percentage ex. 100.0 |
fast_break_pts | team - statistics | Integer | Number of fast break points |
field_goals_att | team - statistics | Integer | Number of field goal attempts |
field_goals_made | team - statistics | Integer | Number of field goals made |
field_goals_pct | team - statistics | Decimal | Field goal percentage ex. 56.5 |
field_goals_at_midrange_att | team - statistics | Integer | Number of mid-range field goal attempts ex. 56.5 |
field_goals_at_midrange_made | team - statistics | Integer | Number of mid-range field goals made ex. 56.5 |
field_goals_at_midrange_pct | team - statistics | Decimal | Mid-range field goal percentage ex. 56.5 |
field_goals_at_rim_att | team - statistics | Integer | Number of field goal attempts at the rim ex. 56.5 |
field_goals_at_rim_made | team - statistics | Integer | Number of field goals made at the rim ex. 56.5 |
field_goals_at_rim_pct | team - statistics | Decimal | At the rim field goal percentage ex. 56.5 |
flagrant_fouls | team - statistics | Integer | Number of flagrant fouls |
foulouts | team - statistics | Integer | Number of fouled out players |
fouls_drawn | team - statistics | Integer | Number of fouls drawn |
free_throws_att | team - statistics | Integer | Number of free throw attempts |
free_throws_made | team - statistics | Integer | Number of free throws made |
free_throws_pct | team - statistics | Decimal | Free throw percentage ex. 100.0 |
minutes | team - statistics | String | Number of minutes played ex. 4:25:00 |
opp_score | team - statistics - most_unanswered | Integer | Opponents score when a team's largest scoring run was attained |
own_score | team - statistics - most_unanswered | Integer | Team's score when its largest score run was attained |
points | team - statistics - most_unanswered | Integer | Longest streak of unanswered points |
offensive_fouls | team - statistics | Integer | Number of offensive fouls |
offensive_points_per_possession | team - statistics | Integer | Average offensive points per position |
offensive_rating | team - statistics | Decimal | Offensive Rating ex. 171.93820667994 |
offensive_rebounds | team - statistics | Integer | Number of offensive rebounds |
opponent_possessions | team - statistics | Decimal | Number of opponent's possessions based on the possessions formula |
personal_fouls | team - statistics | Integer | Number of personal fouls |
personal_rebounds | team - statistics | Integer | Total number of rebounds attributed to players Note: this appears under rebounds in previous API versions |
player_tech_fouls | team - statistics | Integer | Number of player technical fouls |
player_turnovers | team - statistics | Integer | Number of turnovers attributed to players Note: this appears under turnovers in previous API versions |
pls_min | team - statistics | Integer | Plus/Minus |
points | team - statistics | Integer | Number of points |
points_against | team - statistics | Integer | Number of points against |
points_in_paint | team - statistics | Integer | Number of points in the paint |
points_in_paint_att | team - statistics | Integer | Number of points in the paint attempts |
points_in_paint_made | team - statistics | Integer | Number of points in the paint baskets |
points_in_paint_pct | team - statistics | Decimal | Points in the paint percentage ex. 28.6 |
points_off_turnovers | team - statistics | Integer | Number of points off turnovers |
possessions | team - statistics | Decimal | Team possessions 0.5 ((sFieldGoalsAttempted + 0.4 sFreeThrowsAttempted - 1.07 (sReboundsOffensive / (sReboundsOffensive + sOppReboundsDefensive )) (sFieldGoalsAttempted - sFieldGoalsMade) + sTurnovers) + (sOppFieldGoalsAttempted + 0.4 sOppFreeThrowsAttempted - 1.07 (sOppReboundsOffensive / (sOppReboundsOffensive + sReboundsDefensive)) * (sOppFieldGoalsAttempted - sOppFieldGoalsMade) + sOppTurnovers)) |
second_chance_att | team - statistics | Integer | Number of second chance attempts |
second_chance_made | team - statistics | Integer | Number of second chance baskets |
second_chance_pct | team - statistics | Decimal | Second chance percentage ex. 20.0 |
second_chance_pts | team - statistics | Integer | Number of second chance points |
steals | team - statistics | Integer | Number of steals |
team_defensive_rebounds | team - statistics | Integer | Number of team defensive rebounds |
team_fouls | team - statistics | Integer | Number of team fouls |
team_offensive_rebounds | team - statistics | Integer | Number of team offensive rebounds |
team_rebounds | team - statistics | Integer | Number of team rebounds |
team_tech_fouls | team - statistics | Integer | Number of team technical fouls |
team_turnovers | team - statistics | Integer | Sum of team turnovers |
technical_other | team - statistics | Integer | Number of other technical fouls This stat is no longer in use but may be present for past games |
three_points_att | team - statistics | Integer | Number of 3-point attempts |
three_points_made | team - statistics | Integer | Number of 3-point baskets |
three_points_pct | team - statistics | Decimal | 3-point percentage ex. 80.0 |
time_leading | team - statistics | String | Time leading in a game for a team ex. 43:14 |
total_fouls | team - statistics | Integer | Number of total fouls (team fouls + personal fouls) |
total_rebounds | team - statistics | Integer | Number of total rebounds (team rebounds + player rebounds ) |
total_turnovers | team - statistics | Integer | Number of total team turnovers (player_turnovers + team_turnovers ) |
true_shooting_att | team - statistics | Decimal | Number of attempts used to determine true shooting percentage sFieldGoalsAttempted + (0.44 * sFreeThrowsAttempted) |
true_shooting_pct | team - statistics | Decimal | True Shooting Percentage 100 sPoints / (2 sTrueShootingAttempts ) |
turnovers | team - statistics | Integer | Sum of player turnovers |
two_points_att | team - statistics | Integer | Number of 2-point attempts |
two_points_made | team - statistics | Integer | Number of 2-point baskets |
two_points_pct | team - statistics | Decimal | 2-point percentage ex. 100.0 |
Metadata:
Attribute | Parent Element | Type | Description |
---|---|---|---|
league | metadata | String | Alias of a league ex. NBA |
locale | metadata | String | Language code ex. en (English) |
match | metadata | GUID | Unique ID of a game ex. sd:match:d8539eb6-3e27-40c8-906f-9cd1736321d8 |
operation | metadata | String | Operation of an updateupdate , delete |
players | metadata | GUID | Unique ID(s) of players associated with an event ex. sd:player:68b7aac9-02fd-4bd8-b10c-6702d2c5eb98,sd:player:ffa9a64f-d624-4033-bd23-59dcfd805175 |
stats_type | metadata | String | Type of statistic ex. team or player |
status | metadata | String | The status of a gamescheduled , 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 |
team | metadata | GUID | Unique ID(s) of team(s) associated with an event ex. sd:team:583ecefd-fb46-11e1-82cb-f4ce4684ea4c,sr:team:3410 |
version | metadata | String | Version of the API ex. v7 |
Play-by-Play - Home/Away Teams:
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. 583ed0ac-fb46-11e1-82cb-f4ce4684ea4c |
market | game - away | String | Market name of the away team ex. Sacramento |
name | game - away | String | Away team name ex. Kings |
reference | game - away | String | League reference ID of the away team ex. 1610612750 |
remaining_timeouts | game - away | Integer | Remaining timeouts for the away team |
sr_id | game - away | GUID | Unique Sportradar ID of the away team ex. sr:team:3415 |
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. 583ed0ac-fb46-11e1-82cb-f4ce4684ea4c |
market | game - home | String | Market name of the home team ex. Sacramento |
name | game - home | String | Home team name ex. Kings |
reference | game - home | String | League reference ID of the home team ex. 1610612750 |
remaining_timeouts | game - home | Integer | Remaining timeouts for the home team |
sr_id | game - home | GUID | Unique Sportradar ID of the home team ex. sr:team:3415 |
Player:
Attribute | Parent Element | Type | Description |
---|---|---|---|
first_name | player | String | First name of a player ex. Stephen |
full_name | player | String | Full name of a player ex. Stephen Curry |
id | player | GUID | Unique player ID ex. 8ec91366-faea-4196-bbfd-b8fab7434795 |
jersey_number | player | Integer | Number of a player's jersey |
last_name | player | String | Last name of a player ex. Curry |
name_suffix | player | String | Suffix of a player ex. Jr. |
position | player | String | Position of a playerNA , C , C-F , F , F-C , F-G , G , G-F |
primary_position | player | String | Primary position of a playerNA , C , PF , PG , SF , SG |
reference | player | String | League reference ID of a player ex. 1626157 |
sr_id | player | GUID | Unique Sportradar ID of a player ex. sr:player:608110 |
Team:
Attribute | Parent Element | Type | Description |
---|---|---|---|
id | team | GUID | Unique ID of a team ex. 583ed0ac-fb46-11e1-82cb-f4ce4684ea4c |
market | team | String | Market name of a team ex. Sacramento |
name | team | String | Team name ex. Kings |
reference | team | String | League reference ID of a team ex. 1610612750 |
sr_id | team | GUID | Unique Sportradar ID of a team ex. sr:team:3415 |