Skip to content
Lottery Feed API

Lottery Feed API

ResultsPersonalAPI DocsPricingContact
Sign inJoin the Free Beta
  1. Home
  2. /
  3. API docs
  4. /
  5. Lottery History Bulk Export

API documentation

Lottery History Bulk Export

Plan bounded lottery history exports for analytics, migration, and reconciliation without unbounded API reads.

Browse guidesOpenAPI JSON
On this page
Import Pick-game history without losing leading zeros or draw sessionsInput boundaries and missing recordsWhen to use bulk exportAccount workflowPreflight estimateStatus pollingExport filtersFormatsDelivery and auditFreshness and source policyAPI documentation FAQ

Import Pick-game history without losing leading zeros or draw sessions

Download the offline evaluator and synthetic Pick 3, Pick 4, and Pick 5 fixture below. In a new local folder, install Zod and run the example with Bun. The fixture demonstrates parsing, not historical coverage, official provenance or live freshness. Single-character digit strings retain leading zeros; game_code keeps draw sessions separate, and draw_date is not replaced by the UTC ingestion date. Exact duplicates are counted once; conflicting rows, including corrections, stop without output for manual review. No results are fetched or published.

curl --fail --show-error --output import.ts https://lotteryfeedapi.com/examples/history-import/import.ts
curl --fail --show-error --output synthetic.jsonl https://lotteryfeedapi.com/examples/history-import/synthetic.jsonl
bun add [email protected]
bun import.ts synthetic.jsonl > evaluated.jsonl
Validated 3 distinct rows; skipped 0 exact duplicates. No data published. (stderr; stdout contains 3 JSON Lines)

Input boundaries and missing records

The evaluator accepts a local compact JSON Lines file, at most 1 MiB, 1,000 rows and 16 KiB per row. Each line must round-trip unchanged through JSON.stringify; duplicate JSON keys and differently serialized input are rejected instead of silently overwritten. Do not convert a rejected file without reviewing the reason. Only single-digit Pick 3, Pick 4 and Pick 5 records without bonus numbers are supported. Unknown fields are not copied into the evaluated output. Missing dates do not prove that no draw occurred. The comparison key is a local conflict guard, not a database upsert or settlement key. Check the response contract and your access limits before evaluating authorized live history; the sample does not choose a correction or establish source trust.

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. Preserve game_code, lottery name, country, state, ball_count, draw_date, numbers, numbers_formatted, status, source_confidence, provenance and available insertion/correction metadata. CSV flattens provenance into role, label, and provider columns; JSON and JSON Lines keep the compact object. The illustrative JSONL below is a synthetic corrected record accepted by the evaluator, not a real draw or source claim. Timestamps retain their explicit UTC offset; a positive version_count does not prove that every revision is present.

{"game_code":"sample-pick3-midday","name":"Synthetic Pick 3 Midday","country":"XX","state":"Synthetic","state_code":"XX","ball_count":3,"draw_date":"2030-01-01","numbers":["0","0","7"],"numbers_formatted":"0-0-7","status":"sample","source_confidence":{"level":"unknown","label":"Synthetic fixture"},"provenance":{"label":"Synthetic fixture","role":"unknown","display":"No source claim."},"correction":{"label":"Corrected numbers","description":"Synthetic correction example; not an actual revision.","previous_numbers":["0","0","6"],"previous_numbers_formatted":"0-0-6","version_count":1,"corrected_at":"2030-01-01T20:00:00-05:00"},"inserted_at":"2030-01-02T01:00:00Z"}

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

Related resources

Explore guides, examples and tools for your integration.

Download Bun import exampleDownload the offline evaluator source used by this guide.
Download synthetic JSON Lines fixtureDownload the clearly synthetic three-row input for the evaluator.
Results response contractCheck the customer-visible draw fields before importing history.
History accessCheck authenticated export availability and bounded download access.
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