Widgets.us.season.nfl.TopPlayers

us.season.nfl.topPlayers displays NFL top players of a certain season.

To display top players the parameter seasonId must be set.

To have specific stats for players, statType must be set

List of stat keys:

  • passing_yards (Passing Yards)
  • passing_touchdowns (Passing Touchdown)
  • pass_completions (Pass Completions)
  • pass_receptions (Pass Receptions)
  • receiving_touchdowns (Receiving Touchdowns)
  • run_after_catch (Run After Catch)
  • rushing_yards (Rushing Yards)
  • rushing_touchdowns (Rushing Touchdowns)
  • yards_per_carry (Yards Per Carry)
  • carries (Carries)
  • lost_fumbles (Lost Fumbles)
  • forced_fumbles (Forced Fumbles)
  • thrown_interceptions (Thrown Interceptions)
  • interceptions (Interceptions)
  • tackles_assists (Tackles / Assists)
  • tackles (Tackles)
  • assists (Assists)
  • sacks (Sacks)

new TopPlayers(props)

Parameters
Name Type Description
props object
Properties
Name Type Argument Description
seasonId number

Season id.

seasonType string

Season type, can be pre, reg or pst

statType string

Stat type, if you want to show a specific type first. Can be passing_yards, passing_touchdowns, pass_completions, pass_receptions, receiving_touchdowns, run_after_catch, rushing_yards, rushing_touchdowns, yards_per_carry, carries, lost_fumbles, forced_fumbles, thrown_interceptions, interceptions, tackles_assists, tackless, assists or sacks.

playersLimit number

Maximum number of players to display.

hidePlayers boolean

Hide player images.

disableHeader boolean

Hides the header.

disableDropdown boolean

Hides the dropdown.

showTitle boolean

Instead of dropdown it shows only the name of the stat in the title.

onItemClick function <optional>

Function/event handler. Emits playerId on click or touch.

Examples

HTML/Declarative

<div class="sr-widget" data-sr-widget="us.season.nfl.topPlayers" data-sr-season-id="2022"></div>
<script type="application/javascript" src="https://widgets.media.sportradar.com/uscommon/widgetloader" data-sr-language="en_us" async></script>

JS/Programmatic

<script>
    (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.media.sportradar.com/uscommon/widgetloader","USW", {
        language: 'en_us'
    });
    USW('addWidget', '#sr-widget', 'us.season.nfl.topPlayers', {seasonId: 2022});
</script>

JS/Example of using Event Handler

<script>
    (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.media.sportradar.com/uscommon/widgetloader","USW", {
        language: 'en_us'
    });
    USW('addWidget', '#sr-widget', 'us.season.nfl.topPlayers', {seasonId: 2022, onItemClick: function(type, obj){alert('playerId: ' + obj.playerId);}});
</script>
<div id="sr-widget"></div>