Sports Reference Widget: Your Site, Our Stats
Please note
that there
are some risks to using widgets (this is true of any 3rd party widget like
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 easiest way to get this code is to click on the "Embed"
tooltip found just above the stat table you wish to embed. Then
copy the code and place it into the webpage at the location you wish
to use it.
![](/web/20120503104830im_/http://widgets.sports-reference.com/widget.png)
You can also construct the code yourself, but this is a more
advanced technique. The code example below is the code for Ray
Allen's per-game basketball 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 Sports References
for the site you are using.
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.
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.
Example: Ray Allen with CSS
Example Code: Ray Allen without CSS
We can't display this as the css is loaded above and impacts how the page is rendered.