Lottery API Polling and Integration Guide
Build schedule-aware lottery result polling with bounded windows, Retry-After handling, cache-safe delivery, and clear freshness boundaries.
Section
03 / 27
Live API examples
Jump from the docs to real public pages that use the same read models.
Endpoints
/v1/results/latestLatest compact draw rows for current customer views.
/v1/results/historyDate-filtered history rows for imports and reconciliation.
/v1/schedulesTimezone-aware draw schedule metadata.
/widgets/latestBrowser-safe latest-result iframe endpoint.
/sdk-examples.jsonMachine-readable SDK starters and sandbox smoke examples.
High-frequency lottery API polling
High-frequency describes how often an integration checks for a result. It does not describe number-frequency statistics, the draw cadence of a lottery, or a promise that a result will appear immediately. Polling cannot make a result visible before source publication, feed processing, and the workspace delivery policy allow it. Use the schedule window and shared request quota deliberately.
Recipe map
Use these recipes when wiring a real customer product. They use concrete number-game examples so engineers can copy a request, see which fields to store, and keep browser pages free of bearer tokens.
https://lotteryfeedapi.com/lotteries/md-pick3-midday https://lotteryfeedapi.com/lotteries/tn-pick3-evening https://lotteryfeedapi.com/api-docs/widgets https://lotteryfeedapi.com/sdk-examples.json
Show latest Pick 3 numbers for Maryland
For a jurisdiction-and-format latest-result view, filter by state and ball_count, cap rows with limit, and store draw_date plus numbers_formatted. Add an explicit include value only when bounded provenance or correction context is needed.
curl -sS "https://api.lotteryfeedapi.com/v1/results/latest?state=MD&ball_count=3&short=1&limit=5" \ -H "Accept: application/json" \ -H "Authorization: Bearer YOUR_API_KEY"
{
"returned_count": 1,
"total_count": 1,
"limit": 5,
"has_more": false,
"data": [
{
"game_code": "md-pick3-midday",
"name": "Maryland Pick 3 Midday",
"state_code": "MD",
"ball_count": 3,
"draw_date": "2026-06-21",
"numbers_formatted": "2-3-6",
"status": "official"
}
]
}Backfill one historical draw date
Use the history endpoint for deterministic imports and reconciliation jobs. Always pass date explicitly, keep the returned_count and total_count fields for monitoring, and paginate with narrower filters when a date has more rows than the limit.
curl -sS "https://api.lotteryfeedapi.com/v1/results/history?date=2026-06-21&state=TN&ball_count=3&limit=25" \ -H "Accept: application/json" \ -H "Authorization: Bearer YOUR_API_KEY"
{
"date": "2026-06-21",
"returned_count": 3,
"total_count": 3,
"has_more": false,
"data": [
{
"game_code": "tn-pick3-evening",
"name": "Tennessee Cash 3 Evening",
"draw_date": "2026-06-21",
"numbers_formatted": "0-7-6"
}
]
}Check schedule before polling
Schedule metadata lets a worker avoid polling all day. Start at next_draw.polling_window.first_check_after_utc and stop or slow down after retry_until_utc. A polling window is guidance, not proof that the source has published a result. Store timezone IDs, not only offsets, because daylight saving time changes local draw times.
curl -sS "https://api.lotteryfeedapi.com/v1/schedules?state=TN&date=2026-06-21" \ -H "Accept: application/json" \ -H "Authorization: Bearer YOUR_API_KEY"
{
"data": [
{
"game_code": "tn-pick3-evening",
"name": "Tennessee Cash 3 Evening",
"draw_schedule": {
"local_time": "6:28 PM CT",
"utc_time": "23:28 UTC",
"timezone": "America/Chicago",
"description": "Every day. On Sunday, only the evening draw runs.",
"next_draw": {
"utc_datetime": "2026-06-21T23:28:00Z",
"polling_window": {
"first_check_after_utc": "2026-06-21T23:38:00Z",
"retry_until_utc": "2026-06-22T01:28:00Z"
}
}
}
}
]
}Embed a browser-safe latest result
Use widgets for public customer pages. Widgets never accept bearer API keys, return short cache headers, and link back to canonical lottery or result pages for attribution and SEO clarity.
<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>
Use deterministic sandbox checks in CI
CI should validate auth, parsing, and response-shape mapping without depending on live draw timing. Sandbox keys exercise the public read model but do not represent official source freshness or paid entitlements.
curl -sS "https://api.lotteryfeedapi.com/v1/results/latest?state=MD&ball_count=3&short=1&limit=1" \ -H "Accept: application/json" \ -H "Authorization: Bearer lf_test_demo_sandbox"
{
"data": [
{
"game_code": "md-pick3-midday",
"numbers_formatted": "2-3-6",
"numbers_string": "2-3-6"
}
]
}Operational polling guardrails
Keep one schedule-aware polling loop per game and draw window, then fan out the stored result inside your system. Retry only idempotent GET requests, respect Retry-After and RateLimit headers, and stop the loop after the expected draw is stored. Log endpoint path, response status, latency, and request IP without logging bearer tokens.
Choose the right cache surface
Bearer-authenticated /v1 responses are private API reads, not a conditional-cache surface. Where configured, feed links support ETag and Last-Modified validation, while public browser pages should use widgets. Do not place bearer API keys in browser code, public URLs, or shared caches.
Keep polling cadence separate from freshness
F1-F7 measure plan delivery delay after the feed first stores or observes a result. Collection lag from official publication is measured separately. F1-F7 are plan delivery-delay targets, not guarantees of ingestion speed or uptime. The delay clock starts after the feed first stores or observes a result; upstream publication and ingestion can add time before that point. More frequent requests do not move a stored result ahead of the workspace delivery policy; they only consume shared quota.
API documentation FAQ
Short answers for teams using lottery api polling and integration guide in production integrations.
Should a public website call /v1 directly from the browser?
No. Browser pages should use widgets or feed links. Keep bearer API keys in server-side workers, API routes, or backend jobs.
What fields should an importer store first?
Store game_code, draw_date, numbers, numbers_formatted, status, source_confidence, provenance role/display, and inserted timestamps required by your integration.
Does high-frequency polling make a lottery result available sooner?
No. Request cadence does not change source publication, feed processing, or the workspace delivery policy. Use the schedule polling window and stop after the expected draw is stored.
Is the number-frequency endpoint a polling endpoint?
No. The frequency endpoint summarizes historical number counts. Polling integrations should use schedules, latest results, retry headers, and the cache surface that matches their access model.
Next: Sandbox fixtures