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

API Reference

This page provides complete API specification for the Custom Bet widget, including two main types of integration methods, and integration examples.

#API Specification

#Core Parameters

PropertyTypeRequiredDefaultDescription
matchIdstring | numberYes-Sportradar match identifier for the event. See Getting Identifiers
dataProviderConfigUOFDataProviderConfig | DataAdapterProviderConfigYes-Configuration object for the data provider. See Data Provider Configuration
dataProvider'uofProxy' | 'custom'No'uofProxy'Selection of the type of data provider you are going to use. Options:
  • 'uofProxy': Use Unified Odds Feed proxy (standard)
  • 'custom': Use custom data provider implementation
sportIdstring | numberNo-Sport ID. If not provided we will call match info feed to get sport id.

#Display Configuration

PropertyTypeRequiredDefaultDescription
isInlinebooleanNofalseDisplay mode for the widget.
  • false: Renders as button that opens overlay modal
  • true: Renders inline without button or overlay
buttonTitlestringNo'Custom Bet'Text displayed on the button in overlay mode. Ignored when isInline is true
buttonIconstringNo-URL of icon image to display next to button text. Ignored when isInline is true
productTitlestringNo'Custom Bet'Title displayed in widget header. Customizes the branding of the bet builder
overlayWidthnumberNo720Width of overlay modal in pixels when isInline is false.
overlayParentstring | functionNodocument.bodyParent container for overlay modal. Can be CSS selector string or function returning HTMLElement. Useful for containing overlay within specific page sections
isDialogInFullScreenbooleanNofalseCustomBet widget overlay takes up full viewport width and height. Enable full-screen mode for overlay on mobile devices. Only to be used when isInline is set to false.

#Market Configuration

PropertyTypeRequiredDefaultDescription
validMarketIdsstring[]No-Whitelist of allowed market IDs. When set, only these markets appear in the widget. Array of Sportradar market identifiers. Mutually exclusive with blockedMarketIds. Must be used on widget initialization, changed dynamically will reset the state of the widget. See available market names.
blockedMarketIdsstring[]No-Blacklist of excluded market IDs and markets with specifiers. These markets will not appear in the widget. Array of Sportradar market identifiers. Mutually exclusive with validMarketIds Must be used on widget initialization, changed dynamically will reset the state of the widget. Example: ["30", "18
=5.5"]. See available market names.
mainMarketsstring[]No-Array of market IDs to feature in the main category. If not specified, the default markets will be used. YSee available market names.
categoryFeaturedItemsRecord<categoryId, marketId[]>No-Custom configuration for featured items in each category (excluding the main category). It's an object where the category ID is the key and an array of market IDs is the value. See available categories and market names and the example.
showExpandOnItemsnumberNo3Number of outcomes that is shown in the bet builder before collapsing into 1 item. This is shown only on Mobile size (width < 670px)
minNumberOfSelectionsnumberNo1Minimum number of outcome selections in the bet builder required before bet can be placed.

#Behavior Configuration

PropertyTypeRequiredDefaultDescription
useSessionStoragebooleanNofalsePersist user selections in browser session storage. When true, selections are restored if user navigates away and returns during the same session
selectedOutcomesUniqueOutcome[]No-Array of pre-selected outcomes to load on widget initialization.
addToBetslipTimeoutMsnumberNo10000Timeout in milliseconds for add-to-betslip operation. The widget will wait for the onAddToBetslip callback response for addToBetslipTimeoutMs time before displaying a timeout/error.
hideBetAssistbooleanNofalseHide Bet Assist feature. When true, removes bet assist feature from the interface.
disableCachebooleanNofalseDisable internal caching of market data. When true, forces fresh data fetch on every request. Use only for debugging; impacts performance

#Theming Configuration

PropertyTypeRequiredDefaultDescription
useClientThemingbooleanNofalseEnable integration with client CSS theming system. When true, widget inherits CSS custom properties from page. See Theming Guide for implementation details

#Development and Debug

PropertyTypeRequiredDefaultDescription
dbgbooleanNofalseEnable debug mode with verbose console logging. Use only in development environments

#Data Provider Configuration

The dataProviderConfig object implements the Custom Bet interface. We offer two main types of integration methods, each with distinct advantages depending on the level of control and customization you need.

#UOF Proxy Data Provider

The UOF Proxy integration enables direct data handling from the Unified Odds Feed (UOF), forwarding responses directly without modification. When using dataProvider: 'uofProxy', implement the following interface:

PropertyTypeDescription
getFixturegetFixtureFunction called by custom bet widget to get UOF API data from Fixture API.
getMarketsgetMarketsFunction called by custom bet widget to get UOF API data from Markets API.
calculatecalculateFunction called by custom bet widget to get UOF API data from Calculate API.
getAvailableMarketsgetAvailableMarketsFunction called by custom bet widget to get UOF API data from Available Selections API.
getProfilegetProfileFunction called by custom bet widget to get UOF API data from Competitor Profile API.
addToBetSlipaddToBetSlipThis function is called when the user clicks "Add to bet slip" button.

#Custom Data Provider

The Data Adapter approach allows for a fully customized integration, giving you complete control over how data is fetched, transformed, and displayed. When using dataProvider: 'custom', implement the following interface:

MethodParametersCallback SignatureDescription
getOfferingMatchArgs(err, data) => voidFetch complete offering including all markets and outcomes. Data must conform to Custom Bet offering schema. Widget will call getOffering function every 30s to update the offering.
calculateCalculateArgs(err, data) => voidCalculate odds for selected outcome combination. Widget will call calculate function whenever selection within widget is updated.
addToBetSlipaddToBetSlip(result) => voidThis function is called when the user clicks "Add to bet slip" button.

#Market Order

The Custom Bet widget comes with a default market order for each sport.

You can adjust which markets appear in the main category and their order, as well as promote featured items in other categories by pinning them to the top.

See available markets for a complete list.

When adding the widget to a page, two optional props are available for customization:

  • mainMarkets: An array of market IDs to display in the main category.
  • categoryFeaturedItems: An object mapping category IDs to arrays of market IDs that should appear first in their respective categories.

#Examples

js
// Display specific markets in the 'main' category.
mainMarkets: ['30', 'awayTotalCorners', '47']

// Pin specific markets to the top of the 'match' and 'teams' categories.
categoryFeaturedItems: {
  match: ['46', 'cornerRange', 'oneXtwo'],
  teams: ['homeTotalCorners', '30']
}
Last updated 13 days ago
Is this site helpful?
Widgets, Engagement Tools
OverviewIntegration
On this page
  • API Specification
  • Core Parameters
  • Display Configuration
  • Market Configuration
  • Behavior Configuration
  • Theming Configuration
  • Development and Debug
  • Data Provider Configuration
  • UOF Proxy Data Provider
  • Custom Data Provider
  • Market Order
  • Examples