Sold my Sports Betting bot for 2000$

Ank R
3 min readDec 5, 2023

--

Sports Betting Bot
Sports Betting Bot

I stumbled upon a post about crafting a betting bot for the Betclic website, and the idea sparked my interest. I decided to bid on the project, and luckily, I secured it.

Project Requirements:

  • Read a CSV file every 10 minutes
  • Trigger the betting bot based on sports data from the CSV file
  • The bot identifies the right game, fills in the necessary information, and places a bet
  1. What exactly is a betting bot?
    It’s a nifty software designed to automate the betting process on various gambling platforms.
  2. Why the buzz around betting bots?
    People love them for their speed in placing bets, the ability to customize strategies, and the added bonus of eliminating emotions from the betting process.
  3. How does one create or automate betting?
    It involves developing a script to perform actions such as scraping data from gambling websites, placing bets, and making informed decisions based on statistics and markers.

My Ingenious Solution:

Module 1: Node.js Server — The Command Center

Picture a digital command center powered by Node.js. It’s got a nifty CRON job that reads the CSV file every 10 minutes. This powerhouse of a server is the brain, orchestrating everything and kicking off the action by talking to our Chrome extension bot using a WebSocket connection.

Sample CSV file

Module 2: Userscript — The Browser Buddy

Step 1: Game Spotting — Where the Fun Begins
Just like a pro gambler eyeing the perfect game, our Userscript navigates through the browser and clicks on game based on CSV file data.

Sample code:

const gameRows = document.querySelectorAll(".groupEvents_card");

for (const gameEle of gameRows) {
const team1Cont = gameEle.querySelectorAll(".scoreboard_contestantLabel")[0];
const team1 = team1Cont?.textContent?.trim();

const team2Cont = gameEle.querySelectorAll(".scoreboard_contestantLabel")[1];
const team2 = team2Cont?.textContent?.trim();

// Match team name
if (team1 === betInfo.team1 && team2 === betInfo.team2) {
gameEle.click();

await delay(2_000);
await Bet_Click();

break;
}
}

Step 2: Input Wager and Place bet:
It smoothly puts in the wager amount and click on Place button, making the entire process feel like a well-rehearsed symphony. The bet is placed, and we’re done — all super quick.

Sample code:

async function Bet_Click() {
const betType = betInfo.betType;

// Moneyline
if (betType === "TEAM_1" || betType === "TEAM_2") {
const container = document.querySelector("sports-markets-single-market");
const moneylinesEle = container.querySelectorAll(".marketBox_lineSelection sports-selections-selection");

if (betType === "TEAM_1") {
moneylinesEle[0].click();
} else if (betType === "TEAM_2") {
moneylinesEle[2].click();
}
}
// Goals
else if (betType === "GOAL") {
const container = document.querySelector("sports-match-markets sports-markets-single-market:nth-child(2)");
const moneylinesEles = container.querySelectorAll(".marketBox_lineSelection");

for (const ele of moneylinesEles) {
const label = ele.querySelector(".marketBox_label")?.textContent?.trim();
const btn = ele.querySelector(".oddButtonWrapper");
if (label === betInfo.goalInfo) {
btn.click();
break;
}
}
}

await delay(2_000);

// Fill wager amount
const betSlipContainer = document.querySelector(".progressiveBettingSlip_cardContainer");
const inputEle = betSlipContainer.querySelector("input");
inputEle.click();
inputEle.value = betInfo.betAmt;

// Click on place button
// ...
}

Note: some sections above include pseudo code to keep the article concise and focused.

Demo video for client:
https://www.youtube.com/watch?v=8-x1yKWgT_I

Conclusion:

  • This project was a mix of fun and challenge, expanding my skills.
  • The Userscript stood out, proving its power to simplify and improve automation.
  • Among various automation approaches, this solution did the trick for my client.

About Me

With over 7 years of experience as a Senior Software Engineer, I find joy in crafting innovative projects during my leisure hours.

If you’re intrigued and would like the full code for this betting bot or wish to engage in a brainstorming session for new ideas, don’t hesitate to reach out.

Let’s connect on LinkedIn to foster a collaborative space for sharing insights and exploring exciting possibilities.

Here’s to wishing you an awesome day filled with productivity and success!

--

--

Ank R

Senior SDE - JavaScript | NodeJS | React | Blockchain