KLR
Kerala Lottery Results API — Developer Documentation
Public read-only JSON API with CORS and ETag. No auth required. Built for speed and stability.
Base
CORS
Cache
https://indialotteryapi.com/wp-json/klr/v1CORS
*Cache
Cache-Control + ETagOverview
All responses are JSON. Endpoints are stateless and fast. Use conditional requests to avoid transferring data when unchanged.
Recommended Request Headers
Accept: application/json- Conditional:
If-None-Match: "your-last-etag"→ returns304if unchanged.
Status Codes
| HTTP | Meaning |
|---|---|
| 200 | OK, JSON body |
| 304 | Not Modified (ETag hit; empty body) |
| 400 | Bad Request (e.g., missing date) |
| 404 | No data found |
| 5xx | Server error |
Data Model
{
"draw_date": "YYYY-MM-DD",
"draw_name": "Akshaya",
"draw_code": "AK-655",
"first": {
"ticket": "PT 336829",
"location": "GURUVAYOOR",
"agent": "V F RIMSON",
"agency_no": "R 4866"
},
"prizes": {
"consolation": ["..."],
"2nd": ["..."], "3rd": ["..."], "4th": ["..."], "5th": ["..."],
"6th": ["..."], "7th": ["..."], "8th": ["..."], "9th": ["..."],
"amounts": {"1st":"₹1,00,00,000/-","consolation":"₹5,000/-", "..."},
"guess": ["optional"]
}
}GET /latest
Returns the most recent draw.
Request
GET https://indialotteryapi.com/wp-json/klr/v1/latest Accept: application/json
Sample Response
{
"draw_date": "2024-05-18",
"draw_name": "Akshaya",
"draw_code": "AK-655",
"first": {"ticket":"PT 336829","location":"GURUVAYOOR","agent":"V F RIMSON","agency_no":"R 4866"},
"prizes": { ... see Data Model ... }
}Response Headers
Cache-Control: public, max-age=60ETag: "xxxxx"
Conditional Request
GET https://indialotteryapi.com/wp-json/klr/v1/latest If-None-Match: "your-last-etag"
Returns 304 Not Modified if unchanged.
GET /by-date
Returns a draw by date.
Query Parameters
| Param | Type | Required | Description |
|---|---|---|---|
date | string (YYYY-MM-DD) | Yes | Draw date |
Request
GET https://indialotteryapi.com/wp-json/klr/v1/by-date?date=2024-05-18 Accept: application/json
Errors
400 Bad Request {"code":"rest_missing_callback_param","message":"Missing parameter(s): date"}GET /history
Paginated history (descending by date).
Query Parameters
| Param | Type / Default | Description |
|---|---|---|
limit | int, default 10 | Page size (1–100 recommended) |
offset | int, default 0 | Offset (pagination) |
days | int, default 0 | If from/to not set, return last N days |
from | YYYY-MM-DD | Start date (inclusive) |
to | YYYY-MM-DD | End date (inclusive) |
Request
GET https://indialotteryapi.com/wp-json/klr/v1/history?limit=10&offset=0 Accept: application/json
Sample Response
{
"total": 1234,
"limit": 10,
"offset": 0,
"items": [
{
"draw_date": "2024-05-18",
"draw_name": "Akshaya",
"draw_code": "AK-655",
"first_ticket": "PT 336829",
"prizes": { ... see Data Model ... }
}
]
}Performance Tips
- Use ETag: store the last
ETag, sendIf-None-Match; you’ll get304when nothing changed. - Honor Cache-Control: respect
public, max-age=60to avoid unnecessary calls. - Paginate: prefer
limit/offsetover fetching large ranges at once. - Back off on errors: don’t retry aggressively on 4xx/5xx.
Quick Examples
cURL
curl -s 'https://indialotteryapi.com/wp-json/klr/v1/latest' -H 'Accept: application/json' curl -s 'https://indialotteryapi.com/wp-json/klr/v1/by-date?date=2024-05-18' -H 'Accept: application/json' curl -s 'https://indialotteryapi.com/wp-json/klr/v1/history?limit=10&offset=0' -H 'Accept: application/json'
fetch()
fetch('https://indialotteryapi.com/wp-json/klr/v1/latest', { headers: { Accept: 'application/json' } })
.then(r => r.status === 304 ? null : r.json())
.then(console.log)
.catch(console.error);