The “house” always wins but whose house? How to use web technologies to win at the races

Dan Smith's avatar

Dan Smith

Published: July, 2025

Company logo for websultancy abbreviated as WS wrapped in html opening and closing tags

Some years ago, I was eager to deepen my knowledge of cloud computing. To put this learning into practice, I decided to build a real-world product that would put my skills to the test.

I wanted to create something that leveraged my front-end expertise, cloud-based hosting, data processing, and any other technologies I could pick up along the way.

One day, while watching the Grand National, a question struck me: is it possible to bet on all outcomes and guarantee a profit?

Why does the house win?

Let’s examine the phrase “The house always wins.” Imagine you’re at a prestigious horse racing event, playing the role of the punter. You approach a bookmaker to place bets on a race. The bookmaker provides a list of horses and their odds—the payout you’d receive relative to your bet if a particular horse wins.

If you took a fixed amount, say £10, and spread it across all horses in proportion to their odds, you could guarantee the same return no matter which horse wins. For example, if there are two horses, each with odds of 3:1, betting £5 on each would guarantee you £15 back, leaving a tidy £5 profit. This is known as dutch betting.

But let’s be realistic. In practice, your return will always be less than your initial stake because bookmakers set the odds to guarantee their own profit. In our example, the bookmaker would adjust the odds to maximize their profits and minimize their risk.

The theory

What if we flipped the script? Suppose you, the punter, visit 10 different bookmakers with your £10 and place dutched bets using the best odds from each. Could you guarantee a profit in some races?

This is where arbitrage comes in—a common investment strategy to lock in returns.

So, the question becomes: are there reliable sources online that aggregate odds from all bookmakers for upcoming races?

Test the theory

Bookmakers compete with each other, so some may offer more attractive odds on certain horses. This could tip the balance in your favor.

We started by searching for websites that display real-time odds from multiple bookmakers. We used a well-established odds comparison site (no names mentioned).

These sites typically list all upcoming races and odds from various bookmakers. Like search engines, we began by scraping the pagelinelinelineWe started with a Python function using the mechanise and Beautiful Soup libraries.

Mechanise emulates a browser, letting us programmatically access the site, while Beautiful Soup parses the HTML to extract the relevant data.
, extracting all races and their links, and storing them in a databaselinelinelineA NoSQL database is a lightweight, fast choice for storing these values..

We set up a timer to scrape the page every hourlinelinelineUsing a CRON trigger, we run the Python function every hour to scrape the page.. The database is updated to remove completed races and keep only upcoming oneslinelinelineWe modified the Python function to loop through and store only upcoming races, using the race link as the partition key..

With our list regularly updated, we examined each race page.

Odds are usually displayed in columns for each bookmaker. We wrote another scraper to extract the best odds for each horselinelinelineUsing the same approach, we wrote a Python function with mechanise and Beautiful Soup.

Mechanise downloads the HTML, and Beautiful Soup parses the odds for each horse. We then keep only the highest odds for each horse.
.

As part of this process, we also wrote a dutching algorithmlinelinelineWe pass the best odds into a Python function that calculates the dutching amounts and returns the guaranteed return. to see if a guaranteed return was possible. If so, we’d send ourselves an email notification.

After running this for a few weeks, we received several notifications. The average returns were small (about 1–5%) but scalable.

When checking a notification immediately, we noticed that odds fluctuate rapidly. A profitable race typically remains so for only 5 minutes before the market corrects itself. After that, the opportunity disappears.

To summarize:

  • It is possible to guarantee a profit by dutching bets across all outcomes in certain races.
  • These opportunities often occur within 30 minutes of a race.
  • A profitable race is usually available for no more than 5 minutes.

In conclusion, you can make a guaranteed profit, but you must act quickly when an opportunity arises.

The minimal viable product

Based on our tests, we outlined a brief for a tool to help place bets quickly when a guaranteed return is detected.

