Leagues widget is a front end visualization of a competitions list that is personalized and sorted in order of the most relevant tournaments. The list of tournaments is based on the tournament popularity and the punters betting history. This simplifies the process of finding the most relevant competition from the myriad of possible choices and boosts betting volume for both upcoming and live markets.
Recommendation types
Personalization requirement
To enable personalized recommendations (the recommended type), you must provide a unique user identifier. When no user ID is provided, the widget will fall back to popular recommendations.
Tailors league recommendations to individual punter preferences and betting history.
Supports both real-time in-play markets and upcoming tournament scheduling.
Seamlessly connects to client APIs and Sportradar data with minimal configuration.
Fully optimized for flawless display across desktop, tablet, and mobile devices.
Extensive CSS selectors for matching the widget to your brand's unique visual identity.
Use as a horizontal scrollable list of top competitions for quick site-wide navigation.
Clicking a league tab automatically directs users to the relevant competition subpage.
Works perfectly within modals or sidebars to provide context-sensitive league choices.
Optimized touch gestures for mobile swiping and click-friendly desktop layouts.
Access to the client API
Required endpoints: User ID, Tournament info
Requires an adapter to be registered via SIR('registerAdapter', '{ADAPTER_NAME}'). See the adapter overview: https://apidocs.sportradar.online/resources/widgets/docs/adapter/Overview
widget-name: betRecommendation.leagues
Environment Requirements
| Browser | Version | Mobile Support |
|---|---|---|
| Chrome | 60+ | ✅ Chrome Mobile 60+ |
| Firefox | 55+ | ✅ Firefox Mobile 55+ |
| Safari | 12+ | ✅ iOS Safari 12+ |
| Edge | 79+ | ✅ Edge Mobile 79+ |
| Internet Explorer | All versions | ❌ Not Supported |
Supported Sports
See the Leagues widget demo.
Illustrations of main visual modes and recommendation types with relevant property values below.

League tabs with sport-specific icons for quick visual identification.
| Property | Type | Default | Description |
|---|---|---|---|
user | string|number | 0 | User identifier for personalized league recommendations. |
activeTournamentId | string|number | undefined | Tournament identifier for pre-selected active tab. |
count | number | 5 | Number of league tabs to display (1-30). |
labelType | string | "hidden" |
Extended Properties
| Property | Type | Default | Description |
|---|---|---|---|
filters | object | Required | Configuration object for recommendation type, sports, and time filtering. See below for detailed structure. |
debug | boolean | false | Enables debug mode with console logging for development. When true, logs recommendation generation, API calls, league selection logic, tracking events. Use for troubleshooting integration issues and understanding recommendation process. |
The filters object controls recommendation algorithm, time windows, and sport filtering.
Filters Property Details
Theming customization allows to tailor the appearance of Bet Recommendation widgets to meet specific needs and preferences. In the context of the Bet Recommendation widget, customization refers to the ability to modify the default styling of the widget by applying custom CSS properties to the various HTML elements that make up the widget.
Widget comes with pre-existing styling but can be customized by applying custom CSS properties to its different HTML elements. The widget's custom class selectors and supported CSS properties are listed below.
All custom classes must be nested within the .sr-bb.sr-br-leagues selector class. This ensures that the custom styles only apply to that widget and not to other elements on the page.
To customize tabs, please refer to the Tabs Component.
| CSS class | Supported CSS properties |
|---|---|
srct-br-league__item | color, font-size, font-weight |
srct-br-league__title | color, font-size, font-weight |
srct-br-league__label | color, font-size, font-weight |
Mandatory Configuration
The filters property is required for this widget to function correctly. It defines the recommendation logic and basic data constraints.

