Widget Docs
Coverage MatrixDocumentationChange LogLog InContact Us
Widget Docs

Top Players

us.season.mlb.topPlayers displays a top 5 leaderboard for a given season, with a dropdown to select by statistic.

For the widget to render you must provide a valid seasonId.

To have specific stats for players, statType must be set.

Parameters

NameTypeArgumentDefaultDescription
seasonIdnumberrequiredSeason ID
seasonTypestringoptional'regular'Season type. Valid options are: regular or playoffs.
conferencestringoptional'all'Selected conference. Can be al, nl, all.
statTypestringoptional'hitting_runs_batted_in'Selected Stat. See below for valid options.
disableDropdownbooleanoptional'points'If true hides dropdown.
disableHeaderbooleanoptionalIf true hides the widget header.
showTitlebooleanoptionalIf true turns dropdown to title.
hidePlayersbooleanoptionalIf true hides player images.
playersLimitnumberoptional5Limits list length.
qualifiesAsLeagueLeaderbooleanoptional'true'If true enables statistical minimums to qualify a player for inclusion in a statistical category.
borderbooleanoptionalIf true enables a border around the widget.
onItemClickfunctionoptionalFunction/event handler. Emits playerId on click or touch.
List of valid stat keys:
OptionDescription
hitting_runs_batted_inRuns Batted In
hitting_batting_averageBatting Average
hitting_slugging_percentageSlugging Percentage
hitting_on_base_percentageOn Base Percentage
hitting_on_base_percentage_plus_sluggingOPS (On Base + Slugging Percentage)
hitting_hitsHits
hitting_doublesDoubles
hitting_triplesTriples
hitting_home_runsHome Runs
hitting_at_batsAt Bats
hitting_batting_average_on_balls_in_playBatting Average on Balls in Play
hitting_isolated_powerIsolated Power
hitting_walks_per_strikeoutWalks Per Strikeout (Hitter)
hitting_at_bats_per_homerunAt Bats Per Home Run
hitting_stolen_basesStolen Bases
hitting_caught_stealingCaught Stealing
hitting_plate_appearancesPlate Appearances
hitting_ground_out_to_fly_out_ratioGroundout to Fly Out Ratio (Hitter)
hitting_ground_out_to_air_out_ratioGroundout to Air Out Ratio (Hitter)
pitching_overall_earned_run_averageERA (Earned Run Average)
pitching_overall_winsWins
pitching_overall_lossesLosses
pitching_overall_outs_pitchedOuts
pitching_overall_savesSaves
pitching_overall_walks_plus_hits_per_innings_pitchedWHIP (Walks + Hits Per Inning Pitched)
pitching_overall_total_strikeoutsStrikeouts
pitching_overall_walksWalks
pitching_overall_strikeouts_per_walkStrikeouts to Walk Ratio
pitching_overall_complete_gamesComplete Games
pitching_overall_shutoutsShutouts
pitching_overall_quality_startsQuality Starts
pitching_overall_holdsHolds
pitching_overall_opponents_batting_averageOpponent Batting Average
pitching_overall_ground_out_to_fly_out_ratioGroundout to Fly Out Ratio (Pitcher)
pitching_overall_ground_out_to_air_out_ratioGroundout to Air Out Ratio (Pitcher)
pitching_overall_games_startedGames Started

Examples

<div class="sr-widget" data-sr-widget="us.season.mlb.topPlayers" data-sr-season-id="79507"></div>
<script type="application/javascript" src="https://widgets.media.sportradar.com/YOUR_CLIENT_ALIAS/widgetloader" data-sr-language="en_us" async></script>
<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/YOUR_CLIENT_ALIAS/widgetloader","SIR", {
        language: 'en_us'
    });
    SIR('addWidget', '#sr-widget', 'us.season.mlb.topPlayers', {seasonId: 61503, statType: 'hitting_batting_average'});
</script>
<div id="sr-widget"></div>
<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/YOUR_CLIENT_ALIAS/widgetloader","SIR", {
        language: 'en_us'
    });
    SIR('addWidget', '#sr-widget', 'us.season.mlb.topPlayers', {seasonId: 61503, conference: 'al', statType: 'pitching_overall_earned_run_average', onItemClick: function(type, obj){alert('playerId: ' + obj.playerId);}});
</script>
<div id="sr-widget"></div>