Developers
Public data API
A read-only REST API for historical Canadian draw results, frequency statistics and period comparisons. Data is historical only — nothing here predicts future draws.
Authentication
Every data endpoint requires an API key. Create one on your API keys page (sign-in required) and send it in the x-api-key header. Keys are stored hashed, can be revoked at any time, and usage is counted per key.
curl "https://aithelottery.ca/api/public/v1/draws?lottery=lotto-max&limit=5" \ -H "x-api-key: ail_your_key_here"
Responses are JSON with permissive CORS, so browser clients work too. Errors return { error, status } with 401 (missing/invalid key), 403 (revoked), 400 (bad parameters) or 404 (no data).
/api/public/v1/lotteriesGame catalogue with number pools and draw days. No API key required.
| Parameter | Description |
|---|---|
| — | No parameters |
curl "https://aithelottery.ca/api/public/v1/lotteries"
/api/public/v1/drawsHistorical draw results, newest first.
| Parameter | Description |
|---|---|
| lottery | Required. One of: lotto-max, lotto-649, daily-grand, ontario-49, encore |
| from | Optional YYYY-MM-DD lower bound on draw date |
| to | Optional YYYY-MM-DD upper bound on draw date |
| limit | Optional 1–2000, default 100 |
curl "https://aithelottery.ca/api/public/v1/draws?lottery=lotto-649&from=2024-01-01&limit=50" \ -H "x-api-key: $AITHELOTTERY_KEY"
/api/public/v1/statsFrequency index per number plus hot, cold and overdue rankings, odd/even, high/low and decade distributions, and sum ranges.
| Parameter | Description |
|---|---|
| lottery | Required game id |
| from | Optional YYYY-MM-DD lower bound |
| to | Optional YYYY-MM-DD upper bound |
| take | Optional 1–50 size of hot/cold/overdue lists, default 10 |
curl "https://aithelottery.ca/api/public/v1/stats?lottery=lotto-max&take=15" \ -H "x-api-key: $AITHELOTTERY_KEY"
/api/public/v1/compareSide-by-side comparison of two date ranges: per-number frequency deltas, biggest risers and fallers, and distribution summaries for each period.
| Parameter | Description |
|---|---|
| lottery | Required game id |
| a_from / a_to | Required YYYY-MM-DD bounds for period A |
| b_from / b_to | Required YYYY-MM-DD bounds for period B |
curl "https://aithelottery.ca/api/public/v1/compare?lottery=lotto-649\ &a_from=2023-01-01&a_to=2023-12-31\ &b_from=2024-01-01&b_to=2024-12-31" \ -H "x-api-key: $AITHELOTTERY_KEY"
Fair use and accuracy
- Up to 10 active keys per account; each request is logged against your key.
- Responses are cached for 60 seconds — cache on your side where possible.
- Always verify winning numbers with the official lottery operator before claiming any prize. This API is for analysis and education only.
- Statistics describe past draws. No frequency, streak or overdue figure changes the odds of a future draw.
Important: This website does not guarantee winning numbers. AI-generated suggestions are based on historical statistics and probability analysis for informational and entertainment purposes only. Lottery results are random. Need support? Call ConnexOntario at 1-866-531-2600.