Many odds comparison sites offer a quick bet option, which is crucial for acting fast. Not all bookmakers participate, but even focusing only on those that do still yields frequent profitable opportunities.

Upon notification, here’s what’s needed to act swiftly:

  • Immediate access to the race page to use quick bet options
  • Easy access to the recommended bet amounts for each horse
  • Ensuring sufficient funds in bookmaker accounts before betting

To meet these needs, we recommend:

  • A web applicationlinelinelineWe’ll use React to build the front-end and serve it via a simple static HTTPS server. listing all horses, bet amounts, and the best bookmaker for each bet
  • Email notifications with a link to the web app when a profitable race is found
  • Embedding the comparison site in the app so users can see bet amounts and use quick bet options

The web application

We started by building a web app with unique URLs for each race, allowing users to view the scraped data.

Mobile optimization is key, since notifications can arrive at any time. A mobile-friendly app gives users the best chance to act quickly before odds change.

Our first screen will present the user with a total amount to bet, show the lowest expected return and a list of all the horses, the logos of the best bookmakers, and how much to bet. Here’s an example of a race:
With a clear illustration on how much to bet we’ll add a feature where you can tap on a horse and then present the end user with an embedded web page of the race on the odds comparison website:
On this screen we’ll select the horse on the embedded odds comparison website, enter the bet amount and place the quick bet, assuming a stable internet connection, this shouldn't take more than 5 seconds to complete.
Once the bet has been made, we’ll click on the green tick to tell our web app that the bet has been successfully placed.
We are then presented with a screen to confirm the amount bet, the implied odds (as seen on the bookmaker website) and the bookmaker that it was made with:
When we tell the app the actual odds and the bet amount we made, we’ll be able to allow the app to keep track of the balances made on the bookmakers - this will be useful for future bets.
Upon confirmation of the bet amount, we are then presented with our initial screen with the remaining horses left to bet on:
Assuming a stable connection, the user would have been able to complete their bet on a horse within 10 seconds.
From this point, the user can systematically work their way down the list and complete the remaining bets:
Once all bets have been made, we can then tap on the green tick and we’ve successfully locked in a profitable bet 🎉
  • Company logo for websultancy abbreviated as WS wrapped in html opening and closing tags
  • Company logo for websultancy abbreviated </picture>as WS wrapped in html opening and closing tags
  • Company logo for websultancy abbreviated as WS wrapped in html opening and closing tags
  • Company logo for websultancy abbreviated as WS wrapped in html opening and closing tags
  • Company logo for websultancy abbreviated as WS wrapped in html opening and closing tags

The notification:

Leveraging the pre existing work from our theoretical tests, we can make a simple change to the notification email itself. We can modify this in a way that will present us with a link to view the opportunity in the web app.

Conclusion

After simulating the web app on days over a 3 month period, we found that on 40 of those days we had guaranteed return opportunities. There were about 7 days where we had negative returns - we can put this down to the fluctuations in the racing odds during the simulated placements of the bets.

Overall, throughout this period there was a 41% increase in the simulated total balance.

So, what’s the catch? If we were to put this in practice, and assuming we continue to get a stream of guaranteed bets the earrings could be staggering.

Let's take this opportunity to say that the house doesn’t always win. After debunking the phrase “the house always wins”, we can bring a new phrase in “The house has lost enough”. Similar to a patron in a local bar who's had one too many, the house will decide it’s time for you to take your gains and encourage you to move on.

After a little digging for more information, there's various approaches bookmakers adopt to deter any punters making calculated bets, one of them being just to simply analyse your bet stats and and then limiting your bet amount. With this in mind, it flips our MVP on its head somewhat and becomes more a game of playing a game of cat and mouse with the bookmakers.

Need a hand?

Ad-hoc planning, prototyping, building, testing, maintanance and team managment in all aspects of web development. No upfront commitment and an initial free consultation, checkout our process & lets chat and see how we can help.

Company logo for Websultancy abbreviated as WS wrapped in HTML opening and closing tags.