Integration guides
Results on your site, in one snippet.
Embed the latest results and announced jackpots of the games you choose on any site you own — styled to match it, sized to its content, never more than a minute behind when the page loads.
A widget is a small page served by the API and shown in an iframe. It lists the games you name,
each with its latest numbers, when it draws next and the jackpot announced for that draw. Visitors
click through to the game's page on Lottevo. Nothing to host, nothing to keep up to date.
Before you start
A widget runs under one of your API keys, and can only be shown on the sites that key allows:
- In API keys, create a key with read scopes only and add your site
as an allowed origin — scheme and host, such as
https://example.com. Add each address it is served from (https://www.example.comis a different origin). - Open Widgets, pick the key and the games, and copy the snippet. The preview shows exactly what your visitors will see.
The browser itself enforces the origins: the widget answers with a frame-ancestors policy that lists
them, so it cannot be framed anywhere else.
The snippet
<div data-lottevo-widget data-key="lv_a1b2c3d4e5f6" data-lotteries="EU-002,RO-001"></div>
<script src="https://api.lottevo.com/widgets/embed.js" async></script>
data-key is the key's public id — lv_ and its prefix, without the secret. The full key must
never appear in a page; a widget that carries one is refused with widget_secret_exposed, and
the key should be replaced. One script tag serves any number of widgets on the page, and each
frame grows to fit its content.
| Attribute | Values | Default |
|---|---|---|
data-key | the key's public id | required |
data-lotteries | lottery codes, comma-separated, up to 12, in display order | required |
data-theme | auto, light, dark | auto (follows the visitor's system) |
data-accent | a hex colour without #, such as 2563eb | Lottevo blue |
data-locale | en, ro | the visitor's browser language |
data-badge | 0 hides the “Results by Lottevo” badge, from the Pro plan | shown |
data-order | drawn, ascending — digit games and games drawn from several drums always stay as drawn | drawn |
Without JavaScript, point an iframe straight at the page — it takes the same parameters, without
the data- prefix:
<iframe src="https://api.lottevo.com/widgets/results?key=lv_a1b2c3d4e5f6&lotteries=EU-002,RO-001"
width="100%" height="320" style="border:0" title="Lottery results"></iframe>
Which games
The games the key may read: on a plan with a selection of games, only those; a game outside it is left out of the widget. An account with no plan keeps its widgets, without the high-frequency games (Keno and similar).
Views and plans
Every time a widget is shown counts as one view, for the whole account across its keys, per UTC day. Views are not API requests: they do not touch your request quota or its alerts.
| Plan | Views per day | Badge |
|---|---|---|
| No plan | 1,000 | always shown |
| Trial | 1,000 | shown |
| Developer | 10,000 | shown |
| Starter | 50,000 | shown |
| Pro | 500,000 | can be hidden |
| Enterprise | unlimited | can be hidden |
Past the day's allowance the widget shows a short notice until midnight UTC. Your dashboard shows the day's views and the refused ones. Each game's card is cached for a minute, so a result reaches the widget at most a minute after it reaches the API.
Notices
When a widget cannot be shown, the frame shows a notice with a code instead:
| HTTP | code | Meaning |
|---|---|---|
| 403 | widget_origins_required | The key has no allowed origins, so it cannot be embedded |
| 404 | widget_key_invalid | Unknown, revoked or expired key |
| 404 | widget_no_lotteries | None of the named games can be shown with this key |
| 422 | widget_invalid | A parameter is missing or malformed; the notice names it |
| 422 | widget_secret_exposed | The snippet carries the full key: use the public id, and replace the key |
| 429 | widget_views_exceeded | The account's widgets used up the day's views |