Embeddable Result Widgets
Add latest lottery results to a customer site with a copy-ready iframe or JavaScript loader without exposing an API key.
Section
06 / 27
Live API examples
Jump from the docs to real public pages that use the same read models.
Endpoints
/widgets/latestEmbeddable HTML iframe for latest public lottery results.
/widgets/latest.jsJavaScript loader that inserts the latest-result iframe.
Copy-ready widget builder
Start with a browser-safe Maryland Pick 3 embed. It uses the public widget route, includes attribution, shows source confidence, and never exposes a customer API key.
Iframe snippet
<iframe src="https://lotteryfeedapi.com/widgets/latest?game_code=md-pick3-midday&style=latest-card&theme=light&limit=1" title="Maryland Pick 3 Midday latest result" loading="lazy" referrerpolicy="strict-origin-when-cross-origin" style="width:100%;max-width:420px;height:230px;border:0;border-radius:8px;overflow:hidden" ></iframe>
JavaScript snippet
<script async src="https://lotteryfeedapi.com/widgets/latest.js?v=2026-06-29.1" data-game-code="md-pick3-midday" data-style="latest-card" data-theme="light" data-limit="1" data-height="230px" ></script>
Iframe embed
Use the iframe route when you want the most predictable integration. The widget reads the same compact latest-result feed as the public API, caps rows for fast rendering, shows public source-confidence labels, and never requires a bearer token in browser markup.
<iframe src="https://lotteryfeedapi.com/widgets/latest?game_code=md-pick3-midday&style=latest-card&theme=light" title="Maryland Pick 3 Midday latest result" loading="lazy" referrerpolicy="strict-origin-when-cross-origin" style="width:100%;max-width:420px;height:230px;border:0;border-radius:8px;overflow:hidden" ></iframe>
JavaScript loader
Use the script loader when you want a cleaner snippet. It inserts the same iframe after the script tag and accepts only public display filters through data attributes. Do not put API keys or customer secrets into widget markup.
<script async src="https://lotteryfeedapi.com/widgets/latest.js?v=2026-06-29.1" data-game-code="md-pick3-midday" data-style="latest-card" data-theme="light" data-height="230px" ></script>
Filters and display options
Widgets accept game_code, state, country, ball_count, q, limit, style, theme, and an optional feed_token. Limit is capped to 6 rows so embedded pages stay small. Styles are latest-card, compact, table, or badge; card remains a legacy alias. Themes are light or dark. Signed-in customers can use /account/widgets to preview and copy safe snippets with integration readiness checks for scope, freshness, origin policy, secret policy, and noindex attribution.
https://lotteryfeedapi.com/widgets/latest?state=TN&ball_count=3&limit=3&style=table&theme=dark
Revocable feed-link widgets
When a public page needs customer freshness or metered origin hits, create and use a feed link from the /account/widgets builder or create one from the account/control tools and paste the lf_feed token into the widget builder. The account widget builder lets signed-in users choose an existing API key by name/prefix instead of copying a raw UUID, shows that key allowed origins before creation, and can check the intended customer site origin before the embed is copied. Enterprise feed links may also set public white-label attribution that is rendered from the stored feed-link record, not from query params. Configure the bound API key allowed origins before publishing the embed; blocked browser origins render a widget access error instead of leaking data. Feed-link widgets use the same freshness policy as the feed link, record origin hits as /widgets/latest usage, enforce the bound API key allowed origins, and return RateLimit/Retry-After headers when the bound key daily limit is exceeded for a browser origin. Do not paste lf_live or lf_test bearer keys into widget markup.
<script async src="https://lotteryfeedapi.com/widgets/latest.js?v=2026-06-29.1" data-feed-token="lf_feed_REPLACE_WITH_REVOKABLE_TOKEN" data-game-code="md-pick3-midday" data-style="latest-card" ></script>
Cache and freshness
The iframe route is CDN-friendly and returns short public cache headers plus conditional validators. JavaScript snippets include a versioned loader URL so CDN caches can safely serve the loader without hiding new embed behavior after deployments. Clients can use Last-Modified and ETag validators to avoid redownloading unchanged widget HTML, while the widget still follows the latest compact result read model.
curl -I 'https://lotteryfeedapi.com/widgets/latest?game_code=md-pick3-midday&style=latest-card&theme=light' HTTP/2 200 cache-control: public, max-age=30, s-maxage=60, stale-while-revalidate=300 etag: "sha256-..." last-modified: Mon, 22 Jun 2026 17:25:45 GMT x-robots-tag: noindex, nofollow
Missing or delayed results
If no public result matches the filters, the widget renders a small customer-safe empty state.
SEO and attribution policy
The widget content matches public feed data and includes a Powered by Lottery Feed API link to the canonical result or lottery page by default. White-label feed links can replace that public attribution with the stored brand label and HTTPS URL, while widget URLs themselves remain noindex technical surfaces. Index the surrounding customer page and this documentation page instead.
Security and plans
The public widget never accepts bearer API secrets. Use server-side /v1 API calls for private logic, hidden filters, bulk history, and entitlement-controlled workflows. For browser embeds that need customer freshness, use revocable feed links and configure browser allowed origins on the bound API key.
Widget integration FAQ
Short answers for teams embedding public lottery results on customer-facing pages.
Can I put my API key in a widget?
No. Widgets are browser-safe public embeds and must not include bearer API keys such as lf_live or lf_test tokens. Use a revocable lf_feed token only when the widget needs customer freshness or origin-metered delivery.
Will widget pages be indexed by search engines?
No. The technical widget URLs are noindex surfaces. Index the surrounding customer page, the canonical lottery or result page, and this documentation page instead.
How fresh is the widget content?
The widget uses the same compact latest-result read model as the public result browser and returns short cache headers with ETag and Last-Modified validators.
What happens when a draw is missing or delayed?
The widget shows a compact empty state for the selected filters and does not expose private service diagnostics.
Next: API playground