← Back to Widgets

WordPress Integration Guide

Embed live sports widgets on any WordPress site in under 60 seconds

Quick Start (3 Steps)

1

Get Your API Key

Sign up at api.altsportsdata.com and copy your API key from the dashboard.

2

Add a Custom HTML Block

In the WordPress block editor, click "+" and search for "Custom HTML". In the Classic Editor, switch to the "Text" tab.

3

Paste the Widget Code

Copy the code below and paste it into the HTML block. Replace YOUR_API_KEY and YOUR_LEAGUE_ID with your values.

Widget Code Examples

Most PopularLeague Standings

HTMLCopy and paste into WordPress
<div
    data-asl-widget="standings"
    data-asl-league-id="YOUR_LEAGUE_ID"
    data-asl-api-key="YOUR_API_KEY"
    data-asl-theme="dark"
    data-asl-max-items="10"
    style="max-width: 100%; margin: 0 auto;"
></div>
<script src="https://widgets.altsportsleagues.ai/embed/loader.js" async></script>

Live Scores

HTML
<div
    data-asl-widget="live-scores"
    data-asl-league-id="YOUR_LEAGUE_ID"
    data-asl-api-key="YOUR_API_KEY"
    data-asl-theme="dark"
    data-asl-refresh-interval="30"
    style="max-width: 100%; margin: 0 auto;"
></div>
<script src="https://widgets.altsportsleagues.ai/embed/loader.js" async></script>

Fighter Rankings (Combat Sports)

HTML
<div
    data-asl-widget="fighter-rankings"
    data-asl-league-id="ufc"
    data-asl-api-key="YOUR_API_KEY"
    data-asl-theme="dark"
    data-asl-size="standard"
    style="max-width: 500px; margin: 0 auto;"
></div>
<script src="https://widgets.altsportsleagues.ai/embed/loader.js" async></script>

Driver Standings (Racing)

HTML
<div
    data-asl-widget="driver-standings"
    data-asl-league-id="f1"
    data-asl-api-key="YOUR_API_KEY"
    data-asl-theme="dark"
    data-asl-max-items="10"
    style="max-width: 600px; margin: 0 auto;"
></div>
<script src="https://widgets.altsportsleagues.ai/embed/loader.js" async></script>

Compatibility

Gutenberg (Block Editor)Full Support

Use the Custom HTML block

Classic EditorFull Support

Switch to Text tab and paste

ElementorFull Support

Use the HTML widget element

Divi BuilderFull Support

Use the Code Module

WPBakeryFull Support

Use Raw HTML element

Beaver BuilderFull Support

Use the HTML module

Configuration Options

AttributeValuesDescription
data-asl-widgetstandings, live-scores, schedule, ...Widget type to display
data-asl-league-idufc, f1, nfl, premier-league, ...Target league identifier
data-asl-api-keyYour API keyAuthentication key from api.altsportsdata.com
data-asl-themelight, dark, autoColor theme (auto follows user system preference)
data-asl-sizecompact, standard, large, responsiveWidget size preset
data-asl-max-items5, 10, 20, ...Max items to show in lists
data-asl-refresh-interval0, 10, 30, 60, ...Auto-refresh interval in seconds (0 = off)

Troubleshooting

Widget not showing up?

Make sure you pasted the code in a Custom HTML block, not a regular Paragraph block. The widget needs raw HTML to render.

Script blocked by security plugin?

Some security plugins block external scripts. Add widgets.altsportsleagues.ai to your whitelist, or use the iframe embed format instead.

Widget too wide/narrow?

Add style="max-width: 500px" to the widget div, or use data-asl-size="responsive" to auto-fit.

Data not loading?

Check your API key is correct and active. Test it at api.altsportsdata.com/health. Contact support@altsportsdata.com if issues persist.

Ready to Get Started?