kerala-lottery-scraper
v1.0.4
Published
Scrape Kerala Lottery results and maintain a 7-day history.
Maintainers
Readme
Kerala Lottery Scraper
A lightweight, automated Node.js package to scrape and live-update Kerala Lottery results. It actively fetches results as they are published and maintains a rolling 7-day JSON history.
Changelog
v1.0.4 — 2026-08-16
- Bug fix: Added filter to ignore stray 'Repeated Numbers' blocks from the footer of the results page to prevent erroneous trailing numbers in the prize arrays.
v1.0.3 — 2026-08-14
- Bug fix (restored): Year numbers (
2024-2027) from page footers are filtered out again (accidentally removed in v1.0.2). - Bug fix (refined): Top-tier prizes (1st/2nd/3rd/Consolation) require a 2-letter prefix (e.g.
PN 809878). Lower-tier prizes (4th–9th) correctly accept bare 4-digit numbers (e.g.0315,1948) since the source page lists them as "last four digits". - Bug fix: Draw gate check now requires at least one of the top-three prize tiers (1st, 2nd, 3rd) to have winners. Unpublished draws with only stray numbers are correctly filtered out (returns
null→ skipped).
v1.0.2 — 2026-08-14
- Bug fix: Ticket number regex requires a 2-letter prefix for top-tier prizes. Bare numbers like
5000are no longer accepted. - Bug fix: Draw gate check requires top-three prize tiers to have winners.
Features
- Live Auto-Update: Built-in, timezone-aware scheduler that automatically checks for results every 5 minutes during active draw hours (3:00 PM - 4:45 PM IST).
- Comprehensive Data: Automatically parses and extracts all 9 prize categories (1st Prize, 2nd Prize, 3rd Prize, Consolation Prize, etc.).
- Dynamic Prize Values: Identifies varying prize amounts (e.g. ₹1,00,00,000 for regular draws or ₹10 Crores for bumpers) and injects them into the output structure.
- 7-Day Rolling Window: Efficiently maintains exactly 7 days of results in
result.jsonautomatically dropping older days. - Ready to Use: Designed as an easy drop-in for other Node.js apps.
Installation
npm install kerala-lottery-scraperUsage
As a standalone script
You can start the scraper directly from your command line:
npm startNote: If you start the app outside of 3:00 PM - 4:45 PM IST, it will stand by and wait for the draw window before actively hitting the network.
As a module in your Node.js app
const lotteryScraper = require('kerala-lottery-scraper');
// Start the automatic background polling (respects 3 PM - 4:45 PM IST active window)
lotteryScraper.startAutoUpdate();
// Stop the automatic background polling
// lotteryScraper.stopAutoUpdate();
// Force an immediate update right now, regardless of the time
// lotteryScraper.forceUpdate();
// Get the current list of parsed results synchronously from result.json
const currentResults = lotteryScraper.getResults();
console.log(currentResults);Output Structure (result.json)
[
{
"date": "13-08-2026",
"lottery": "Karunya Plus",
"code": "KN-636",
"firstPrize(₹1,00,00,000)": [
"PN 809878"
],
"secondPrize(₹30,00,000)": [
"PW 864399"
],
"consolationPrize(₹5,000)": [
"PO 809878"
]
// ... up to 9th Prize
}
]Author
Babu Perumana ([email protected])
