Intelligent FPL manager tool using GPT-4o for optimal squads, transfers & insights. Automatically tracks injuries, analyzes fixture difficulty over 5 gameweeks, and provides specific, actionable transfer recommendations.
- Live FPL data with injury tracking and availability status
- 5-Game Fixture Analysis - Analyzes next 5 fixtures per team with difficulty ratings
- Injury & Availability Report - Automatic detection of injured/doubtful players with urgency levels
- Potential Replacements - Specific ranked alternatives for each position with fixture analysis
- Optimized 15-Man Squad (Based on Current Squad Only)
- Captain & Vice-Captain recommendations
- Best Starting XI with optimal formation
- Bench Order prioritization
- Transfer Recommendations (0–5 Moves) - Prioritizes injuries and fixture difficulty
- Key Insights - Form, fixtures, rotation risks, and structural analysis
- Streamlit UI (sidebar settings, download MD)
- Automatically detects injured, doubtful, and unavailable players in your squad
- Provides status codes (available, doubtful, injured, unavailable, suspended)
- Shows chance of playing percentages and latest injury news
- Assigns urgency levels: Critical, High, Medium, Low
- Fetches and analyzes the next 5 gameweeks of fixtures
- Calculates difficulty ratings for each opponent (1=easiest, 5=hardest)
- Considers home/away advantage in recommendations
- Prioritizes players with favorable fixture runs
The AI prioritizes transfers based on:
- Injury Status (most important)
- Next 5 Fixtures (difficulty analysis)
- Recent form (last 5 gameweeks)
- Expected minutes and rotation risk
- Goals, assists, clean sheets
- Price per million value
For each position (GK, DEF, MID, FWD), the AI provides:
- Top 10 players ranked by form
- Specific alternatives for injured/underperforming players
- Price comparisons and budget impact
- Fixture difficulty analysis for each option
graph TD;
A[User Request] --> B[fetch_squad_analysis_data]
B --> C[Get Bootstrap Data]
C --> D[Process Player Data]
D --> E[Top 10 per Position]
E --> F[AI Prompt]
B --> G[Fetch Next 5 GWs Fixtures]
G --> H[Build Fixture Map]
H --> I[5-Game Difficulty]
I --> F
B --> K[Get User Team & Picks]
K --> L[Identify Injuries]
L --> M[Flagged Players List]
M --> F
F --> O[GPT Analysis]
O --> P[Comprehensive Recommend]
| Code | Meaning | Action |
|---|---|---|
a |
Available | No concern |
d |
Doubtful | Monitor closely |
i |
Injured | Consider transfer |
u |
Unavailable | Must transfer |
s |
Suspended | Must transfer |
n |
Not in squad | Must transfer |
- Clone
git clone https://github.com/k1lgor/fantasy-ai.git
cd fantasy-ai
- Install (uv recommended)
uv venv
uv pip install -r requirements.txt
- API Key
cp .env.example .env
# Add OPENAI_API_KEY=sk-...
- Run
uv run streamlit run app.py
- Use
- Team ID: 6589598 (default)
- Generate → Copy recs
- Push to GitHub (all files)
- share.streamlit.io → New app → GitHub repo
- Settings → Advanced → Secrets:
OPENAI_API_KEY = sk-your-key
- App live! Share URL.
- Sidebar: Team ID, GPT model (4o/mini)
- Generate button → Markdown recs + download/code
app.py- Streamlit UIfpl_data.py- FPL APIanalyzer.py- GPT prompts/data summaryrequirements.txt- Deps
- Prompts:
analyzer.py - Data:
fpl_data.py - UI:
app.py
- OpenAI costs (~$0.01/use)
- FPL API rate limits
- AI suggestions, verify!
See DEMO.md