I Built a US Scratch-Off Tickets Odds and Prize Tracker with React, NextJS, Python and Selenium

Understanding the Probabilities: Developing a US Scratch-Off Ticket Odds and Prize Tracker

In the realm of lottery gaming, transparency and access to accurate data are paramount for enthusiastic players seeking the best odds and most rewarding games. Recognizing this need, I embarked on an innovative side project: Scratch-Off Hub, a comprehensive platform dedicated to tracking and presenting real-time data on US scratch-off tickets across over 30 states.

Purpose and Motivation

The primary motivation behind Scratch-Off Hub was to address a common challenge faced by lottery players: the scattered and often opaque presentation of odds and remaining prizes. While state lotteries publish this information, it can be difficult to interpret, especially when considering factors such as the actual chance of winning the top prize.

An even more surprising discovery was that many state lotteries continue to sell tickets for games where all grand prizes have already been claimed. This means players may unknowingly purchase tickets with virtually zero chance of winning the highest prize, simply because the data isnโ€™t readily accessible or clear.

Furthermore, many existing lottery analytics platforms restrict detailed data behind paid subscriptions, limiting access for regular players. My goal was to create a freely accessible, open-source alternative that offers transparent, up-to-date information to help players make informed choices.

Technology Stack and Data Acquisition

To achieve this, I employed a modern tech stack combining React and Next.js for the frontend, hosting on Vercel to ensure fast global access, along with robust backend data scraping scripts using Python and Selenium.

  • Frontend: Built with React and Next.js to provide an efficient, SEO-friendly interface where users can search, filter, and sort scratch-off tickets based on ever-changing odds and prizes.
  • Backend Data Collection: I developed custom scraper scripts for each stateโ€™s lottery website. These scripts utilize Python with Selenium coupled with headless Chrome to navigate dynamic content, handle diverse data formats, and extract detailed information such as ticket images, pricing, current prize counts, and calculated odds taking claimed prizes into account.
  • Data Management: Scraped data is stored daily as JSON files and served to the frontend via API routes, ensuring the platform always reflects the most recent information.

Challenges and Technical Insights

Building the scrapers presented an engaging technical challenge. Each stateโ€™s lottery website has unique characteristicsโ€”some load content dynamically, others present inconsistent prize formatting. Overcoming these hurdles was both rewarding and educational, requiring tailored solutions and careful validation to ensure data accuracy.

User-Focused Features

Scratch-Off Hub offers a user


Leave a Reply

Your email address will not be published. Required fields are marked *