NBA Player Stats widget displays comprehensive team roster statistics in a sortable table format specifically designed for NBA basketball. It provides detailed per-player statistics including scoring, shooting percentages, rebounds, assists, and defensive metrics with the ability to toggle between total season stats and per-game averages. The widget features an interactive team selector to switch between all NBA teams, sortable columns for every statistical category, team average calculations displayed at the bottom, and configurable display modes (compact or standard). Users can click on any player to trigger navigation callbacks for detailed player pages. This widget is essential for team roster analysis, player comparison, fantasy basketball, and statistical breakdowns of NBA team performance.
Shows the default view of the NBA Player Stats Per Team widget.
See the NBA Player Stats widget demo.
player.basketball.playerStatsPerTeamThe widget requires specific parameters based on use case.
Option 1: Match-Based (automatic team detection):
Option 2: Direct Team and Season:
Option 3: Tournament Context:
Environment Requirements
Supported Sports
The NBA Player Stats widget supports the following sports:
| Sport | Sport ID |
|---|---|
| Basketball | 2 |
This widget only works with NBA. The widget includes validation that checks if the tournament is NBA and displays an error if used with other leagues: "Only NBA is supported".
Available sorting keys:
gp - Games Playedpts - Pointsfg - Field Goals Madefgp - Field Goal Percentage2pp - Two-Point Percentage3pp - Three-Point Percentageftp - Free Throw Percentagereb - Reboundsast - Assistsstl - Stealsblk - Blocksto - Turnoverspf - Personal FoulsIllustrations of main feature variants with relevant property values below.
Shows the default view of the NBA Player Stats Per Team widget.
See NBA Player Stats widget demo
Properties do not always transfer from the above table directly into integration code. Properties must be transformed differently for each integration method:
SIR() callcardVariant: "compact"In javascript integration, the properties go into an object which is passed as the 4th argument of the call ti SIR() function. Please see Global SIR API
data-sr- prefixcardVariant → data-sr-card-variant| Property | Type | Default | Description |
|---|---|---|---|
matchId | number | Conditional* | The unique identifier for the match. If provided, widget automatically determines team from match. See Getting Identifiers |
seasonId | number | Conditional* | NBA season identifier. Required when not using matchId.See Getting Identifiers |
uniqueTournamentId | number | Conditional* | Unique tournament identifier. Should be NBA (132 or 486). Used with seasonId when no matchId provided.See Getting Identifiers |
teamUid | number | Conditional* | Team unique identifier. Specifies which team's roster to display initially. If omitted with matchId, uses home team.See Getting Identifiers |
teamHomeAway | string | "home" | When using matchId, determines which team to display: "home" or "away". Only relevant when matchId provided without teamUid. |
defaultSorting | string | "pts" | Default column to sort by on initial load. See Column Keys for Sorting below. |
compactMode | boolean | false | When true, uses reduced row heights (36px instead of 46px) for space-efficient display. |
disableRegularPlayoffs | boolean | true | When true, hides regular/playoffs toggle. |
disableWidgetHeader | boolean | false | When true, hides the widget header displaying season name. |
onItemClick | function | null | Callback function triggered when player row is clicked. Emits playerId |
Sample Configuration:
string|numberfilters.sport.hidden → Complex objects must be passed as JSON stringsIn HTML integration, the properties go into the parent HTML object as object properties, prefixed with data-sr- as explained above.
This method supports only simple (base) properties and does not support properties that require functions.
In all examples replace sportradar in the widgetloader URL path with your clientId.
Example if your clientId is client1:
https://widgets.sir.sportradar.com/sportradar/widgetloaderhttps://widgets.sir.sportradar.com/client1/widgetloaderInitialize the widget programmatically using the JavaScript API. The widget renders in the specified container element.
(function(a,b,c,d,e,f,g,h,i){a[e]||(i=a[e]=function(){(a[e].q=a[e].q||[]).push(arguments)},i.l=1*new Date,i.o=f,
g=b.createElement(c),h=b.getElementsByTagName(c)[0],g.async=1,g.src=d,g.setAttribute("n",e),h.parentNode.insertBefore(g,h)
)})(window,document,"script","https://widgets.sir.sportradar.com/sportradar/widgetloader","SIR", {
language: 'en'
});
SIR('addWidget', '#sr-widget', 'player.basketball.playerStatsPerTeam', {
matchId: 123
});<div id="sr-widget"></div>Insert the following HTML code at the target widget location. Complex object properties must be passed as JSON-encoded strings.
<div id="sr-widget"
data-sr-widget="player.basketball.playerStatsPerTeam"
data-sr-match-id="123">
</div>
<script type="application/javascript"
src="https://widgets.sir.sportradar.com/sportradar/widgetloader"
async>
</script>