Skip to main content
Logo
Explore APIsContact Us
  • Home
  • Match Preview
  • Tournament Preview
  • Virtual Stadium
  • StatsHub
  1. Engagement Tools
  2. Bet Concierge API Reference and Examples

Bet Concierge API Reference and Examples

Complete API reference for the Bet Concierge widget with detailed parameter descriptions.

#API Reference

Expanded Table

PropertyTypeRequiredDefaultDescription
entityIdstringYes-Sportradar entity identifier in sr:match:{id} format (e.g., "sr:match:50955863"). See Getting Identifiers.
jwt
getJwt
string
function getJwt
Yes-User's JWT Token or a callback promise function that returns user's JWT Token for authentication. Either jwt or getJwt must be provided.
numberOfSuggestedQuestionsnumberNo3Number of suggested questions (conversation starters) to display for each category. Range: 0-5. Set to 0 to hide suggestions entirely.
isInlinebooleanNofalseWhen true, enables inline mode without close button.
disableHeaderbooleanNofalseWhen true, hides widget header.
disableHomeLinkbooleanNofalseWhen true, hides home navigation link in header.
disableCoveragebooleanNofalseWhen true, hides match coverage information. Coverage displays information about the data availability for the selected match and bet concierge capabilities in answering questions about that match.
disableChatHistorybooleanNofalseWhen true, disables chat history stored in local storage. Chat history is stored for each entityId separately with expiration time set to 1 day.
termsPagestringNo"hidden"Controls terms page display. Options:
  • "hidden": Never show terms page
  • "visible": Always show terms page
  • "visibleOnEmptyChat": Show only when there are no messages in the chat history

Terms and conditions page is meant to be displayed on the widget load. When user clicks on agree or decline buttons, AcceptTerms & DeclineTerms click actions are handled in the onAction function. Client is expected to handle these actions and show/hide 'termsPage' in the widget accordingly.
enableTermsLinkbooleanNofalseWhen true, displays terms and conditions link
enableCustomBetbooleanNofalseSet this prop to true when implementing Custom Bet feature. This will enable calculateCbXml adapter call.
enableInsightsbooleanNotrueWhen true, the widget will display insights on the start screen to users, providing them with valuable information and enhancing their engagement.
enableMarketQuestionsbooleanNofalseWhen true, the widget will display AI-generated market based questions on the start screen to users, enhancing their engagement and interaction with the available betting options.
globeIconStyle"light" | "dark"No"light"Visual style for the globe icon: "light" for light backgrounds, "dark" for dark backgrounds.
onActionfunction callbackNoOptional callback invoked when the widget needs your app to react (for example: close or hide the widget, handle terms, handle errors, or add a selection to the bet slip). See The onAction callback.

#onAction callback

Pass onAction function when you need to handle user events on bet concierge. The widget calls it with one argument: an object { type, data }.

  • type — Which category of event occurred. Use this in a switch (or equivalent) as the first branch.
  • data — Payload for that event. The shape depends on type.

#Action object

Each time the widget invokes your callback, it passes an object with the following fields:

Expanded Table

PropertyTypeDescription
type'Close' | 'Click' | 'Error' | 'AddSelectionsToBetSlip' | 'CustomBetAddToBetSlip'High-level event category. See Action types.
dataobjectPayload for that category; interpret it together with type.

#Action types

Expanded Table

typeWhen it firesdata shape
'Close'User closes the widget or declines terms (see data.source).CloseBetConcierge or DeclineTerms
'Click'User clicks on one of the links or buttons in the widget.ReadMoreTerms or AcceptTerms
'Error'Authentication or another recoverable widget error.WidgetError
'AddSelectionsToBetSlip'User selects a suggested outcome (bet suggestion flow).AddSelectionsToBetSlip
'CustomBetAddToBetSlip'User clicks Add to bet slip on a custom bet combo.CustomBetAddToBetSlip

#CloseBetConcierge

Emitted when the user closes the widget from the header (X) button. Your integration should hide or unmount the widget (or navigate away), according to how you embedded it.

Expanded Table

PropertyTypeDescription
source'CloseSolution'Literal discriminator for this payload.
javascript
{
  source: "CloseSolution",
}

#DeclineTerms

Emitted when the user taps Decline on the terms screen. Treat it like a close action for your shell (hide the widget) and, if you track consent, record that terms were not accepted.

Expanded Table

PropertyTypeDescription
source'DeclineTerms'Literal discriminator for this payload.
entityIdstringSportradar match URN.
javascript
{
  source: "DeclineTerms",
  entityId: "sr:match:123456",
}

#ReadMoreTerms

Emitted when the user opens Read more on the 'Terms and conditions' screen. Set the enableTermsLink prop to true if this link should appear.

Expanded Table

PropertyTypeDescription
source'ReadMoreTerms'Literal discriminator for this payload.
entityIdstringSportradar match URN.

Example payload:

javascript
{
  source: "ReadMoreTerms",
  entityId: "sr:match:123456",
}

#AcceptTerms

Emitted when the user taps Agree on the 'Terms and conditions' screen. Persist consent in your app if required, then stop showing the terms screen by updating widget props (for example set termsPage to 'hidden').

Expanded Table

PropertyTypeDescription
source'AcceptTerms'Literal discriminator for this payload.
entityIdstringSportradar match URN.

Example payload:

javascript
{
  source: "AcceptTerms",
  entityId: "sr:match:123456",
}

#WidgetError

Emitted when the widget reports an error (for example JWT failure). You can use error / details for logging.

Expanded Table

PropertyTypeDescription
errorstringSummary message.
detailsstringAdditional detail.

Example payload:

javascript
{
  error: "401 Error when requesting https://sportradar.com/status",
  details: "Client token exception - Invalid token",
}

