Web Scraping Football Data With Python (Part 2): Connecting to the FotMob API
The Step Where Web Scraping Actually Starts to Work
If you haven’t read the first part of this series yet, I strongly recommend starting here:
👉 https://www.footballhacking.com/p/web-scraping-football-data-with-python
That article lays the foundation for everything we are about to do now.
From this point forward, things start to get really interesting.
Because here’s the truth: the real power of football data scraping doesn’t begin with Python syntax — it begins when you successfully connect to the API.
And that’s exactly what you’ll learn today.
Before we go any further, an important note 👇
From this post onward, all articles in this web scraping series will be exclusive to premium subscribers.
Thank you for trusting my work and supporting this project — it’s what allows me to go deeper, slower, and with real technical rigor. 🙏
Why This Step Matters More Than You Think
At first glance, “connecting to an API” might sound trivial.
But when the API does not want to be accessed, everything changes.
FotMob does not provide a public API.
That means:
Headers matter
Cookies matter
Referers matter
And small mistakes break everything
In this second step, we are not yet scraping match events or advanced stats.
Our goal is simpler — and more strategic:
First, we need to fetch all matches of a league.
Only after that can we safely access the specific match we want to analyze.
Think of it as reconnaissance before entering the battlefield.
Project Structure and Environment Setup
Let’s start clean and organized.




