Skip to content

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:

  1. 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.com is a different origin).
  2. 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

Code example
<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.

AttributeValuesDefault
data-keythe key's public idrequired
data-lotterieslottery codes, comma-separated, up to 12, in display orderrequired
data-themeauto, light, darkauto (follows the visitor's system)
data-accenta hex colour without #, such as 2563ebLottevo blue
data-localeen, rothe visitor's browser language
data-badge0 hides the “Results by Lottevo” badge, from the Pro planshown
data-orderdrawn, ascending — digit games and games drawn from several drums always stay as drawndrawn

Without JavaScript, point an iframe straight at the page — it takes the same parameters, without the data- prefix:

Code example
<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.

PlanViews per dayBadge
No plan1,000always shown
Trial1,000shown
Developer10,000shown
Starter50,000shown
Pro500,000can be hidden
Enterpriseunlimitedcan 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:

HTTPcodeMeaning
403widget_origins_requiredThe key has no allowed origins, so it cannot be embedded
404widget_key_invalidUnknown, revoked or expired key
404widget_no_lotteriesNone of the named games can be shown with this key
422widget_invalidA parameter is missing or malformed; the notice names it
422widget_secret_exposedThe snippet carries the full key: use the public id, and replace the key
429widget_views_exceededThe account's widgets used up the day's views