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
Name | Type | Argument | Default | Description |
seasonId |
number | required | Season ID | |
seasonType |
string | optional | 'regular' | Season type. Valid options are: regular or playoffs . |
conference |
string | optional | 'all' | Selected conference. Can be al , nl , all . |
statType |
string | optional | 'hitting_runs_batted_in' | Selected Stat. See below for valid options. |
disableDropdown |
boolean | optional | 'points' | If true hides dropdown. |
disableHeader |
boolean | optional | If true hides the widget header. |
|
showTitle |
boolean | optional | If true turns dropdown to title. |
|
hidePlayers |
boolean | optional | If true hides player images. |
|
playersLimit |
number | optional | 5 | Limits list length. |
qualifiesAsLeagueLeader |
boolean | optional | 'true' | If true enables statistical minimums to qualify a player for inclusion in a statistical category. |
border |
boolean | optional | If true enables a border around the widget. |
|
onItemClick |
function | optional | Function/event handler. Emits playerId on click or touch. |
List of valid stat keys:
Option | Description |
---|---|
hitting_runs_batted_in |
Runs Batted In |
hitting_batting_average |
Batting Average |
hitting_slugging_percentage |
Slugging Percentage |
hitting_on_base_percentage |
On Base Percentage |
hitting_on_base_percentage_plus_slugging |
OPS (On Base + Slugging Percentage) |
hitting_hits |
Hits |
hitting_doubles |
Doubles |
hitting_triples |
Triples |
hitting_home_runs |
Home Runs |
hitting_at_bats |
At Bats |
hitting_batting_average_on_balls_in_play |
Batting Average on Balls in Play |
hitting_isolated_power |
Isolated Power |
hitting_walks_per_strikeout |
Walks Per Strikeout (Hitter) |
hitting_at_bats_per_homerun |
At Bats Per Home Run |
hitting_stolen_bases |
Stolen Bases |
hitting_caught_stealing |
Caught Stealing |
hitting_plate_appearances |
Plate Appearances |
hitting_ground_out_to_fly_out_ratio |
Groundout to Fly Out Ratio (Hitter) |
hitting_ground_out_to_air_out_ratio |
Groundout to Air Out Ratio (Hitter) |
pitching_overall_earned_run_average |
ERA (Earned Run Average) |
pitching_overall_wins |
Wins |
pitching_overall_losses |
Losses |
pitching_overall_outs_pitched |
Outs |
pitching_overall_saves |
Saves |
pitching_overall_walks_plus_hits_per_innings_pitched |
WHIP (Walks + Hits Per Inning Pitched) |
pitching_overall_total_strikeouts |
Strikeouts |
pitching_overall_walks |
Walks |
pitching_overall_strikeouts_per_walk |
Strikeouts to Walk Ratio |
pitching_overall_complete_games |
Complete Games |
pitching_overall_shutouts |
Shutouts |
pitching_overall_quality_starts |
Quality Starts |
pitching_overall_holds |
Holds |
pitching_overall_opponents_batting_average |
Opponent Batting Average |
pitching_overall_ground_out_to_fly_out_ratio |
Groundout to Fly Out Ratio (Pitcher) |
pitching_overall_ground_out_to_air_out_ratio |
Groundout to Air Out Ratio (Pitcher) |
pitching_overall_games_started |
Games 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>
Updated over 1 year ago