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

Base https://indialotteryapi.com/wp-json/dearlottery/v1
CORS *
Cache public, max-age=120 + ETag

Overview

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": ["..."]
  }
}
FieldTypeDescription
nostringDraw number (as recorded in admin)
datestring (YYYY-MM-DD)Draw date
timeenumOne of 1pm, 6pm, 8pm
prizesobjectArrays 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

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

ParamTypeRequiredDescription
datestringYesFormat YYYY-MM-DD
timestringNo1pm (default if omitted), 6pm, or 8pm
fallback0|1NoIf 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-8
  • Cache-Control: public, max-age=120, s-maxage=120
  • ETag: "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

CodeMeaning
200OK + JSON body
304Not Modified (ETag match)
400Missing or invalid parameter (e.g., date)
404Result not found for the given inputs
5xxServer 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 to 1pm.
  • Fallback: /by-date with fallback=1 returns 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.