Developer API & Embed Integration
Embed live sports video streams, real-time fixtures, and auto-switching widgets directly on your website or app.
1. Direct Stream Iframe Embed
Most Popular
Embed any live match directly into any webpage. Works across all modern browsers and handles mobile orientation automatically.
<!-- WatchTheMatch Live Stream Embed -->
<div style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;border-radius:8px;background:#000;">
<iframe src="https://watchthematch.online/embed/nba/401909952/lakers-vs-hawks"
style="position:absolute;top:0;left:0;width:100%;height:100%;border:none;"
allowfullscreen="true" scrolling="no" allowtransparency="true"
allow="encrypted-media; autoplay; fullscreen"></iframe>
</div>
Replace
nba/401909952/lakers-vs-hawks with any match target slug from our schedule.
2. Auto-Switching Live Chicane Widget
Auto-Switching
Drop this script snippet onto your site. It automatically queries the schedule API, picks the current highest-profile live game, and mounts the live player with zero maintenance needed.
<div id="wtm-player-container"></div>
<script>
(function() {
fetch('https://watchthematch.online/api/schedule?sport=all')
.then(function(r) { return r.json(); })
.then(function(data) {
var matches = data.matches || [];
var active = matches.find(function(m) { return m.is_live; }) || matches[0];
if (active && active.embed_target) {
var box = document.getElementById('wtm-player-container');
box.innerHTML =
'<div style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;border-radius:8px;background:#000;">' +
'<iframe src="https://watchthematch.online/embed/' + active.embed_target + '" style="position:absolute;top:0;left:0;width:100%;height:100%;border:0;" allowfullscreen scrolling="no" allowtransparency></iframe>' +
'</div>';
}
})
.catch(function(e) { console.error('WTM Embed Error:', e); });
})();
</script>
3. Live Schedule JSON REST API
GET /api/schedule
Fetch all currently scheduled and live matches across sports in JSON format. CORS is fully enabled (*).
Endpoint:
GET https://watchthematch.online/api/schedule?sport={sport}
Supported Sports:
Sample JSON Response:
all
soccer
nba
nfl
nhl
mma
mlb
boxing
f1
{
"status": "success",
"sport": "all",
"count": 31,
"matches": [
{
"id": "401909952",
"title": "Los Angeles Lakers vs Atlanta Hawks",
"sport": "nba",
"league": "NBA",
"team1": "Los Angeles Lakers",
"team2": "Atlanta Hawks",
"logo1": "https://a.espncdn.com/i/teamlogos/nba/500/scoreboard/lal.png",
"logo2": "https://a.espncdn.com/i/teamlogos/nba/500/scoreboard/atl.png",
"is_live": true,
"is_ended": false,
"score": null,
"embed_target": "nba/401909952/lakers-vs-hawks"
}
]
}