Lottery History Bulk Export
Plan bounded lottery history exports for analytics, migration, and reconciliation without unbounded API reads.
Section
24 / 27
Live API examples
Jump from the docs to real public pages that use the same read models.
When to use bulk export
Use the history API for small date or game lookups. Use bulk export when a customer needs many dates, many games, or an offline archive for analytics, migration, reconciliation, or compliance review. Export jobs are intentionally asynchronous so public pages and realtime API requests never perform unbounded history scans.
GET https://api.lotteryfeedapi.com/v1/results/history?date=2026-05-25&state=MD&limit=25
Account workflow
Bulk export availability is shown in the authenticated account and may require a workspace review. When available, an export uses bounded filters and progresses through queued, running, ready, expired, or failed states. Public API pages never generate an unbounded archive during a normal request.
https://lotteryfeedapi.com/account/exports
{
"availability": "shown in the authenticated account",
"states": ["queued", "running", "ready", "expired", "failed"],
"formats": ["csv", "jsonl", "json"]
}Preflight estimate
Review the estimate shown in the account before queueing a larger export. It reports the bounded date coverage, estimated row count, and source-confidence mix without creating a job. A capped estimate means at least that many rows; split the export by year, jurisdiction, or game.
{
"range_days": 172,
"estimated_rows": 430,
"limited": false,
"first_draw_date": "2026-01-01",
"last_draw_date": "2026-06-21",
"source_confidence": {
"official": 400,
"verified_or_cross_checked": 30
}
}Status polling
Track export progress from the authenticated account. Ready exports use a short-lived signed download link and show their filters, row count, format, and expiry. Private download links must not be copied into public pages.
https://lotteryfeedapi.com/account/exports
{
"status": "ready",
"format": "jsonl",
"row_count": 172,
"download": "available in the authenticated account",
"expires": "shown with the download link"
}Export filters
Every export should be bounded by date range and at least one catalog dimension: country, state, game_code, or ball_count. The request should fail closed when filters are too broad instead of silently scanning all history. Use /v1/lotteries/{game_code}/draw-years before building archive pickers so customers select available years rather than guessing.
Formats
CSV works best for spreadsheet and BI imports. JSON Lines works best for streaming ingestion and append-only processing. Plain JSON works for smaller, bounded exports. All formats should preserve game_code, human lottery name, state, draw_date, numbers, numbers_formatted, status, source_confidence, provenance role/display, inserted_at, and correction/version markers when available. CSV flattens provenance into role, label, and provider columns; JSON and JSON Lines keep the compact provenance object.
{"game_code":"md-pick3-midday","name":"Maryland Pick 3 Midday","state":"Maryland","draw_date":"2026-05-25","numbers":["2","3","6"],"numbers_formatted":"2-3-6","status":"official","source":"Maryland Lottery","source_confidence":{"level":"official","label":"Official source"},"provenance":{"label":"Maryland Lottery","role":"official","source":"Maryland Lottery","provider":"Maryland Lottery","display":"Maryland Lottery published this result."},"correction":{"label":"Corrected numbers","previous_numbers_formatted":"2-3-5","version_count":2},"inserted_at":"2026-05-25T17:45:26Z"}Delivery and audit
Ready exports use short-lived signed download URLs instead of permanent public files. Export status, filters, row count, checksum, and expiry remain visible in the authenticated account. Expired downloads are archived while the audit record is retained.
Freshness and source policy
Bulk exports use stored customer-visible history and respect the same access-level delays as result endpoints. Export metadata includes generated_at, date_range, draw_count, source-confidence summaries, and a note when rows are withheld.
API documentation FAQ
Short answers for teams using lottery history bulk export in production integrations.
Is the bulk export endpoint live for every workspace?
No. Export availability is shown in the authenticated account and may require a workspace review. Use bounded /v1/results/history requests when bulk export is not available.
Can I export all lottery history in one request?
No. Export jobs must be bounded by date range and catalog filters. Broad all-history requests should be split by state, game, year, or delivered as a managed export to avoid unbounded scans and oversized files.
Which format should I choose?
Use CSV for spreadsheet and warehouse loading, JSON Lines for streaming ingestion, and bounded JSON only for small archives. Every format uses the compact customer-visible field contract.
Next: Number frequency