Tools
Lotto Results Widget for Your Website — How to Embed It
Lech Andrzejewski
In short
The widget is a regular subpage of the service embedded via an iframe tag at the /widgets/results address. Just copy one line of HTML into your template — you don't install a plugin, don't include a JavaScript file, and don't create an account. The widget doesn't set cookies, doesn't read data from your page, and has no access to its content, because an iframe from a different domain is isolated from it by the browser.
The most common use of the widget is a blog sidebar or the footer of a thematic page, where the current result of the last draw should appear without manual updates. The data comes directly from our service, so it refreshes automatically after every draw. Below we describe the code, parameters, dimensions, and limitations.
Code to copy
The tag below just needs to be pasted where the widget should appear. Set the width and height attributes according to your own layout — below we give values that work well in a typical sidebar.
<iframe src="https://pewniaki.pl/widgets/results" width="300" height="420" frameborder="0" scrolling="no" title="Lotto Draw Results" loading="lazy"></iframe>
The title attribute is mandatory for accessibility — screen readers read it as the frame's description. The loading="lazy" attribute defers loading the widget until the user scrolls to it visually; without it, the frame loads together with the rest of the page and increases the time to first display. Setting scrolling="no" only makes sense when the frame height fits the entire content — with too low a value, the content will be cut off with no way to scroll.
Address parameters
The widget's behavior changes through parameters appended to the address after the question mark. Successive parameters are separated by an ampersand. Values outside the allowed range are ignored — the widget then reverts to the default setting instead of returning an error.
| Parameter | Allowed values | Default | What it changes |
| gra | lotto, lotto-plus, eurojackpot, mini-lotto, multi-multi, kaskada | all | limits the widget to a single game |
| limit | 1–10 | 1 | number of draws shown |
| motyw | light, dark | light | background and text color |
Example address with two parameters: /widgets/results?gra=eurojackpot&limit=3 — the widget will then show the three most recent Eurojackpot draws and nothing else. You can always find the full results of all games on the service's home page.
What dimensions to set
The widget scales to the frame's width, but below 260 pixels the number balls start wrapping to a second line and the layout stops being readable. The height depends on the number of displayed draws — the values below are a starting point, not a strict rule.
- one draw, sidebar: 300 × 420 pixels
- three draws, sidebar: 300 × 760 pixels
- bar above the footer, full width: 100% × 300 pixels
If you set the width to 100 percent, remember to give the frame a fixed height in pixels. An iframe without a declared height defaults to 150 pixels and the content gets cut off. Reserving the height in advance also prevents a layout jump the moment the frame finishes loading.
What the widget does not send
A frame embedded from a different domain is subject to the same-origin policy built into every browser. In practice this means three things: the widget cannot read your page's content, cannot read its cookies, and cannot execute any script on it. The dependency also works the other way — your page has no insight into the frame's interior.
The widget itself does not set cookies or store anything in the browser's local storage. It does not load advertising scripts or analytics tools. The server logs standard call data — the IP address, the browser header, and the referring page address — just like with any other HTTP request, and does not link them to any user profile. Details are described in our privacy policy.
Because the widget does not store cookies, embedding it does not require you to extend your own consent banner. However, if your page uses a tool that blocks external frames until consent is given, the widget will be covered by that block along with the others — this is a setting on your side, not on ours.
Data updates and what to do when there's no result
The data in the widget comes from the same source as the rest of the service and refreshes after every draw. The frame does not poll the server in the background — it shows the state from the moment the page was loaded. If a visitor leaves your site open for several hours and a draw takes place during that time, they will see the new result only after refreshing.
When the widget displays an empty frame, start by opening its address directly in a new tab. If the page works correctly there, the cause lies with the embedding — most often it is your server's Content-Security-Policy header, restricting the list of domains allowed in the frame-src directive. The second common cause is an ad-blocking extension that strips frames from external domains regardless of their content.
Alternatives to the frame
If an iframe is not an option — for example in a newsletter or in a system that strips foreign frames — two paths remain. The first is a plain link to the Lotto results page, which always leads to the current draw. The second is an RSS feed with results, which can be pulled into your own system and rendered in your own way.
The RSS feed is available separately for each game at /wyniki/gra/rss.xml — for example /wyniki/eurojackpot/rss.xml. It returns a standard XML document with the draw date and drawn numbers in the item description, so it can be read by any reader and most content management systems. This solution requires code on your side but gives full control over the appearance.
Games of chance are intended exclusively for adults (18+). The results presented in the widget are for informational purposes only — the only binding source is the draw protocol of Totalizator Sportowy. The historical frequency of numbers describes the past and does not change the probability of subsequent draws, because each of them is independent.
Tags: widget iframe results tools