Dear Lottery Results API — Developer Documentation
Public, read-only JSON endpoints with CORS and strong caching (ETag + Cache-Control). No authentication, designed to be “never laggy”.
https://indialotteryapi.com/wp-json/dearlottery/v1CORS
*Cache
public, max-age=120 + ETagOverview
This API serves the recorded draw results for time slots 1pm, 6pm, and 8pm. Data is stored as static JSON files on the server and streamed via the REST endpoints with ETag support to minimize bandwidth and latency.
Internally generated files include latest.json, latest-1pm.json, and dated files like 1pm-YYYY-MM-DD.json.
Data Model
{
"no": "127",
"date": "YYYY-MM-DD",
"time": "1pm | 6pm | 8pm",
"prizes": {
"1st": ["68C","99737"], // First prize (can be alphanumeric tokens)
"cons": ["99737","..."], // Consolation
"2nd": ["..."], "3rd": ["..."],
"4th": ["..."], "5th": ["..."]
}
}| Field | Type | Description |
|---|---|---|
no | string | Draw number (as recorded in admin) |
date | string (YYYY-MM-DD) | Draw date |
time | enum | One of 1pm, 6pm, 8pm |
prizes | object | Arrays of tokens (numbers or alphanumeric like 68C) |
GET /latest Optional: time
Returns the most recent recorded result. If time is provided, returns the latest for that slot.
Query Parameters
| Param | Type | Required | Example |
|---|---|---|---|
time | string | No | 1pm | 6pm | 8pm |
Requests
GET https://indialotteryapi.com/wp-json/dearlottery/v1/latest Accept: application/json GET https://indialotteryapi.com/wp-json/dearlottery/v1/latest?time=6pm Accept: application/json
Sample 200 Response
{
"no": "127",
"date": "2024-05-18",
"time": "6pm",
"prizes": { "1st":["68C","99737"], "cons":["99737"], "2nd":["..."], "3rd":["..."], "4th":["..."], "5th":["..."] }
}GET /by-date Required: date Optional: time, fallback
Returns the result for a specific date and (optionally) time slot.
Query Parameters
| Param | Type | Required | Description |
|---|---|---|---|
date | string | Yes | Format YYYY-MM-DD |
time | string | No | 1pm (default if omitted), 6pm, or 8pm |
fallback | 0|1 | No | If the dated file is missing and fallback=1, returns the latest for that time slot |
Requests
GET https://indialotteryapi.com/wp-json/dearlottery/v1/by-date?date=2024-05-18&time=1pm Accept: application/json GET https://indialotteryapi.com/wp-json/dearlottery/v1/by-date?date=2024-05-18&time=8pm&fallback=1 Accept: application/json
Sample Errors
400 Bad Request
{"error":"date_required"}404 Not Found
{"error":"not_found"}Headers & Status
Response Headers
Content-Type: application/json; charset=utf-8Cache-Control: public, max-age=120, s-maxage=120ETag: "md5-of-file"Access-Control-Allow-Origin: *Access-Control-Allow-Methods: GET, OPTIONS
Use Conditional Requests
GET /wp-json/dearlottery/v1/latest If-None-Match: "your-last-etag"
If nothing changed, the server returns 304 Not Modified with an empty body.
Status Codes
| Code | Meaning |
|---|---|
| 200 | OK + JSON body |
| 304 | Not Modified (ETag match) |
| 400 | Missing or invalid parameter (e.g., date) |
| 404 | Result not found for the given inputs |
| 5xx | Server error |
Examples
cURL
curl -s 'https://indialotteryapi.com/wp-json/dearlottery/v1/latest' -H 'Accept: application/json' curl -s 'https://indialotteryapi.com/wp-json/dearlottery/v1/latest?time=8pm' -H 'Accept: application/json' curl -s 'https://indialotteryapi.com/wp-json/dearlottery/v1/by-date?date=2024-05-18&time=6pm' -H 'Accept: application/json'
JavaScript fetch()
const url = 'https://indialotteryapi.com/wp-json/dearlottery/v1/by-date?date=2024-05-18&time=1pm';
fetch(url, { headers: { Accept: 'application/json' } })
.then(res => res.status === 304 ? null : res.json())
.then(data => console.log(data))
.catch(console.error);Alphanumeric tokens
The API preserves alphanumeric tokens such as 68C. Treat tokens as strings and render them as-is.
FAQ & Notes
- Time slots:
1pm,6pm,8pm. If omitted in/by-date, defaults to1pm. - Fallback:
/by-datewithfallback=1returns the latest available JSON for that slot if the dated file isn’t present yet. - Rate limits: Please respect cache headers and use ETag to reduce load.
- No authentication: All endpoints are public read-only.