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

Overview

We offer two main types of integration methods, each with distinct advantages depending on the level of control and customization you need.

#1. UOF Proxy

The UOF Proxy integration enables direct data handling from the Unified Odds Feed (UOF), forwarding responses directly without modification. Here's how it works:

  • Simplicity: The integration is straightforward, requiring only that responses from the UOF be passed through without modification. We provide a 1-to-1 function setup, which simplifies integration as you don't need to handle complex transformations; we'll handle XML validation and parsing.

  • Optimization: We manage caching and optimize request volumes, meaning fewer redundant calls and better data efficiency.

  • Considerations: While UOF Proxy is streamlined, it does have some limitations. There are no customization options since it's a direct pass-through integration, and it may require a proxy server setup to serve front-end requests if one isn't already in place.

For further details, you can refer to the UOF Proxy Documentation.

#2. Data Adapter

The Data Adapter approach allows for a fully customized integration, giving you complete control over how data is fetched, transformed, and displayed. Here's what you need to know:

  • Flexibility: With this method, you determine exactly how the data is transformed and presented to match your needs. You have complete control over market and outcome names and the presentation of data in general.

  • Responsibility: This integration provides maximum flexibility, but it also comes with the responsibility of ensuring that all data transformations on the client side adhere strictly to our data specifications.

  • Customization: Ideal for applications needing personalized display options or unique data structures, the Data Adapter approach allows you to maintain the look, feel, and functionality as desired. Both integration methods support widget theme customization, enabling you to tailor the appearance to match your style. You can achieve this by applying custom CSS properties directly to the widget's underlying HTML components.

You can find more information in the Data Adapter Documentation.

#Type Definitions

#AddToBetSlipHandleResult

Object to be passed into addToBetSlip

NameTypeRequiredDescription
succeededbooleanYesTrue if outcomes were successfully validated and added to bet slip.
reasonstringNoReason for failed action, if present it will be displayed in the widget.

#CBError

Error object used to display the correct error state in the widget.

NameTypeDescription
typenumberError type:
• 1 - General: Blocks all actions except removing outcomes from bet slip in custom bet widget.
• 2 - BetStop: Blocks all actions in custom bet widget.
• 3 - Calculation: Blocks adding outcomes to bet slip
messagestringText that will be displayed for error, localization required.

#Example

javascript
callback({ type: 1, message: "Something went wrong" });

#CalculateArgs

Arguments passed to the calculate function.

NameTypeDescription
matchIdstringSportradar match ID. See Getting Identifiers
selectedOutcomesUniqueOutcome[]Array of all the selected outcomes in the widget.

#MatchArgs

NameTypeDescription
matchIdstringSportradar match ID. See Getting Identifiers

#SRMarket

NameTypeRequiredDescription
idstringYesSportradar market ID.
specifiersstringNoFor markets that have same id but different specficer.

#Status

NameTypeRequiredDescription
isActivebooleanYes
javascript
{
  isActive: false;
}

#TeamArgs

NameTypeDescription
teamIdstring

#UniqueOutcome

Represents a single selected outcome in the widget.

PropertyTypeRequiredDescription
matchIdstringYesSportradar match ID. See Getting Identifiers
marketIdnumber | stringYesMarket identifier
outcomeIdnumber | stringYesOutcome identifier
srMarketSRMarketNoSportradar market reference
srOutcomestringNoSportradar outcome identifier

#Methods:

MethodParametersReturnsDescription
equalsUniqueOutcomebooleanReturns true if the outcome is equal to the given UniqueOutcome.
isSameMarketUniqueOutcomebooleanReturns true if the outcome belongs to the same market as the given UniqueOutcome
getSelection—stringReturns XML string representation of the outcome as needed by UOF calculation endpoint
toString—stringReturns string representation of the outcome

Example:

javascript
{
  matchId: "22223333",
  marketId: "oneXtwo",
  outcomeId: "x",
  srMarket: { id: "1" },
  srOutcome: "1"
}

#Methods

#addToBetSlip

This function is called when the user clicks "Add to bet slip" button. Here you receive selected outcomes and validate them before adding them to your bet slip or reject them.

#Parameters:

NameTypeRequiredDescription
argsObjectYesObject with data.
args.matchIdstringYesMatch id of match that outcomes belong to.
args.selectedOutcomesUniqueOutcome[]YesArray of outcomes that were selected in the widget.
args.displayedOddsstringNoSnapshot of odds returned by last calculation, CAUTION: ODDS ARE NOT UP TO DATE
callbackAddToBetSlipHandleResult | booleanYesTo accept or reject call this function. If data is not received in time set by addToBetslipTimeoutMs widget prop or by defalt in 10000ms.

#Example:

Upon succesfull validation your call callback parameter and pass in AddToBetSlipHandleResult object.

javascript
function betslipCallback(args, callback) {
  if (validation(args) is succesfull) {
    callback({
      succeeded: true
    })
  } else {
    callback({
      succeeded: false,
      reason: 'Reason why it failed'
    })
  }
}
Last updated 13 days ago
Is this site helpful?
Widgets, Engagement Tools
API referenceUOF Proxy
On this page
  • 1. UOF Proxy
  • 2. Data Adapter
  • Type Definitions
  • AddToBetSlipHandleResult
  • CBError
  • CalculateArgs
  • MatchArgs
  • SRMarket
  • Status
  • TeamArgs
  • UniqueOutcome
  • Methods
  • addToBetSlip