Building a Real-Time Betting Odds Monitor with Arbitrage Detection


I recently built PariScrapper — a real-time betting odds monitor with an API, basic arbitrage detection, and a Streamlit dashboard for live visualisation of odds, implied probabilities, and bookmaker margins.
DISCLAIMER - BETTING IS RISKY AND I AM NOT PROMOTING IT
This blog walks through the math behind betting odds, how bookmakers make money, and how I built this project to track odds and detect arbitrage opportunities in real time.
1. Understanding Betting Odds (With a Simple Example)
Betting odds tell you how much you can win relative to your stake.
For example:
India: 1.14
Australia: 5.60
If you bet ₹200:
On India:
200 × 1.14 = ₹228
→ ₹28 profit if they win.On Australia:
200 × 5.60 = ₹1120
→ ₹920 profit if they win.
The formula is simple:
$$\text{Payout} = \text{Bet Amount} \times \text{Odds}$$
2. Can You Bet on Both Teams and Always Win? (Arbitrage Betting)
This is where arbitrage betting comes in.
It’s a strategy where you bet on all possible outcomes in such a way that you guarantee profit no matter what happens.
The key condition for a two-outcome event:
For two outcomes with odds ( a ) and ( b ), the key condition is:
$$\frac{1}{a} + \frac{1}{b} < 1$$
Where ( a ) and ( b ) are the odds for both teams.
Example:
India: 1.14
Australia: 15.60
Substituting:
$$\frac{1}{1.14} + \frac{1}{15.60} \approx 0.91 < 1$$
This means you can split your stake to guarantee profit.
Bet ₹186.38 on India.
Bet ₹13.62 on Australia.
No matter who wins, you end up with ₹198.85 → a small risk-free profit.
This doesn’t happen often — but when it does, it’s a free money situation.
3. How Do Bookmakers Always Make Money?
Bookmakers aren’t in the business of losing.
They bake in a margin (or "overround") by slightly skewing the odds.
The implied probability of each outcome is:
Probability=1Odds\text{Probability} = \frac{1}{\text{Odds}}
For our example:
India:
1 / 1.14 ≈ 87.72%
Australia:
1 / 5.60 ≈ 17.86%
Total: 87.72 + 17.86 ≈ 105.58%
That extra 5.58%? That’s the bookmaker’s profit margin.
4. The Project: Real-Time Odds Monitoring & Arbitrage Detection
I wanted to monitor live odds, expose them via an API, and visualize them in real time.
So I built PariScrapper, which has three main components:
a) Flask API (main.py
)
Uses Selenium to scrape live odds from Parimatch.
Runs a background thread to continuously update odds for a given event.
Provides a REST API at
/odds?event=<id>
to fetch the latest data.
b) Arbitrage Detection (arbitrage.py
)
Periodically queries the API.
Checks if the arbitrage condition is met.
Logs alerts when opportunities are found.
c) Streamlit Dashboard (streamlit_ui.py
)
Displays real-time odds, implied probabilities, and bookmaker margins.
Plots historical trends for better insights.
5. Key Features
Live Odds Monitoring: Continuous updates from the betting platform.
Arbitrage Detection: Detects when a guaranteed profit opportunity arises.
Bookmaker Margin Estimation: Shows how much profit bookmakers make.
Streamlit Dashboard: Interactive visualization for odds & probabilities.
REST API: Easy access for programmatic use.
6. What’s Next?
I’m planning to add:
Support for multiple bookmakers (to find cross-platform arbitrage).
Custom market selection (e.g., over/under, totals).
Advanced notifications (Telegram/email alerts when arbitrage appears).
Better scaling (switching to async scraping for many events).
Disclaimer
This project is for educational purposes only. Betting involves financial risk, and arbitrage opportunities are rare and time-sensitive. Use this tool responsibly.
Check it out on GitHub: PariScrapper
Subscribe to my newsletter
Read articles from Shravan directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Shravan
Shravan
CSE Grad (AI & ML), MSRIT ’25 | Love building practical tech, contributing to open-source, and sharing my learnings. Always exploring new ideas to make tech more useful.