Skip to main content
Logo
Explore APIsContact Us
  • Home
  • Match Preview
  • Tournament Preview
  • Virtual Stadium
  • StatsHub
  1. Engagement Tools
  2. Swipe Bet

Swipe Bet

Widgets, Engagement Tools, BET
Bet SlipPlayer Prop Zone
Last updated 13 days ago
Is this site helpful?
On this page
  • Key Capabilities
  • UI and Placement Options
  • Settings and Customization
  • Styling Options
  • Requirements
  • Main Configurable Features
  • API Reference
  • Basic Properties
  • Theming
  • Integration
  • Widget Setup
  • onItemClick
  • Total Odds Sync
  • Bet Slip Sync
  • Adapter Setup
  • Data Types
  • Tips

Swipe Bet widget is a front-end widget that provides a personalized betting experience and a fun way for punters to create multi bets. The main feature is the user interface that allows punters to quickly add selections to the bet slip by swiping event cards to the right and removing events they are not interested in by swiping left.

  • Punters past activity
  • General betting trends
  • Overall betting volume
  • Seasonal variations
  • New discovery and engagement patterns
info

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.

#Key Capabilities

Gamified Interface

Fun, "swipe-to-bet" interaction style that increases user session duration and engagement.

Smart Recommendations

Tailors a list of high-relevance betting opportunities based on individual punter history.

Discovery Flow

Surface interesting matches and markets that users might otherwise overlook in traditional menus.

Live & Pre-match

Supports real-time swiping for live events and discovery for upcoming pre-match fixtures.

Lean Integration

Minimal technical overhead required to embed this innovative betting feature.

Design Liberty

Complete control over visual elements and interaction cues to fit your platform's USP.

#UI and Placement Options

Intuitive Gestures

Tinder-like navigation: swipe right to add to bet slip, swipe left to dismiss and see the next idea.

Modal Experience

Opens in an elegant overlay, allowing users to browse bets without losing their place on your site.

Multi-Bet Builder

Seamlessly combine selections from multiple swiped cards into a high-value accumulator.

Universal Trigger

Place the launch button anywhere—from the home page to specific tournament or profile sections.

#Settings and Customization

  • Mode: user select, single, or multi bet
  • Recommendation type: recommended (default), popular, or trending
  • Time span: live, upcoming, or both (default)
  • Sport filter: single sport or multiple sports
  • Widget name
  • Mobile/desktop mode

#Styling Options

  • Elements (container, cards, buttons): colors, rounded corners, icons
  • Text: font styles and colors

#Requirements

  • Access to the client API

  • Required endpoints: User ID, Odds, Bet slip content, combined odds for multi bets

  • 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.swipeBet

Environment Requirements

Technical Requirements:

  • JavaScript enabled
  • XMLHttpRequest support for data fetching
  • CSS3 support for styling and animations

Supported Sports

  • American Football NFL only (including NCAA)
  • Aussie Rules
  • Badminton
  • Bandy
  • Baseball & MLB
  • Basketball & NBA (including NCAA)
  • Beach soccer
  • Beach Volleyball
  • Cricket
  • Curling
  • Cycling
  • Darts
  • Field Hockey
  • Floorball
  • Futsal
  • Golf
  • Handball
  • Ice Hockey & NHL
  • Pesapallo
  • Rugby (League & Union)
  • Snooker
  • Soccer
  • Squash
  • Table Tennis
  • Tennis
  • Volleyball
  • Waterpolo
  • Winter sports

#Main Configurable Features

See the Swipe Bet widget demo. Illustrations of main interaction modes and configurations with relevant property values below.

Mobile View

Full-screen mobile interface with swipe gestures for rapid bet selection.

See [Swipe Bet widget demo]()

#API Reference

#Basic Properties

