What the FPL!?
I've been working on a revamped version of my Fantasy Premier League helper tool, What the FPL!? I initially built the first version back in 2019, and this version is a complete rebuild with a much more solid technical foundation. The original version used a simpler predicted points algorithm, but this rebuild takes a more sophisticated approach.
The project is a serverless data pipeline that mirrors the Fantasy Premier League public APIAPI A set of rules and protocols that allows different software applications to communicate with each other. APIs define the methods and data formats that applications can use to request and exchange information. into a Supabase Postgres database. It's built with Next.js App Router and runs on Vercelvercel Vercel is a cloud platform for frontend developers. It is used to deploy and host websites and web applications., where scheduled GitHub Actions workflows invoke the collection routines through APIAPI A set of rules and protocols that allows different software applications to communicate with each other. APIs define the methods and data formats that applications can use to request and exchange information. routes. The collected data is stored as immutable snapshots, so I can analyze historical trends and make better decisions about my team.

The architecture is straightforward: GitHub Actions hits a cron endpoint every hour, which triggers the data collector. The collector fetches fresh data from the FPL APIAPI A set of rules and protocols that allows different software applications to communicate with each other. APIs define the methods and data formats that applications can use to request and exchange information., writes snapshots, and updates master tables. Everything is tracked in Supabase with job history, so I can see what's happening and when.

The dashboard gives me a clean view of players, teams, and gameweek data. I can filter by position, team, status, and see historical trends through the snapshot system. But the real power of the tool comes from its team optimization features.
Team optimization with custom metrics
What the FPL!? helps you optimize your team using my own custom metrics, including expectation-weighted fitness. This metric goes beyond simple point totals by weighting player performance against their expected output based on their position and upcoming fixture difficulty. It gives you a clearer picture of which players are truly outperforming their cost and situation.
The optimization engine uses a genetic algorithm to find a (probably) optimal team composition within your budget constraints. It starts with a population of random team configurations, then evolves them over multiple generations by:
- Evaluating fitness: Each team is scored using the custom metrics, including expectation-weighted fitness
- Selecting parents: The best-performing teams are selected to breed the next generation
- Crossover: Combining successful team configurations to create new combinations
- Mutation: Introducing random changes to explore new possibilities
- Iteration: Repeating this process until the algorithm converges on optimal solutions
This approach lets you explore thousands of team combinations automatically, finding lineups you might never have considered manually. You can specify constraints like budget, required players, and formation preferences, and the algorithm will find the best team that meets those requirements.

The whole thing is open source and available on GitHub, with a full RESTREST An architectural style for designing networked applications. REST uses HTTP methods (GET, POST, PUT, DELETE) to perform operations on resources identified by URLs. APIAPI A set of rules and protocols that allows different software applications to communicate with each other. APIs define the methods and data formats that applications can use to request and exchange information. for querying current and historical data. It's been a fun project to rebuild with modern tooling, and it's already helping me make better picks this season.
If you're curious about the original 2019 version, you can read about it here.
