Soccer betting screener using Livescore API
Project description
๐ฐ SlickBet - Soccer Betting Screener
A Python-based betting screener for soccer games using the Livescore API. Fetches upcoming matches, analyzes team statistics, and ranks betting opportunities by win probability.
Features
- ๐ Multi-Day Screening - Screen matches for the next N days
- ๐ 11-Factor Analysis - Comprehensive statistical model with xG and reliability metrics
- ๐ฒ Double Chance Bets - Safer betting options (1X, X2, 12)
- ๐ Major European Leagues - Bundesliga, Premier League, La Liga, Serie A, Ligue 1
- ๐ Minor European Leagues - Belgian Pro League, Primeira Liga, Super Lig, Eredivisie, 1. HNL, Ekstraklasa, Premiership, Super League
- ๐ Asia Leagues - Saudi Pro League, Hyundai A-League (Australia)
- ๐ Americas Leagues - Liga Professional (Argentina), Serie A (Brazil), Liga MX (Mexico)
- ๐ฏ Confidence Grades - Visual indicators (๐ฅ HIGH VALUE, โ GOOD BET, ๐ DECENT, โ ๏ธ RISKY)
- ๐ Backtesting - Validate model accuracy against historical data
- ๐ป CLI Interface - Easy-to-use command-line tool
- ๐ PDF Export - Export results to shareable PDF reports
Installation
This project uses uv for fast, reliable Python package management.
# Clone the repository
git clone https://github.com/your-username/slick-bet.git
cd slick-bet
# Install dependencies with uv
uv sync
# Install with dev dependencies
uv sync --dev
Configuration
Set your Livescore API credentials as environment variables:
export LIVESCORE_API_KEY="your_api_key"
export LIVESCORE_API_SECRET="your_api_secret"
Quick Start
# Screen all leagues for tomorrow with top 20 results
poe run-all --days=1 --top=20
# Screen major European leagues only (tomorrow's games)
poe run-major
# Screen Asia leagues only for 3 days
poe run-asia --days=3
# Screen Americas leagues only for 3 days
poe run-americas --days=3
# Backtest all leagues for 1 week
poe backtest-all-global --weeks=1
๐ All Commands
Screener Commands
All Leagues (Major + Minor European + Asia + Americas)
| Command | Description |
|---|---|
poe run-all --days N |
Screen ALL leagues for next N days |
poe run-all-week |
Screen ALL leagues for next 7 days |
Major European Leagues
| Command | Description |
|---|---|
poe run-major |
Screen major European leagues (tomorrow) |
poe run-major-week |
Screen major European leagues for 7 days |
poe run-bundesliga --days N |
๐ฉ๐ช Bundesliga only |
poe run-pl --days N |
๐ฌ๐ง Premier League only |
poe run-laliga --days N |
๐ช๐ธ La Liga only |
poe run-seriea --days N |
๐ฎ๐น Serie A only |
poe run-ligue1 --days N |
๐ซ๐ท Ligue 1 only |
Asia Leagues
| Command | Description |
|---|---|
poe run-asia --days N |
Screen all Asia leagues for N days |
poe run-saudi --days N |
๐ธ๐ฆ Saudi Pro League only |
poe run-australia --days N |
๐ฆ๐บ Hyundai A-League only |
Americas Leagues
| Command | Description |
|---|---|
poe run-americas --days N |
Screen all Americas leagues for N days |
poe run-argentina --days N |
๐ฆ๐ท Liga Professional only |
poe run-brazil --days N |
๐ง๐ท Serie A only |
poe run-mexico --days N |
๐ฒ๐ฝ Liga MX only |
Basic Commands
| Command | Description |
|---|---|
poe run |
Screen tomorrow's games |
poe run-top --top K |
Show top K betting opportunities |
poe run-days --days N |
Screen next N days |
Backtest Commands
Aggregated Backtests
| Command | Description |
|---|---|
poe backtest-all --weeks N |
Backtest ALL major + minor European leagues |
poe backtest-asia --weeks N |
Backtest ALL Asia leagues (Saudi, Australia) |
poe backtest-all-global --weeks N |
Backtest ALL leagues (Major + Minor European + Asia + Americas) |
poe backtest-all-global --weeks N --debug=1 |
Same as above with detailed match-by-match debug output |
Note: Add --debug=1 to any backtest command (or --debug for direct CLI usage) to see detailed match-by-match information including:
- Match details (date, teams, competition)
- Actual match results
- Our predictions (team, probability, confidence)
- Whether the prediction was correct or incorrect
- Key reasoning factors
Individual League Backtests
| Command | Description |
|---|---|
poe backtest-bundesliga --weeks N |
๐ฉ๐ช Bundesliga |
poe backtest-pl --weeks N |
๐ฌ๐ง Premier League |
poe backtest-liga --weeks N |
๐ช๐ธ La Liga |
poe backtest-seriea --weeks N |
๐ฎ๐น Serie A |
poe backtest-ligue1 --weeks N |
๐ซ๐ท Ligue 1 |
poe backtest-saudi --weeks N |
๐ธ๐ฆ Saudi Pro League |
poe backtest-australia --weeks N |
๐ฆ๐บ Hyundai A-League |
poe backtest-argentina --weeks N |
๐ฆ๐ท Liga Professional |
poe backtest-brazil --weeks N |
๐ง๐ท Serie A |
poe backtest-mexico --weeks N |
๐ฒ๐ฝ Liga MX |
Development Commands
| Command | Description |
|---|---|
poe lint |
Run linter |
poe lint-fix |
Fix linting issues |
poe format |
Format code |
poe typecheck |
Run type checker |
poe test |
Run tests |
poe test-cov |
Run tests with coverage |
poe check |
Run all code quality checks |
poe fix |
Fix linting and format code |
poe dev |
Fix code and run tests |
๐ League IDs
Major European Leagues
| ID | League | Country |
|---|---|---|
| 1 | Bundesliga | ๐ฉ๐ช Germany |
| 2 | Premier League | ๐ฌ๐ง England |
| 3 | La Liga | ๐ช๐ธ Spain |
| 4 | Serie A | ๐ฎ๐น Italy |
| 5 | Ligue 1 | ๐ซ๐ท France |
Minor European Leagues
| ID | League | Country |
|---|---|---|
| 68 | Belgian Pro League | ๐ง๐ช Belgium |
| 8 | Primeira Liga | ๐ต๐น Portugal |
| 6 | Super Lig | ๐น๐ท Turkey |
| 196 | Eredivisie | ๐ณ๐ฑ Netherlands |
| 17 | 1. HNL | ๐ญ๐ท Croatia |
| 60 | Ekstraklasa | ๐ต๐ฑ Poland |
| 75 | Premiership | ๐ด๓ ง๓ ข๓ ณ๓ ฃ๓ ด๓ ฟ Scotland |
| 9 | Super League | ๐ฌ๐ท Greece |
Asia Leagues
| ID | League | Country |
|---|---|---|
| 313 | Saudi Pro League | ๐ธ๐ฆ Saudi Arabia |
| 67 | Hyundai A-League | ๐ฆ๐บ Australia |
Americas Leagues
| ID | League | Country |
|---|---|---|
| 23 | Liga Professional | ๐ฆ๐ท Argentina |
| 24 | Serie A | ๐ง๐ท Brazil |
| 45 | Liga MX | ๐ฒ๐ฝ Mexico |
Use slickbet competitions --country <name> to find more competition IDs.
๐ง How the Model Works
The betting model uses an 11-factor weighted scoring system with advanced statistics:
| Factor | Weight | Description |
|---|---|---|
| Position | 19% | League table standing differential |
| Odds | 17% | Bookmaker pre-match odds (implied probability) |
| Form | 15% | Recent match results (last 5 games) |
| Goals | 11% | Attack/defense strength (goals scored/conceded per game) |
| Home Advantage | 9% | Historical home team advantage |
| Momentum | 6% | First-half lead rate + win rate + comeback ability |
| H2H | 7% | Historical head-to-head record |
| Venue Form | 6% | Home/away specific win rates |
| Defense | 5% | Clean sheet rate |
| Match Stats | 5% | Possession, attacks, shots (includes xG at 28%, xGD at 15%, Shot Accuracy at 10%) |
| Reliability | 4% | Team discipline based on cards (fewer cards = more reliable) |
Note: The Match Stats factor includes xG (Expected Goals) weighted at 28%, xGD (Expected Goal Difference) at 15%, and Shot Accuracy at 10% within that factor. The Reliability factor measures team discipline - teams with fewer yellow/red cards are more predictable and reliable for betting.
๐ Key Statistical Predictors
The model incorporates advanced statistical metrics that are proven predictors of soccer match outcomes:
Expected Goals (xG)
- Premier metric for evaluating the quality of scoring chances
- Directly correlates with team success and future performance
- Weighted at 28% within the Match Stats factor (highest weight)
- Calculated from historical match statistics, measuring shot quality and chance creation
- Teams with higher xG averages are more likely to score and win
Expected Goal Difference (xGD)
- Strong predictor of a team's points per match over a season
- Calculated as the difference between team's xG and opponent's xG (xG - xGA)
- Weighted at 15% within the Match Stats factor
- Teams with positive xGD consistently outperform those with negative xGD
Shots on Target
- Often cited as the strongest in-game correlate of winning
- Outperforms raw possession or total shots in predictive power
- Weighted at 12% within the Match Stats factor
- More reliable indicator than total shots, as it measures actual goal-scoring opportunities
Shot Accuracy
- Measures the quality of chances created (shots on target / total shots)
- More predictive than total shots alone - indicates better chance quality
- Weighted at 10% within the Match Stats factor
- Teams with higher shot accuracy create better scoring opportunities
Goal Conversion Rate
- Measures efficiency in turning opportunities into actual goals
- Calculated from goals scored relative to shots on target
- Weighted at 8% within the Match Stats factor
- Teams with higher conversion rates are more clinical and dangerous
Defensive Metrics (xGA - Expected Goals Against)
- Lowering expected goals against is as crucial for predicting wins as high offensive xG
- Measured through goals conceded per game in the Goals factor
- Defense factor (5% weight) specifically evaluates clean sheet rates
- Teams that consistently limit opponent chances (low xGA) are more likely to win
How These Metrics Work Together
The model combines these statistical predictors with traditional factors (form, position, H2H) to create a comprehensive prediction:
- Match Stats (5% total):
- xG: 28% (most predictive metric)
- xGD: 15% (strong predictor of points per match)
- Possession: 18%
- Shots on Target: 12% (strongest in-game correlate)
- Shot Accuracy: 10% (quality indicator)
- Goal Conversion Rate: 8% (efficiency)
- Dangerous Attacks: 6%
- Attacks: 2%
- Corners: 1%
- Goals (11%): Incorporates attack/defense differential (goals scored vs conceded)
- Defense (5%): Clean sheet rate as a proxy for defensive xGA performance
This multi-layered approach ensures that both offensive quality (xG, xGD, shots on target, shot accuracy) and defensive solidity (xGA, clean sheets) are properly weighted in predictions.
Double Chance Betting
The model also calculates double chance probabilities for safer bets:
- 1X - Home wins OR Draw (Home doesn't lose)
- X2 - Away wins OR Draw (Away doesn't lose)
- 12 - Home OR Away wins (No draw)
Confidence Grades
Each prediction is assigned a grade based on backtest performance:
- ๐ฅ HIGH VALUE - Best picks (DC โฅ80%, Win โฅ65%)
- โ GOOD BET - Reliable picks (DC โฅ75%, Win โฅ60%)
- ๐ DECENT - Ok picks (DC โฅ70%)
- โ ๏ธ RISKY - Use double chance only
๐ Backtest Results
1-Week Backtest Results
Based on 1-week backtests across all leagues (147 matches):
Aggregated Results
- Total Matches: 147
- Correct Predictions: 84
- Overall Accuracy: 57.1%
- Draws Encountered: 42 (28.6%)
- Accuracy (excl. draws): 80.0%
- Best Recommended Double Chance: 84.3%
League Comparison
| League | Matches | Accuracy | Excl. Draws | Best DC |
|---|---|---|---|---|
| ๐ซ๐ท Ligue 1 | 9 | 66.7% | 100.0% | 100.0% |
| ๐ฌ๐ท Super League | 7 | 85.7% | 100.0% | 100.0% |
| ๐ธ๐ฆ Saudi Pro League | 15 | 60.0% | 100.0% | 100.0% |
| ๐ง๐ท Serie A | 3 | 100.0% | 100.0% | 100.0% |
| ๐ฒ๐ฝ Liga MX | 9 | 66.7% | 100.0% | 100.0% |
| ๐ฎ๐น Serie A | 10 | 80.0% | 88.9% | 90.0% |
| ๐ฉ๐ช Bundesliga | 9 | 66.7% | 85.7% | 88.9% |
| ๐ฌ๐ง Premier League | 10 | 60.0% | 85.7% | 90.0% |
| ๐ต๐น Primeira Liga | 9 | 66.7% | 85.7% | 88.9% |
| ๐น๐ท Super Lig | 9 | 66.7% | 85.7% | 88.9% |
| ๐ณ๐ฑ Eredivisie | 9 | 44.4% | 80.0% | 88.9% |
| ๐ด๓ ง๓ ข๓ ณ๓ ฃ๓ ด๓ ฟ Premiership | 7 | 57.1% | 80.0% | 85.7% |
| ๐ต๐ฑ Ekstraklasa | 9 | 77.8% | 77.8% | 77.8% |
| ๐ช๐ธ La Liga | 10 | 40.0% | 66.7% | 80.0% |
| ๐ง๐ช Belgian Pro League | 8 | 50.0% | 66.7% | 75.0% |
| ๐ฆ๐ท Liga Professional | 21 | 38.1% | 66.7% | 81.0% |
| ๐ญ๐ท 1. HNL | 5 | 40.0% | 50.0% | 60.0% |
| ๐ฆ๐บ Hyundai A-League | 5 | 40.0% | 50.0% | 60.0% |
Key Findings (1-Week Results)
- Overall accuracy: 57.1% (80.0% excluding draws) across 147 matches
- Double Chance is the safest bet type with 84.3% accuracy
- Top performing leagues (excl. draws):
- ๐ซ๐ท Ligue 1: 100.0% (9 matches)
- ๐ฌ๐ท Super League: 100.0% (7 matches)
- ๐ธ๐ฆ Saudi Pro League: 100.0% (15 matches)
- ๐ง๐ท Serie A: 100.0% (3 matches)
- ๐ฒ๐ฝ Liga MX: 100.0% (9 matches)
- ๐ฎ๐น Serie A: 88.9% (10 matches)
- Draw rate: 28.6% - use Double Chance for safer bets
- Best leagues for predictions: Ligue 1, Super League, Saudi Pro League, Serie A (Brazil), Liga MX
๐ป Direct CLI Usage
# Basic screening
slickbet # Screen tomorrow's games
slickbet --top 10 # Show top 10 opportunities
slickbet --days 5 # Screen next 5 days
# League filters
slickbet --major-only # Major European leagues only
slickbet --asia-only # Asia leagues only (Saudi, Australia)
slickbet --americas-only # Americas leagues only (Argentina, Brazil, Mexico)
slickbet --all-leagues # All supported leagues (Major + Minor European + Asia + Americas)
slickbet --league 2 # Specific league by ID
# Probability filters
slickbet --min-prob 0.60 # Only โฅ60% probability
slickbet --min-conf 0.30 # Only โฅ30% confidence
# Output options
slickbet --json # JSON output
slickbet --pdf # Export to PDF (auto-generated filename)
slickbet --pdf my_report.pdf # Export to specific PDF file
slickbet --no-stats # Fast mode (skip detailed stats)
# Backtesting
slickbet backtest --competition 2 --weeks 4 # Premier League, 4 weeks
slickbet backtest --competition 2 --weeks 4 --pdf # Export backtest to PDF
slickbet backtest --competition 2 --weeks 4 --debug # With detailed match-by-match debug output
slickbet backtest-all --weeks 4 # All major + minor European leagues
slickbet backtest-all --weeks 4 --pdf # Export aggregated results to PDF
slickbet backtest-all --asia-only --weeks 4 # All Asia leagues (Saudi, Australia)
slickbet backtest-all --americas-only --weeks 4 # All Americas leagues (Argentina, Brazil, Mexico)
slickbet backtest-all --include-asia --weeks 4 # Major + Minor European + Asia
slickbet backtest-all --include-asia --include-americas --weeks 4 # Major + Minor European + Asia + Americas
slickbet backtest-all --include-asia --include-americas --weeks 4 --debug # With detailed match-by-match debug output
๐ Python API
from slickbet import BettingScreener, ScreenerConfig
# Create a screener for all leagues
config = ScreenerConfig(
min_probability=0.60,
all_leagues=True,
)
screener = BettingScreener(config=config)
# Screen next 3 days
result = screener.screen_days(3)
# Get top 10 betting opportunities (sorted by double chance probability)
for bet in result.get_top_k(10):
match = bet.match
dc = bet.double_chance
print(f"๐๏ธ {match.home_team.name} ({match.home_position}) vs "
f"{match.away_team.name} ({match.away_position})")
print(f"๐ {match.competition}")
# Double chance recommendation
best_dc, prob = dc.best_double_chance
print(f"โญ Recommended: {best_dc} - {prob:.1%}")
# Win bet
print(f"๐ฐ Win bet: {bet.probability:.1%}")
print()
Backtesting
from slickbet import Backtester, format_backtest_report
backtester = Backtester()
# Run backtest on Saudi Pro League (4 weeks)
results = backtester.run(
competition_id="313",
weeks=4,
)
# Print report
print(format_backtest_report(results))
# Access metrics
print(f"Accuracy (excl. draws): {results.accuracy_excluding_draws:.1%}")
print(f"Best Double Chance: {results.best_double_chance_accuracy:.1%}")
๐ Project Structure
slick-bet/
โโโ src/
โ โโโ slickbet/
โ โโโ __init__.py # Package exports
โ โโโ api.py # Livescore API client
โ โโโ model.py # 11-factor betting model (includes xG and reliability)
โ โโโ screener.py # Main screener logic
โ โโโ backtest.py # Backtesting module
โ โโโ cli.py # Command-line interface
โ โโโ pdf_export.py # PDF report generation
โโโ tests/ # Test files
โ โโโ __init__.py
โ โโโ test_model.py
โโโ assets/
โ โโโ predictions/ # Generated PDF reports
โโโ pyproject.toml # Project config (uv, poe, ruff, mypy)
โโโ uv.lock # Lock file (auto-generated)
โโโ LICENSE
โโโ README.md
โ ๏ธ Disclaimer
This tool is for educational and entertainment purposes only.
- Past performance does not guarantee future results
- Sports betting involves risk of financial loss
- Always predict responsibly and within your means
- Check local laws regarding sports betting in your jurisdiction
License
MIT License - See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file slickbet-0.2.0.tar.gz.
File metadata
- Download URL: slickbet-0.2.0.tar.gz
- Upload date:
- Size: 154.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b13eb194f94ddda654d73627055257de4ec2cd11272104382942c7b6c395727
|
|
| MD5 |
76330614aa6c7094e248064d8164c943
|
|
| BLAKE2b-256 |
b0ffe5894249746d23d4d223162b39dafe8e5b917ea5ada83d22efb9ca741992
|
File details
Details for the file slickbet-0.2.0-py3-none-any.whl.
File metadata
- Download URL: slickbet-0.2.0-py3-none-any.whl
- Upload date:
- Size: 61.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc9e4bf821126088975df0fbd7d6182a20588c62c906476520dd3bbf50a6c756
|
|
| MD5 |
23dbd407e1c05a56b5dfc7a9021f94df
|
|
| BLAKE2b-256 |
14d90ec105fc43f83ef051515cadb4907259b86ba7f771ab99e77164f9432173
|