#AddSelectionsToBetSlip

Emitted when the user selects an outcome from AI-suggested markets (full integration with bet suggestion). Use the IDs to add the selection to your bet slip (or remove selection from bet slip - if selection is already in the bet slip).

Expanded Table

PropertyTypeDescription
selectionsSelectionOutcome[]Outcome selection object

Example payload:

javascript
{
  selections: [
    {
      type: "uf",
      event: "sr:match:123456",
      market: "1",
      outcome: "3",
      odds: {
        type: "eu",
        value: "2.50",
      },
    },
  ];
}

#CustomBetAddToBetSlip

Emitted when 'Bet Combo' is enabled and the user adds a combo to the bet slip by clicking on 'Add to Betslip' button on the bet combo. Map selectedOutcomes into your bet slip.

Expanded Table

PropertyTypeDescription
entityIdstringSportradar match URN.
displayedOddsstringCombined odds for the combo.
selectedOutcomesarraySelections in the combo.
selectedOutcomes.marketIdstringSportradar market ID.
selectedOutcomes.marketSpecifierstring (optional)Market specifier, when applicable.
selectedOutcomes.marketNamestringMarket display name.
selectedOutcomes.outcomeIdstringSportradar outcome ID.
selectedOutcomes.outcomeNamestringOutcome display name.

Example payload:

javascript
{
  entityId: "sr:match:61623782",
  displayedOdds: "2.95",
  selectedOutcomes: [
    {
      marketId: "1",
      outcomeId: "1",
      marketName: "1x2",
      marketSpecifier: undefined,
      outcomeName: "Ceuta",
    },
    {
      marketId: "18",
      outcomeId: "12",
      marketName: "Total Goals",
      marketSpecifier: "total=0.5",
      outcomeName: "Over 0.5",
    },
  ],
}

#Example: handle all action types

javascript
onAction: function (action) {
  const { type, data } = action;
  switch (type) {
    case "Close": {
      if (data.source === "CloseSolution") {
        // Hide or destroy the widget container (header close).
      } else if (data.source === "DeclineTerms") {
        // User declined terms; hide widget and optionally record non-consent.
      }
      break;
    }
    case "Click": {
      if (data.source === "ReadMoreTerms") {
        // Open your full terms URL.
      } else if (data.source === "AcceptTerms") {
        // Persist acceptance and set termsPage so the terms screen stays hidden.
      }
      break;
    }
    case "Error": {
      // Surface data.error / data.details to the user or your logger.
      break;
    }
    case "AddSelectionsToBetSlip": {
      // Add data.selections to the bet slip.
      break;
    }
    case "CustomBetAddToBetSlip": {
      // Map data.selectedOutcomes to your bet slip (requires enableCustomBet).
      break;
    }
    default:
      // Optional: ignore or log unexpected types for forward compatibility.
      break;
  }
},

#getJwt()

Defines the structure of a callback promise function that retrieves a JWT token for user authentication. This function gets called when the Bet Concierge widget is initialized and when token refresh is needed.

javascript
// Example implementation of getJwt function:
function getJwt() {
  return fetch("https://example.com/api/get-jwt/user123")
    .then((response) => response.json())
    .then((data) => data.token); // Must resolve to the JWT string - assuming backend returns { "token": "..." }
}

#Widget Integration

This guide provides step-by-step instructions for integrating the Sportradar Bet Concierge widget into your website. It includes details about the required components, such as an adapter developed by Sportradar's engineering team, and options for custom theming. Following these instructions will help ensure a seamless integration and an improved user experience.

#Prerequisites

Before starting, ensure you have:

info
  1. Entity ID: The Sportradar Entity identifier for the event. Example: "sr:match:50955863".
  2. JWT Authentication: Either a static JWT token or a function to retrieve one. See tutorial on how to create and use JWT.
  3. Client ID: Your Sportradar client id. Don't have Client ID? Please read how to get one.

See Getting Identifiers for information on obtaining match IDs and authentication tokens.

#Integration Examples

The Bet Concierge widget can be integrated into your website using JavaScript. There are three levels of integration, each offering different features and requiring varying levels of development effort:

This is the simplest option and requires minimal development effort. It includes an interactive AI chat widget that can answer all stats-related queries.

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 → 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

Step 1: Add Widgetloader

Add the widgetloader script to your HTML page:

html
<script>
   (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'
   });
   // Bet Concierge Widget
   SIR('addWidget', '.sr-bc-widget', 'betConcierge', {
        entityId: {ENTITY_ID},
        jwt: "{JWT}"
    });
</script>

Replace sportradar in the widgetloader URL path with your clientId, ENTITY_ID with Sportradar entity identifier in sr:match:{id} format (e.g., "sr:match:50955863"), and JWT with your JSON Web Token.

JWT can be provided as string or a callback promise function that returns string with signed JSON Web Token.

Dynamic JWT Function

javascript
async function getJwt() {
  const response = await fetch("/api/get-token");
  const data = await response.json();
  return data.jwt;
}

SIR("addWidget", ".sr-bc-widget", "betConcierge", {
  entityId: { ENTITY_ID },
  getJwt: getJwt,
});

Step 2: Create a Widget Container

Add a container element where the widget will be displayed:

html
<div class="bc-wrapper">
  <div class="sr-bc-widget"></div>
</div>

That's it! The Bet Concierge widget is now live on your page.

#Next Steps

Now that you have integration working, check Theming customization for custom styling.

Last updated 17 days ago
Is this site helpful?
Widgets, Engagement Tools, BET
OverviewData Adapter
On this page
  • API Reference
  • onAction callback
  • getJwt()
  • Widget Integration
  • Prerequisites
  • Integration Examples
  • Next Steps