I built a Python-based optimiser that analyses 492 players from the official FPL API to find the single best 15-player squad for the first half of the 2025/26 season with no transfers, no captains, no wildcards, just the optimal team under all the rules.

Understanding the Constraints

The challenge of FPL optimisation is deceptively complex. You're not just picking the 15 highest-scoring players, you need to navigate multiple constraints while maximizing total points.

  • Total squad cost does not exceed £100m
  • Squad contains exactly 15 players
  • Squad consists of 2 goalkeepers, 5 defenders, 5 midfielders, and 3 forwards
  • No more than three players are selected from any single Premier League team
  • The squad supports one of the following valid formations: 3–4–3, 3–5–2, 4–3–3, 4–4–2, 4–5–1, 5–3–2, 5–4–1

The £100 million budget forces difficult trade-offs between premium assets and budget enablers. Traditional approaches using points-per-game or total points don't account for the interplay between budget allocation, team diversity, and positional balance.

The Optimisation Approach

My solution leverages the official FPL API to fetch gameweek-by-gameweek data for every player across all 19 gameweeks. The Python script makes over 600 API calls to build a comprehensive dataset, processing each player's performance history including:

  • Points scored
  • Minutes played
  • Team information

This data collection phase takes 5–10 minutes but provides the granular detail needed for accurate optimisation. The algorithm then processes this data using a greedy optimisation approach with a constraint satisfaction technique that balances computational efficiency with solution quality. Rather than testing every possible combination, the greedy algorithm intelligently builds the squad by prioritizing high-value players while dynamically managing the remaining budget to ensure all position requirements can be met. This data-driven approach reveals insights that eye-test analysis might miss: a £5.0 million goalkeeper like Roefs (90 points) delivers better value than more expensive alternatives, while premium defenders like Gabriel (£7.0m, 97 points) provide both attacking returns and clean sheet reliability. The code also simulates auto-substitutions across all 19 gameweeks, accounting for rotation and injuries to ensure the bench contributes meaningfully to the total points tally.

The Optimal Team

The resulting team demonstrates the power of balancing premium assets with smart budget allocation.

======================================================================
OPTIMAL FPL TEAM - 2025/26 Season (GW 1-19)
WITH AUTO-SUBSTITUTION SIMULATION
Total Squad Cost: £99.9m / £100.0m
Formation: 3-5-2
======================================================================

STARTING XI:

GKP:
  ✓ Roefs (SUN) - £5.0m - 90 pts

DEF:
  ✓ Gabriel (ARS) - £7.0m - 97 pts
  ✓ Guéhi (MCI) - £5.2m - 97 pts
  ✓ J.Timber (ARS) - £6.3m - 95 pts

MID:
  ✓ Semenyo (MCI) - £7.8m - 113 pts
  ✓ Rice (ARS) - £7.5m - 102 pts
  ✓ B.Fernandes (MUN) - £9.6m - 99 pts
  ✓ Foden (MCI) - £8.3m - 96 pts
  ✓ Bruno G. (NEW) - £7.2m - 96 pts

FWD:
  ✓ Thiago (BRE) - £7.1m - 91 pts
  ✓ Bowen (WHU) - £7.6m - 84 pts

BENCH (in priority order):
  1. Pickford (EVE) - £5.6m - 86 pts
  2. Chalobah (CHE) - £5.7m - 95 pts
  3. Tarkowski (EVE) - £5.8m - 94 pts
  4. Marc Guiu (CHE) - £4.2m - 12 pts

======================================================================
Total Points (GW 1-19) WITH AUTO-SUBS: 1158
Average Points per Gameweek: 60.9
======================================================================

The 3–5–2 formation loads up on elite midfielders through Bruno Fernandes (£9.6m), Foden (£8.3m), Rice (£7.5m), and Bruno Guimarães (£7.2m), all who consistently deliver points through goals, assists, and bonus. Arsenal's defensive coverage through Gabriel and Timber provides clean sheet potential from a top defensive unit. The forward line of Thiago and Bowen offers goal threat without needing to break the bank for Haaland. Every pound of the £100m budget is optimally allocated.

The Optimal FPL 15-player squad
The Optimal FPL 15-player squad for the first half of the 2025/26 season

Why This Matters for Data Science

This project shows how constraint optimisation and data analysis can solve complex, real-world problems. It demonstrates practical skills in API integration, greedy algorithms, and constraint satisfaction. For Fantasy Premier League managers, it proves that the best team isn't always the most obvious one. Whether you're building a data science portfolio or looking for an edge in your mini-league, this approach shows that with the right data and algorithms, you can find optimal solutions in problems with millions of possible combinations.

The code for this optimiser can be found in my Github repository