Embedding widgets
Put live scores and match detail blocks on your website with one snippet. No React or framework needed; data updates while matches are played.
Quick start
- Send us the domain that will embed the widget (e.g. https://www.example.com) so it can read the data.
- Add the script tag to the page once, anywhere.
- Place a div with data-sportx-widget where it should appear. A page can hold several widgets.
<script type="module" src="https://bbidt.name/widgets/v1/embed.js"></script>
<div data-sportx-widget="livescore" data-match-url="/tran-dau/{id}"></div>Script and styles load from our servers and update with new releases; browsers may keep a previous version for up to 4 hours.
Connecting live scores to your match page
A common setup is live scores on your home page and detail blocks on your match page:
- On the live scores, set data-match-url to your match page structure, e.g. /matches/{id}.
- When a visitor clicks a match, the browser opens /matches/fm_… on your website.
- Your match page reads the id from its URL and puts it in each block's data-match-id.
<!-- /tran-dau/fm_xxxxxxxxxxxx -->
<div data-sportx-widget="match" data-block="scoreboard"></div>
<div data-sportx-widget="match" data-block="timeline"></div>
<div data-sportx-widget="match" data-block="lineups"></div>
<script>
const id = location.pathname.split("/").pop();
for (const el of document.querySelectorAll('[data-sportx-widget="match"]')) {
el.dataset.matchId = id;
}
</script>
<script type="module" src="https://bbidt.name/widgets/v1/embed.js"></script>Documentation
- Live scores →
The day's matches, linking to your match pages.
- Match detail blocks →
Each block of the match page: scoreboard, summary, timeline, statistics, shot map, lineups, player stats, standings, head to head, form, team comparison, odds.
- Country page →
A country's or continent's competitions and the day's matches, like the website's country page.
- Theming →
Colors, fonts, corner radius and CSS overrides.
- Advanced integration →
Single-page apps, the JavaScript API and Content-Security-Policy.
- Troubleshooting →
Common problems and fixes.