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 needstokenString,tokenCookieName, orfirebasein 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
| Attribute | Description | Options/Format | Default |
|---|---|---|---|
data-content-id | Sports API event ID | e.g. "fb:m:536871" | Required |
data-odds-market | The market to show — see Markets below | Market code | "FT_1X2" |
data-odds-size | How 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-interval | Flash interval in milliseconds. Ignored unless the mode is "flash" | Positive integer | 3000 |
data-odds-polling-interval | Odds poll interval in milliseconds. 0 fetches once | Integer ≥ 0 | 30000 |
data-odds-operators | Comma-separated operator config ids, in preference order — one operator is shown, the first that prices the market completely | e.g. "betano-bg,efbet-bg" | First operator with prices |
data-odds-affiliate-id | Affiliate id substituted into every operator URL carrying an {affiliate_id} placeholder | Affiliate id string | None |
data-odds-affiliate-ids | JSON object of per-operator affiliate ids. Wins over data-odds-affiliate-id | e.g. '{"betano-bg":"aff-123"}' | None |
data-odds-labels | JSON 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, under | Locale strings |
data-odds-add-to-betslip | Push 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
| Market | Outcomes | Notes |
|---|---|---|
FT_1X2 | 1 · X · 2 | Full time. Falls back to the two-way WINNER_OT (1 · 2) for a sport that cannot be drawn |
HT_1X2 | 1 · X · 2 | Half time. Currently renders nothing — the odds API scopes it to the first half, which the SDK filters out |
BOTH_TEAMS_SCORE | YES · NO | |
OVER_GOALS_0_5 … OVER_GOALS_6_5 | OVER · UNDER | Every half-goal line from 0.5 to 6.5 |
OVER_CORNERS_6_5 … OVER_CORNERS_13_5 | OVER · UNDER | Every 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
| Value | Layout |
|---|---|
"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,denseandcompactsizes;compactflashes 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 anonAddToBetslipobserver - Renders nothing when no operator prices the market completely
Updated about 9 hours ago
