• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Baseballstats/sandbox

  • Template
  • Talk
  • Language
  • Watch
  • Edit
< Template:Baseballstats
This is the template sandbox page for Template:Baseballstats (diff).
See also the companion subpage for test cases.
Template documentation[view] [edit] [history] [purge]
WarningThis template is used on approximately 26,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them.
Wikidata has the properties:
  • MLB.com player ID (P3541) (see uses)
  • ESPN.com MLB player ID (P3571) (see uses)
  • Baseball Reference major league player ID (P1825) (see uses)
  • FanGraphs player ID (P3574) (see uses)
  • Baseball Reference minor & foreign league player ID (P1826) (see uses)
  • Retrosheet person ID (P6976) (see uses)
  • Baseball Almanac ID (P4409) (see uses)
This template uses Lua:
  • Module:Check for unknown parameters (sandbox)

Contents

  • 1 Usage
    • 1.1 Example
  • 2 Parameters
    • 2.1 TemplateData
  • 3 Maintenance/tracking categories

Usage

edit

To use this template, copy and paste this text to a baseball player's external links section:

{{Baseballstats |mlb= |espn= |br= |fangraphs= |brm= |retro= |almanac= }}

Add the page ID's after the equals sign to properly direct the links that you desire to have.

If an item's data is available in Wikidata under the properties listed to the side or below, it will show them automatically, with an Edit sign to edit it if needed. If an ID is provided, the edit sign will not show up, and the template's parameter will override what is on Wikidata.

If you do not specify an ID, and it is not on Wikidata, the site will not be shown.

Example

edit

Example for Chris Young (outfielder):

{{Baseballstats |mlb= 455759 |espn= 6514 |br= y/youngch04 |fangraphs= 3882 |brm= young-001chr |retro= Y/Pyounc004 |almanac= youngch04 }}

results in:

  • Career statistics from MLB · ESPN · Baseball Reference · Fangraphs · Baseball Reference (Minors) · Retrosheet · Baseball Almanac

To find a player's ID, find the player's page on a website and locate a string of numbers or letters in the URL similar to the ones above. That is the player's ID.

Parameters

edit
Parameter Website Wikidata property† URL
|mlb= MLB.com P3541 https://mlb.mlb.com/team/player.jsp?player_id={{{mlb}}}
|espn= ESPN.com P3571 https://www.espn.com/mlb/player/stats/_/id/{{{espn}}}
|br= Baseball-Reference.com P1825 https://www.baseball-reference.com/players/{{{br}}}.shtml
|fangraphs= Fangraphs.com P3574 https://www.fangraphs.com/statss.aspx?playerid={{{fangraphs}}}
|brm= Baseball-Reference.com (Minors) P1826 https://www.baseball-reference.com/minors/player.cgi?id={{{brm}}}
|retro= Retrosheet.org P6976 https://www.retrosheet.org/boxesetc/{{retro}}.htm
|almanac= Baseball-Almanac.org P4409 https://www.baseball-almanac.com/players/player.php?p={{almanac}}
|nobullet=† — — —

† The |nobullet= parameter, when set to any value, prevents the rendering of the leading bullet. This makes the template appropriate for use in <ref>...</ref> tags.

TemplateData

edit
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Baseballstats in articles based on its TemplateData.

TemplateData for Baseballstats

Shows career statistics and player information for various links in one template.

Template parameters[Edit template data]

This template has custom formatting.

ParameterDescriptionTypeStatus
MLB IDmlb

The ID of this player on MLB's website. Found at the end of a player URL. This corresponds to Wikidata property P3541.

Numberoptional
ESPN Stats IDespn

ID found at the end of the ESPN player stats URL. Follows the format: https://www.espn.com/mlb/player/stats/_/id/{{{espn}}}. Corresponds to Wikidata property P3571.

Stringoptional
Baseball Referencebr id

The baseball reference code for this player. Found near the end of the URL: https://www.baseball-reference.com/players/{br}.shtml. Corresponds to Wikidata property P1825.

Stringoptional
Baseball Reference (Minors)brm

The minor league stats for this player. Found at the end of a minor league URL. E.g. https://www.baseball-reference.com/register/player.fcgi?id={brm}. Corresponds to Wikidata property P1826.

Stringoptional
Fangraphs Player IDfangraphs

The Fangraphs.com player ID for this player. Found inside a stats URL. https://www.fangraphs.com/players/player-name/{fangraphId}. Corresponds to Wikidata property P3574.

Numberoptional
Retrosheet IDretro

The Retrosheet.org page for this player. Found near the end of a Retrosheet player URL, e.g. https://www.retrosheet.org/boxesetc/{retro}.htm. Corresponds to Wikidata property P6976.

Stringoptional
Baseball Almanacalmanac

The Baseball Almanac stats for this player. Found at the end of a URL: https://www.baseball-almanac.com/players/player.php?p={{almanac}}. Corresponds to Wikidata property P4409.

Example
seageco01
Stringoptional
No Bulletnobullet

Set this to any value remove the bullet prepended automatically.

Auto value
y
Booleanoptional


Maintenance/tracking categories

edit
  • Category:Pages using baseballstats with unknown parameters (1)
The above documentation is transcluded from Template:Baseballstats/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Baseballstats/sandbox&oldid=1290646095"
Last edited on 16 May 2025, at 03:28

Languages

      This page is not available in other languages.

      Wikipedia
      • Wikimedia Foundation
      • Powered by MediaWiki
      • This page was last edited on 16 May 2025, at 03:28 (UTC).
      • Content is available under CC BY-SA 4.0 unless otherwise noted.
      • Privacy policy
      • About Wikipedia
      • Disclaimers
      • Contact Wikipedia
      • Code of Conduct
      • Developers
      • Statistics
      • Cookie statement
      • Terms of Use
      • Desktop