Sports Reference Widgets
Please note that there are some dangers to using widgets (this is true of all widgets, facebook, twitter, etc). Should our servers go down the content would no longer be served. If our servers get badly taxed, the widgets could slow some of the rendering of your pages. We will always do our best to make sure our site is not a problem, but we must be upfront about the risks.
Widgets require the placement of a script tag in the page to get the widget text.
The overall widget content is wrapped in a div with class sr_widget. The content is wrapped in a div with class sr_widget_content and the footer is wrapped in a div with class sr_widget_footer.
You can use these classes to style the content separately from the page, or we provide css for use if you add the url parameter "&css;=1" to the script request. The example below uses this css and then below that how it would be called without.
Baseball Reference Widgets
Basketball Reference Widgets
Hockey Reference Widgets
Pro Football Reference Widgets
Build Your Own Widgets
You can also create a widget out of any table of stats on an SR site. The easiest way to get this code is to click on the "Embed" tooltip found just above the stat table you wish to embed.
You can also construct the code yourself, but this is a more advanced technique. The example below is the code for Ray Allen's per-game stats. To convert this to another player, just replace "a/allenra02" with the appropriate id for the player in question. For example, for Larry Bird you would use "b/birdla01". These id's can be retrieved from the player's Basketball-Reference.com page.
To exclude a particular set of columns add a parameter "&del;_col=1,2,3,12". This example would delete columns 1,2,3, and 12.
To exclude a particular set of rows add a parameter "&del;_row=2,3,12". This example would delete rows 2,3, and 12. Note that row 1 is the header.
To set a max set of rows to display, add a parameter "&max;_rows=12". This example would cap the number of rows at 12 (including headers).
Ray Allen with CSS
Ray Allen
We can't show this as the css is loaded above.
We're Social...for Statheads
Every Sports Reference Social Media Account
Site Last Updated: Wednesday, April 15, 12:00PM
Question, Comment, Feedback, or Correction?
Are you a Stathead, too? Subscribe to our Newsletter
This Week in Sports Reference
Find out when we add a feature or make a change
Do you have a sports website? Or write about sports? We have tools and resources that can help you use sports data. Find out more.