PropertyTypeDefaultDescription
userstring|number0User identifier for personalized recommendations.
buttonTitlestring|false"Swipe Bet"Text displayed on button trigger.
productTitlestring"SWIPE BET"
Title displayed in widget header.
headerIconstringundefinedCustom icon URL for widget header.
buttonIconstring|falseundefinedCustom icon URL for button trigger.
maxSelectionsMultiModenumber12Maximum selections in multi bet mode (1-20).
maxSelectionsSingleModenumber12Maximum selections in single bet mode (1-20).
isMobilebooleanfalseRendering mode (mobile or desktop).
betSlipModearray<string>["multi"]Available betting modes: "single", "multi", or both.
outcomeNamePositionstring"start"Outcome label position: "start", "end", "top", or "bottom".
customLoaderImgstringundefinedURL for custom loading image.
customLoaderMsnumber250Duration to display custom loader (ms).
onItemClickfunctionundefinedCallback for user interactions.

Extended Properties

PropertyTypeDefaultDescription
filtersobjectRequiredConfiguration object for sport and time filters. See below for detailed structure.
disableLazyLoadbooleanfalseControls lazy loading behavior. When true, widget content loads immediately on page load instead of deferring until user interaction. Set true for standalone mode or when immediate display required. Default false optimizes initial page performance.
sportsMappingobjectundefinedMaps client's sport identifiers to Sportradar sport IDs. Object with keys as client sport IDs (string/number) and values as Sportradar sport IDs. Example: {101: 1, 102: 2} maps client IDs 101/102 to soccer/basketball.
customJerseysobjectundefinedCustom team jersey/logo images for match cards. Nested object structure: {sportId: {tournamentId: {teams: {teamId: {home: url, away: url}}, default: {home: url, away: url}}}}. Allows branded team visuals per sport and tournament.
debugbooleanfalseEnables debug mode with console logging for development. When true, logs recommendation fetch, swipe actions, bet selections, errors. Use for troubleshooting integration issues.

Filters Object

The filters object controls available sports and time ranges for bet recommendations.

PropertyTypeDefaultDescription
sportobjectRequiredSport filter configuration.
sport.availablearray<string|number>[]Required. Array of Sportradar sport IDs to include in recommendations. Empty array shows all available sports. Example: [1, 2, 5] for soccer, basketball, tennis. See Sports Reference.
timeobjectRequiredTime filter configuration.
time.available

Filters Example

javascript
{
  sport: {
    available: [1, 2, 5, 23]  // Soccer, Basketball, Tennis, Volleyball
  },
  time: {
    available: "not_started",  // Upcoming events only
    range: 24                   // Next 24 hours
  }
}

#Theming

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-swipebet selector class. This ensures that the custom styles only apply to that widget and not to other elements on the page.

Custom class selectors

CSS classSupported CSS properties
srct-br-containerbackground-color, font-family
srct-br-headerbackground-color, color, border-radius
srct-br-header__titlefont-size, color
srct-br-header__dividerborder-color
srct-br-content__titlefont-weight
srct-br-footerfont-size, color, background-color, border-radius
srct-br-loadingbackground-color, border-radius
srct-br-navigationbackground-color, color
srct-br-cardbackground-color, color, border-radius
srct-br-card__dividerborder-color
srct-br-outcomebackground-color, color, border-radius, border
srct-br-outcome--selectedbackground-color, color, border-radius, border
srct-br-outcome--disabledbackground-color, color, border-radius
srct-br-outcome__namefont-size, color, opacity
srct-br-outcome__valuefont-size, color, font-weight
srct-br-eventinfofont-size, color
srct-br-eventinfo__iconcolor
srct-br-eventinfo__timefont-size, color
srct-br-eventinfo__statusfont-size, color
srct-br-eventinfo__namefont-size, color
srct-br-scoreboardfont-size, color
srct-br-scoreboard__teamsfont-size, color
srct-br-scoreboard__scoresfont-size, color
srct-br-customjerseymask-image
srct-br-widgetbuttonfont-size, color, border-radius, padding, background-color
srct-br-widgetbutton__iconheight, width
srct-br-closebuttonfont-size, color, border-radius, background-color
srct-br-thumbbackground-color, border-radius
srct-br-thumb--likebackground-color, border-radius
srct-br-thumb--dislikebackground-color, border-radius
srct-br-thumb--activebackground-color, border-radius
srct-br-thumb--disabledbackground-color, border-radius
srct-br-thumb__iconcolor
srct-br-thumb__icon--activecolor
srct-br-thumb__icon--disabledcolor
srct-br-thumb__icon--likecolor
srct-br-thumb__icon--dislikecolor
srct-br-bet-countercolor, background-color
srct-br-marketselectionbuttonfont-size, color, border-radius, border-color, background-color
srct-br-marketselectionbutton--disabledfont-size, color, border-radius, border-color, background-color
srct-br-market__namefont-size, color
srct-br-market__change-textfont-size, color
srct-br-market__change-iconwidth, height
srct-br-betslipbuttonfont-size, color, border, border-radius, background-color, opacity

