Match Prediction
Make predictions on a specific match market with real-time community statistics.
The Match Prediction widget lets signed-in users predict one market on a specific match. It renders the Event Card component with its prediction markets shown inline, so the card also carries the competition, both competitors and the kickoff time or live score.
<div data-component="fu-widget" data-content-type="match-prediction" data-content-id="your-match-id" data-market="FT_1X2"></div>Configuration
| Attribute | Description | Options/Format | Default |
|---|---|---|---|
data-content-id | Match ID for which predictions will be made | e.g. "fb:m:12345" | Required |
data-market | The prediction market to offer | Any market (see below) | "FT_1X2" |
data-match-prediction-market-id | The same thing under the config's name. data-market wins if both are set | Any market | data-market |
data-match-prediction-cutoff-minutes | Minutes before kickoff when predictions close. 15 is also the minimum | Integer ≥ 15 | 15 |
data-match-prediction-allow-delete | Let users remove a prediction they already made | "true", "false" | true |
data-match-prediction-template | Visual density of the event card | "compact", "standard", "hero" | "standard" |
data-match-prediction-type | Kind of card. "detailed" is reserved (not implemented yet) | "header", "detailed" | "header" |
data-match-prediction-show-competition | Show the competition header above the competitors | "true", "false" | true |
data-match-prediction-show-odds | Render betting odds. Not yet backed by the API, so currently renders nothing | "true", "false" | true |
data-match-prediction-live-refresh | Poll the events API while the event is LIVE | "true", "false" | true |
data-match-prediction-refresh-interval | Live-refresh poll interval in milliseconds. Only applies while LIVE | Positive integer | 30000 |
Every Event Card presentation prop is exposed here, because this widget is an Event Card preconfigured for a single market. It offers exactly one market, always rendered inline — there is no drawer and no multi-market option; use the Event Card widget when you want several markets or a collapsible one.
Global eventCard configuration from FuWidget.init() is deliberately not applied to this widget. It reads its own matchPrediction object instead, so Event Card defaults cannot silently alter existing prediction embeds.
Global Configuration
matchPrediction sets defaults for both this widget and Team Next Match Prediction:
FuWidget.init({
// ... other config
matchPrediction: {
marketId: "FT_1X2", // Optional: the market to offer (default: "FT_1X2")
cutoffMinutes: 15, // Optional: minutes before kickoff when predictions close (default and minimum: 15)
allowDelete: true, // Optional: let users remove a prediction (default: true)
template: "standard", // Optional: "compact", "standard" (default), or "hero"
type: "header", // Optional: "header" (default) or "detailed" (reserved)
showCompetition: true, // Optional: show the competition header (default: true)
showOdds: true, // Optional: render betting odds (default: true)
liveRefresh: true, // Optional: poll while the event is LIVE (default: true)
refreshInterval: 30000, // Optional: live-refresh interval in ms (default: 30000)
},
});Each data-match-prediction-* attribute overrides the matching field for that one element; fields you do not set as attributes keep their global value. Unlike the Event Card widget's predictions object, these merge field by field rather than replacing wholesale.
Requirements
Predictions are shown only when the visitor is signed in and the match is a football fixture the Prediction API recognizes; otherwise the event card renders without any prediction UI. Predictions close 15 minutes before kickoff by default, which is also the earliest the Prediction API accepts.
Community Statistics
Below the card, each market shows how everyone has predicted it — one bar per outcome with its share and count. They are visible to everyone, including signed-out visitors and before you predict, so the widget still says something when the prediction UI is hidden.
- 1X2, Yes/No and double-chance markets keep their conventional reading order (
1/X/2,Yes/No); the1and2bars are labelled with the team names. - Markets with a long list of outcomes — scorelines, corner counts, half-time/full-time — are ordered most-predicted first.
- A market nobody has predicted yet is omitted rather than shown as a row of zeroes.
- The player markets (
PLAYER_SCORE,PLAYER_SCORE_FIRST_GOAL, …) have no statistics: the API returns those keyed by player rather than as outcome counts.
Statistics are read once when the widget loads, bypassing the API cache, so every load shows the current counts. They do not live-update as other users predict, and they do not refresh when the current user submits — a reload picks up the new numbers.
Supported Markets
Any of the 32 markets the Prediction API supports can be used — see Widgets → Event Card → Predictions for the full list grouped by how each is answered. The most common:
1X2 Markets
FT_1X2— Full-time match result (Home win, Draw, Away win)HT_1X2— Half-time match result
Yes/No Markets
BOTH_TEAMS_SCORE— Whether both teams will scorePENALTY_MATCH— Whether there will be a penalty in the matchRED_CARD_MATCH— Whether there will be a red card in the match
Exact Score Markets
CORRECT_SCORE,CORRECT_SCORE_HT,CORRECT_SCORE_ADVANCED
Examples
Compact Card in an Article
<div
data-component="fu-widget"
data-content-type="match-prediction"
data-content-id="fb:m:12345"
data-market="BOTH_TEAMS_SCORE"
data-match-prediction-template="compact"
data-match-prediction-show-competition="false"
></div>Hero Card, Closing Four Hours Before Kickoff
<div
data-component="fu-widget"
data-content-type="match-prediction"
data-content-id="fb:m:12345"
data-market="CORRECT_SCORE_ADVANCED"
data-match-prediction-template="hero"
data-match-prediction-cutoff-minutes="240"
data-match-prediction-allow-delete="false"
></div>Features
- Any of the 32 Prediction API markets, one per widget
- Full control of the underlying event card — template, card type, competition header, odds, live refresh
- Community prediction statistics with a visual percentage bar per outcome
- One prediction record per market, each editable and removable on its own
- Read-only summary with outcome and points once the match is graded
- Competition, competitors, kickoff time and live score from the Event Card component
- Team logo and name display
Updated 3 days ago
