Skip to content
Lottery Feed API

Lottery Feed API

ResultsPersonalAPI DocsPricingContact
Sign inJoin the Free Beta
  1. Home
  2. /
  3. API docs
  4. /
  5. Embeddable Result Widgets

API documentation

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

OpenAPI JSON
01Introduction02Quickstart03Polling and integration04Sandbox fixtures05SDK starter06Embeddable widgets07API playground08OpenAPI spec09Postman collection10API changelog11Authentication12API key scopes13Freshness levels14Source confidence15Status monitoring16Rate limiting17Get countries18Get states19Get lotteries20Get lottery21Get schedules22Draw years23Lottery results24History export25Number frequency26Result checker27Error handling

Live API examples

Jump from the docs to real public pages that use the same read models.

Latest results browserSee the compact public result model with filters and draw dates.
Lottery catalogFind game names, states, ball counts, latest numbers, and API guides.
Maryland Pick 3 API guideOpen a concrete endpoint example using the same game shown in snippets.
Pricing and limitsCompare freshness targets, request limits, and integration features.
Customer integration centerSign in to check API keys, usage, webhook delivery, plan limits, and the next recommended action.
OpenAPI contractUse the machine-readable contract for code generation and integration tests.

Endpoints

GET
/widgets/latest

Embeddable HTML iframe for latest public lottery results.

GET
/widgets/latest.js

JavaScript 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.

Open widget
No browser API key
Rows capped at 6
Noindex widget URL
Powered-by attribution

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
Lottery Feed API

Normalized lottery draw results, history, schedules, source-confidence metadata, and descriptive analytics for integrations and personal analysis.

Independent software and data service. We do not sell lottery tickets, accept bets or player funds, operate draws, determine outcomes or pay prizes.Lottery names and trademarks belong to their respective owners. Lottery Feed API is an independent data service and is not affiliated with, endorsed by, sponsored by or operated by any lottery authority.
LotteriesDaily ArchiveCountriesStatesStatusResponsible UseAcceptable UseReport incorrect resultCompanyTermsPrivacyAccount