Odds

One event's betting odds for one market from a preferred operator, with movement arrows, flash mode and a betslip hand-off.

A single event's betting odds for one market — the operator's branded box, then each outcome with its price. Prices refresh on an interval and show an arrow when they move. It is the same strip the Predictor, TopX, Event Card, Competitor Card and Competition Statistics widgets render, on its own, so it can sit anywhere in an article.

📘

No authentication required — this widget never needs tokenString, tokenCookieName, or firebase in your config. See Getting Started → Authentication → Read-only widgets.

<div data-component="fu-widget" data-content-type="odds" data-content-id="fb:m:536871"></div>

Configuration Attributes

AttributeDescriptionOptions/FormatDefault
data-content-idSports API event IDe.g. "fb:m:536871"Required
data-odds-marketThe market to show — see Markets belowMarket code"FT_1X2"
data-odds-sizeHow much room the strip takes. "compact" is a fixed-height row"default", "dense", "compact""default"
data-odds-mode"flash" alternates the operator logo and the prices instead of showing both"default", "flash""flash" on compact, "default" otherwise
data-odds-flash-intervalFlash interval in milliseconds. Ignored unless the mode is "flash"Positive integer3000
data-odds-polling-intervalOdds poll interval in milliseconds. 0 fetches onceInteger ≥ 030000
data-odds-operatorsComma-separated operator config ids, in preference order — one operator is shown, the first that prices the market completelye.g. "betano-bg,efbet-bg"First operator with prices
data-odds-affiliate-idAffiliate id substituted into every operator URL carrying an {affiliate_id} placeholderAffiliate id stringNone
data-odds-affiliate-idsJSON object of per-operator affiliate ids. Wins over data-odds-affiliate-ide.g. '{"betano-bg":"aff-123"}'None
data-odds-labelsJSON object overriding the strip's strings. {{line}} in over / under is replaced with the market's line'{"title":"Match odds","over":"Over {{line}}"}' — keys title, yes, no, over, underLocale strings
data-odds-add-to-betslipPush a clicked price into the Betslip widget on the page"true", "false"false

Per-element attributes override the global odds config field by field, including inside affiliateIds and labels.

Markets

MarketOutcomesNotes
FT_1X21 · X · 2Full time. Falls back to the two-way WINNER_OT (1 · 2) for a sport that cannot be drawn
HT_1X21 · X · 2Half time. Currently renders nothing — the odds API scopes it to the first half, which the SDK filters out
BOTH_TEAMS_SCOREYES · NO
OVER_GOALS_0_5 … OVER_GOALS_6_5OVER · UNDEREvery half-goal line from 0.5 to 6.5
OVER_CORNERS_6_5 … OVER_CORNERS_13_5OVER · UNDEREvery half-corner line from 6.5 to 13.5. Rendered only where an operator publishes them

When no operator prices the market completely, nothing renders.

Sizes

ValueLayout
"default"The full strip — the operator's box, then each outcome of the market
"dense"The same strip in less room
"compact"A fixed-height row that alternates the operator and the prices ("flash" mode) unless data-odds-mode says otherwise

Betslip

The widget owns no betslip. Set data-odds-add-to-betslip="true" to push a clicked price into the Betslip widget on the same page as a selection ({matchId}:{market}:{outcome} — e.g. fb:m:536871:OVER_GOALS_2_5:OVER, the same id FuWidget.betslip.setSelection takes). The operator's own link opens on click either way.

To observe clicks yourself, set odds.callbacks.onAddToBetslip in FuWidget.init(). It receives { matchId, market, pick, odd, operatorId } — market is the code the price came from, so "WINNER_OT" when FT_1X2 fell back to it — and runs whether or not addToBetslip is on. It takes an argument, so there is no data-attribute equivalent.

<div
	data-component="fu-widget"
	data-content-type="odds"
	data-content-id="fb:m:536871"
	data-odds-market="OVER_GOALS_2_5"
	data-odds-operators="betano-bg"
	data-odds-add-to-betslip="true"
></div>
<div data-component="fu-widget" data-content-type="betslip"></div>

Global Configuration

Set defaults for all Odds widgets in FuWidget.init():

FuWidget.init({
	// ... other config
	odds: {
		market: "FT_1X2",
		size: "default",
		mode: "default",
		flashInterval: 3000,
		pollingInterval: 30000,
		operators: ["betano-bg", "efbet-bg"], // Preference order — one operator is shown
		affiliateId: "aff-123", // Substituted into operator URLs carrying {affiliate_id}
		affiliateIds: { "efbet-bg": "aff-456" }, // Per operator; wins over affiliateId
		labels: { title: "Match odds", over: "Over {{line}}", under: "Under {{line}}" },
		addToBetslip: true,
		callbacks: {
			onAddToBetslip: (selection) => console.log(selection), // Optional: observe clicked prices
		},
	},
});

Examples

Over/Under 2.5 Goals in a Sidebar

<div
	data-component="fu-widget"
	data-content-type="odds"
	data-content-id="fb:m:536871"
	data-odds-market="OVER_GOALS_2_5"
	data-odds-size="dense"
></div>

Flashing Both-Teams-to-Score Row

<div
	data-component="fu-widget"
	data-content-type="odds"
	data-content-id="fb:m:536871"
	data-odds-market="BOTH_TEAMS_SCORE"
	data-odds-size="compact"
	data-odds-labels='{"title":"Both teams to score"}'
></div>

Features

  • One event, one market: 1X2 (two-way for sports that cannot be drawn), half-time 1X2, both teams to score, over/under goals and corners
  • One operator, picked from your preference order — the first that prices the market completely
  • default, dense and compact sizes; compact flashes the operator and the prices
  • Price movement arrows, refreshed on a configurable interval
  • Affiliate ids substituted into the operator links, globally or per operator
  • Betslip hand-off via data-odds-add-to-betslip, plus an onAddToBetslip observer
  • Renders nothing when no operator prices the market completely

Did this page help you?