#Integration

warning

Mandatory Configuration The filters property is required for this widget to function correctly. It defines the recommendation logic and basic data constraints.

Bet Recommendation technical guide

Demo: Open demo

#Widget Setup

#onItemClick

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 valueTriggerKey data properties
"externalOutcome"User clicks a single outcome buttonexternalEvent, externalMarket, externalOutcome
"externalOutcomes"User clicks multiple outcomes at once (e.g. combo card)Array of { externalEvent, externalMarket, externalOutcome }
"externalEvent"User clicks an event header/cardexternalEvent
"externalCompetition"User clicks a competition/league nameexternalCompetition
"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"
javascript
SIR("addWidget", "#sr-widget", "betRecommendation.markets", {
  onItemClick: function (target, data) {
    if (target === "externalOutcome") {
      // Add single outcome to bet slip
      const { externalEvent, externalMarket, externalOutcome } =














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.

#Total Odds Sync

The onTotalOddsChanged adapter method lets you provide pre-calculated total odds for combo tickets displayed in the widget (used by My Combo and Swipe Bet). When a user's selection changes, the widget calls this method with the current set of outcomes and expects you to return the computed total odds.

Register it alongside your adapter:

javascript
function onTotalOddsChanged(args, callback) {
  // Replace with your own odds calculation implementation
  const oddsResponse = getOdds(args);
  callback(oddsResponse);
}

SIR("registerAdapter", "{ADAPTER_NAME}", {
  onTotalOddsChanged: onTotalOddsChanged,
});
SIR("addWidget", "#sr-widget", "betRecommendation.myCombo");

OddsRequest — passed to onTotalOddsChanged as args:

PropertyTypeDescription
oddsArray<Outcome>Array of outcomes whose combined odds should be returned.

Outcome (item in odds array):

PropertyTypeDescription
eventIdstringSportradar event ID.
outcomeIdstringSportradar outcome ID.
marketIdstringSportradar market ID.
specifierstringMarket specifier value.

OddsResponse — returned via callback:

PropertyTypeDescription
oddsArray<OutcomesResponse>Array of outcome groups with calculated total odds.

OutcomesResponse (item in response odds array):

PropertyTypeDescription
outcomesArray<Outcome>The outcomes this total odds value applies to. Do not mutate these objects.
totalOddsstring | numberCalculated total odds for the combination. Use a string for display-formatted values.

#Bet Slip Sync

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.

javascript
// 1. Track your bet slip state
let changeCallback;
let betSlipState = { betslip: [], combinedOddsValue: undefined };

// 2. Notify the widget whenever the bet slip changes
function onBetSlipChanged(callback) {
  changeCallback = callback;
  changeCallback && changeCallback(betSlipState); // push current state immediately
}

// 3. Handle outcome clicks from the widget
function onItemClick(target, data) {
  if (target === "externalOutcome") {
    const newBet = {
      externalEventId: data.externalEvent.id,
      externalMarketId: data.externalMarket.id,
      externalOutcomeId: data.externalOutcome.id,
      externalSpecifierId: data.externalMarket.specifier
        ? data.externalMarket.specifier.value
        : undefined,
    };
    betSlipState = {
      betslip: [...betSlipState.betslip, newBet],
      combinedOddsValue: "14.52", // replace with your own calculation
    };
    changeCallback && changeCallback(betSlipState);
  }
}

// 4. Register adapter with bet slip sync + add the widget
SIR("registerAdapter", "{ADAPTER_NAME}", { onBetSlipChanged });
SIR("addWidget", "#sr-widget", "betRecommendation.markets", { onItemClick });

Until a custom adapter is developed, use the mockData adapter for local testing:

javascript
SIR("registerAdapter", "mockData", { onBetSlipChanged });

#Adapter Setup

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 methodPurpose
SIR('registerAdapter', ...)Configure the adapter that retrieves and displays data from your API.
SIR('addWidget', ...)Mount the widget on the page.
javascript
(function (a, b, c, d, e, f, g, h, i) {
  a[e] ||
    ((i = a[e] =
      function () {
        (a[e].q = a[e].q || []).push(arguments);
      }),
    (i.l = 1 * new Date()),
    (i.o = f),
    (g = b.createElement(c)),
    (h = b.getElementsByTagName(c)[0]),
    (g.async = 1),
    (g.src = d),
    g.setAttribute("n", e),
    h.parentNode.insertBefore(g, h));
})(
  window,
  document,
  "script",
  "https://widgets.sir.sportradar.com/sportradar/widgetloader",
  "SIR",
  { language: "en" },
);

SIR("registerAdapter", "{ADAPTER_NAME}");
SIR("addWidget", "#sr-widget", "betRecommendation.markets");

#Data Types

The following data types are provided by the adapter and are also available in the onItemClick callback payload.

Event

PropertyTypeRequiredDescription
idstring | numberYesSportradar event ID.
externalIdstring | number—Client-side event ID.
datestringYesFormatted date string displayed in the widget.
sport.idstring | numberYesSport ID. Use sportsMapping if not using Sportradar sport IDs.
sport.namestringYesSport name.
category.idstring | number—Category ID.
category.namestringYesCategory name (e.g. "England").
tournament.idstring | number—Tournament/league ID.
tournament.namestringYesTournament name.
teamsArray<{id, name}>YesHome and away competitors.
isLivebooleanYesWhether the event is currently live.
liveCurrentTimestringYesLive time display (e.g. "2nd set", "45'").
result1 / result2 / result3result—Score columns: { result: [homeScore, awayScore] }.

Market

PropertyTypeRequiredDescription
idstring | numberYesMarket ID.
namestring—Market name (e.g. "Match Winner").
status.isActiveboolean—When false, see Widget Behavior.

Outcome

PropertyTypeRequiredDescription
idstring | numberYesOutcome ID.
namestringYesOutcome name (e.g. "Home", "Draw").
oddsstring | numberYesOdds value. Use a number type to enable odds-change indicators (up/down arrows).
specifier.value

#Tips

  • When betSlipMode is configured with multiple modes (e.g. ['multi', 'single']), only the first mode is active on mobile — tabs are not displayed in mobile mode.
string
undefined
Time/status filter option. Values: "live" (live events only), "not_started" (upcoming events only). When omitted, shows both live and upcoming events.
time.rangenumberundefinedTime range in hours for upcoming events. Range: 0-72 hours. Example: 24 shows events starting within next 24 hours. Only applicable when time.available is "not_started" or omitted.

Basic swipe bet widget - button mode

JavaScript

javascript
SIR("addWidget", "#swipe-bet-1", "betRecommendation.swipeBet", {
  productTitle: "SWIPE BET",
  isMobile: false,
  filters: {
    sport: {
      available: [1, 2, 5],
    },
    time: {
      available: "not_started",
      range: 24,
    },
  },
});

HTML (data attributes)

html
<div
  class="sr-widget"
  data-sr-widget="betRecommendation.swipeBet"
  data-product-title="SWIPE BET"
  data-is-mobile="false"
  data-filters='{"sport": {"available": [1, 2, 5]}, "time": {"range": 24}}'
></div>
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" } },
});
string | number
—
Additional specifier (e.g. handicap value "-2.50").
status.isActiveboolean—When false, see Widget Behavior.