Skip to main content
Logo
Explore APIsContact Us
  • Home
  • Match Preview
  • Tournament Preview
  • Virtual Stadium
  1. Resources
  2. Widgets
  3. Overview

Overview

Widgets, Engagement Tools
Bet slipAPI reference
Last updated 13 days ago
Is this site helpful?
On this page
  • Required Parameters
  • Integration Examples

The Custom Bet widget enables end users to combine multiple market outcomes from a single match into one combined bet with calculated odds. It is intended for sportsbook operators and betting platform developers who need to integrate a bet builder experience into their websites.

Custom Bet Inline Mode

Inline mode — widget renders directly in the page

Custom Bet Market List with Categories

Categorized market with tabs

Custom Bet Outcome Selection

Outcome selection view within a market

Custom Bet Builder with Odds

Bet builder panel with selected outcomes and calculated odds

See the Custom Bet widget demo.

#Required Parameters

The widget requires a match identifier and a data provider configuration.

Required:

  • widget-name: customBet
  • matchId: Sportradar match identifier for the event. See Getting Identifiers.
  • dataProviderConfig: Configuration object containing the functions the widget calls to fetch data and submit bet slip actions. See Data Provider Configuration.

#Integration Examples

Initialize the widget programmatically using the JavaScript API. The widget renders in the specified container element. The widget supports two data provider options: UOF Proxy for automatic UOF data handling, or Data Adapter for custom data handling.

Properties do not always transfer from the above table directly into integration code. Properties must be transformed differently for each integration method:

JavaScript/Programmatic Integration

  • Property names remain unchanged in camelCase
  • Properties become members of the 4th parameter object in SIR() call
  • Example: cardVariant: "compact"
info

In javascript integration, the properties go into an object which is passed as the 4th argument of the call ti SIR() function. Please see Global SIR API

HTML/Declarative Integration

  • Convert camelCase to lowercase with dashes, e.g. cardVariant becomes card-variant
  • Add data-sr- prefix
  • Example: cardVariant →
info

In all examples replace sportradar in the widgetloader URL path with your clientId.

Example if your clientId is client1: This URL: https://widgets.sir.sportradar.com/sportradar/widgetloader becomes this: https://widgets.sir.sportradar.com/client1/widgetloader

data-sr-card-variant
  • Example: filters.sport.hidden → Complex objects must be passed as JSON strings
  • info

    In HTML integration, the properties go into the parent HTML object as object properties, prefixed with data-sr- as explained above.

    Only base property support

    This method supports only simple (base) properties and does not support properties that require functions.

    info

    In all examples replace sportradar in the widgetloader URL path with your clientId.

    Example if your clientId is client1:

    • This URL: https://widgets.sir.sportradar.com/sportradar/widgetloader
    • becomes: https://widgets.sir.sportradar.com/client1/widgetloader
    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',
        oddsType: 'eu'
    });
    
    SIR('addWidget', '#sr-widget', 'customBet', {
        matchId: 50852263,
        dataProvider: 'uofProxy',
        dataProviderConfig: {
            getFixture,
            getMarkets,
            getAvailableMarkets,
            calculate,
            getProfile,
            addToBetSlip
        }
    });

    Standard UOF Proxy integration. The widget fetches and parses UOF XML internally. You only forward responses. For detailed instructions see UOFProxy Integration.