Pitch embed
A live pitch for any event: ball, current action, attack zones, score, clock and the latest incidents. Drop it in with an <iframe>; no front-end work is needed.
1. Create a token on your server
Your API key must never reach the browser. Exchange it for a short-lived embed token bound to one event and to the sites allowed to show it:
curl -X POST https://api.eventsfeed.dev/v1/embed/tokens \
-H "Authorization: Bearer $EVENTSFEED_KEY" -H "Content-Type: application/json" \
-d '{"eventId":"ev_k2m9x4q8zt","ttl":10800,"origins":["https://www.example.com"]}'
{
"data": {
"token": "eyJ2Ijox….Q3KiRnO0Q",
"expiresAt": "2026-11-15T23:00:00.000Z",
"iframeUrl": "https://embed.eventsfeed.dev/pitch/ev_k2m9x4q8zt?token=eyJ2Ijox….Q3KiRnO0Q",
"html": "<iframe src=\"https://embed.eventsfeed.dev/pitch/ev_k2m9x4q8zt?token=…\" width=\"100%\" height=\"300\" …></iframe>"
}
}
ttl: 60 to 86,400 seconds (default 3,600). Cover the match: about 3 hours is a good default. Once expired, viewers are disconnected.origins: up to 10https://origins allowed to frame the widget. Browsers refuse to render it anywhere else (Content-Security-Policy: frame-ancestors).http://localhostis accepted for development.- Creating a token costs 1 request. You can cache and reuse one token for every visitor of that event page.
2. Put it on the page
Plain iframe:
<iframe src="IFRAME_URL&lang=pt&theme=dark" width="100%" height="300"
style="border:0;max-width:560px" loading="lazy" title="Live pitch"></iframe>
Or with the loader, which sizes the iframe to its content and forwards events:
<div data-eventsfeed-pitch data-src="IFRAME_URL&lang=en"></div>
<script src="https://embed.eventsfeed.dev/v1/embed.js" async></script>
<script>
document.addEventListener('eventsfeed:goal', e => console.log('goal!', e.detail.score));
</script>
| Parameter | Values |
|---|---|
lang |
en (default), pt, es |
theme |
dark (default), light |
Events sent to the host page
The widget posts messages to window.parent: {source: "eventsfeed", type, eventId, …} with type one of resize (height), goal (score), card or ended. The loader re-dispatches them as DOM events eventsfeed:goal, eventsfeed:card and eventsfeed:ended on the container.
Limits
Embed viewers do not use your 3 WebSockets. Each token serves up to 1,000 simultaneous viewers; issue more tokens for bigger audiences. Revoking the API key disables its embeds immediately.