Demo: Open demo
The onItemClick callback is fired whenever the user interacts with the widget. The first argument is a target string that identifies the interaction type; the second argument is a data object containing contextual information.
target value | Trigger | Key data properties |
|---|---|---|
"externalOutcome" | User clicks a single outcome button | externalEvent, externalMarket, externalOutcome |
"externalOutcomes" | User clicks multiple outcomes at once (e.g. combo card) | Array of { externalEvent, externalMarket, externalOutcome } |
"externalEvent" | User clicks an event header/card | externalEvent |
"externalCompetition" | User clicks a competition/league name |
Note: Widgets support callbacks on outcome clicks — the onItemClick handler receives target === "outcome" and a data object containing externalEvent, externalMarket and externalOutcome. Use this for custom outcome callbacks (e.g., add-to-betslip, analytics, modals).
The widget also exposes onTrack for event tracking analytics. See the tracking guide for details.
To keep the widget's selected-outcome state in sync with your own bet slip (i.e. show outcomes as selected when they were added outside the widget), use registerOnBetSlipChange inside registerAdapter.
// 1. Track your bet slip state
let changeCallback;
let betSlipState = { betslip: [], combinedOddsValue: undefined };
// 2. Notify the widget whenever the bet slip changes
function onBetSlipChanged
An adapter is a software component developed by the Sportradar engineering team that bridges the Bet Recommendation widgets and your platform's API. It retrieves data from your API and feeds it to the widget, ensuring seamless communication between the two systems.
Before adapter development begins, confirm and align your API contract with the Sportradar engineering team. Integration requires two SIR calls:
| SIR method | Purpose |
|---|---|
SIR('registerAdapter', ...) | Configure the adapter that retrieves and displays data from your API. |
SIR('addWidget', ...) | Mount the widget on the page. |
(function
The following data types are provided by the adapter and are also available in the onItemClick callback payload.
Event
| Property | Type | Required | Description |
|---|---|---|---|
id | string | number | Yes | Sportradar event ID. |
externalId | string | number | — | Client-side event ID. |
date | string | Yes | Formatted date string displayed in the widget. |
labelType is set to "hidden".iconType: "sport" with labelType: "sport", and iconType: "flag" with labelType: "country".activeTournamentId does not match any league in the current recommendations, no tab is highlighted — this is expected behavior, not an error.Label type: "sport", "country", or "hidden". |
iconType | string | "sport" | Icon type: "sport", "flag", or "hidden". |
onItemClick | function | undefined | Callback for league tab clicks. |
| Property | Type | Default | Description |
|---|
recommendationType | object | Required | Recommendation algorithm configuration. |
Recommendation Type Algorithm Options:
| Property | Type | Default | Description |
|---|---|---|---|
available | string | "recommended" | Required. recommendation algorithm to use. Options:
|
| Property | Type | Default | Description |
|---|---|---|---|
sport | object | undefined | Sport filter configuration. |
sport.available | array<string|number> | [] | Array of Sportradar sport IDs to include in league recommendations. Empty array or omitted shows leagues from all available sports. See Sports Reference. |
time | object | undefined | Time filter configuration for event scheduling within leagues. |
time.range | number | 0 | Time offset in hours from current time (0-72). 0 shows matches with immediate/current events. |
time.available | string | undefined | Time status filter for events within leagues. Options: "live" (only leagues with live/in-play events) or undefined (leagues with any events). When "live", widget shows only competitions currently hosting active matches. |
{
recommendationType: {
available: 'recommended' // Personalized AI recommendations
},
sport: {
available: [1, 2] // Soccer and Basketball only
},
time: {
range: 6, // Leagues with events in next 6 hours
available: undefined // Both live and upcoming events
}
}Basic popular leagues with sport icons for anonymous browsing.
JavaScript
SIR("addWidget", "#leagues-1", "betRecommendation.leagues", {
count: 8,
filters: {
recommendationType: {
available: "popular",
},
},
});HTML (data attributes)
<div
class="sr-widget"
data-sr-widget="betRecommendation.leagues"
data-count="8"
data-filters='{"recommendationType": {"available": "popular"}}'
></div>externalCompetition |
"goToBetSlip" | User clicks the "Go to Bet Slip" button (swipeBet only) | — |
"betSlipMode" | Bet slip mode changes between single and multi (swipeBet only) | value: "single" | "multi" |
SIR("addWidget", "#sr-widget", "betRecommendation.markets", {
onItemClick: function (target, data) {
if (target === "externalOutcome") {
// Add single outcome to bet slip
const { externalEvent, externalMarket, externalOutcome } = data;
betSlip.add({
eventId: externalEvent.id,
marketId: externalMarket.id,
outcomeId: externalOutcome.id,
});
} else if (target === "externalEvent") {
// Navigate to event/match detail page
window.location.href = `/matches/${data.externalEvent.id}`;
} else if (target === "externalCompetition") {
// Navigate to competition/league page
window.location.href = `/league/${data.externalCompetition.tournament.id}`;
}
},
filters: { recommendationType: { available: "popular" } },
});Until a custom adapter is developed, use the mockData adapter for local testing:
SIR("registerAdapter", "mockData", { onBetSlipChanged });sport.id | string | number | Yes | Sport ID. Use sportsMapping if not using Sportradar sport IDs. |
sport.name | string | Yes | Sport name. |
category.id | string | number | — | Category ID. |
category.name | string | Yes | Category name (e.g. "England"). |
tournament.id | string | number | — | Tournament/league ID. |
tournament.name | string | Yes | Tournament name. |
teams | Array<{id, name}> | Yes | Home and away competitors. |
isLive | boolean | Yes | Whether the event is currently live. |
liveCurrentTime | string | Yes | Live time display (e.g. "2nd set", "45'"). |
result1 / result2 / result3 | result | — | Score columns: { result: [homeScore, awayScore] }. |
Market
| Property | Type | Required | Description |
|---|---|---|---|
id | string | number | Yes | Market ID. |
name | string | — | Market name (e.g. "Match Winner"). |
status.isActive | boolean | — | When false, see Widget Behavior. |
Outcome
| Property | Type | Required | Description |
|---|---|---|---|
id | string | number | Yes | Outcome ID. |
name | string | Yes | Outcome name (e.g. "Home", "Draw"). |
odds | string | number | Yes | Odds value. Use a number type to enable odds-change indicators (up/down arrows). |
specifier.value | string | number | — | Additional specifier (e.g. handicap value "-2.50"). |
status.isActive | boolean | — | When false, see Widget Behavior. |