[GH-ISSUE #896] [FotMob] Schedule unable to be read #195

Closed
opened 2026-03-02 15:56:34 +03:00 by kerem · 5 comments
Owner

Originally created by @n1ck-s1m on GitHub (Nov 17, 2025).
Original GitHub issue: https://github.com/probberechts/soccerdata/issues/896

Describe the bug
Unable to scrape the schedule from FotMob. Produces a KeyError: 'matches' error.

Affected scrapers
This affects the following scrapers:

  • FotMob

Code example

import soccerdata as sd
fotmob = sd.FotMob(leagues='ENG-Premier League', seasons='2025/2026', no_cache=True)
schedule = fotmob.read_schedule()
league_table = fotmob.read_league_table()

Error message

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Cell In[2], line 3
      1 import soccerdata as sd
      2 fotmob = sd.FotMob(leagues='ENG-Premier League', seasons='2025/2026', no_cache=True)
----> 3 schedule = fotmob.read_schedule()
      4 league_table = fotmob.read_league_table()

File [~\AppData\Roaming\Python\Python311\site-packages\soccerdata\fotmob.py:298](https://file+.vscode-resource.vscode-cdn.net/c%3A/Test/~/AppData/Roaming/Python/Python311/site-packages/soccerdata/fotmob.py:298), in FotMob.read_schedule(self, force_cache)
    295 reader = self.get(url, filepath, no_cache=current_season and not force_cache)
    296 season_data = json.load(reader)
--> 298 df = pd.json_normalize(season_data["matches"]["allMatches"])
    299 df["league"] = lkey
    300 df["season"] = skey

KeyError: 'matches'

Additional context
Has worked for me many times in the past and I have changed nothing in my enviroment

Contributor Action Plan

  • I’m not able to fix this issue.
Originally created by @n1ck-s1m on GitHub (Nov 17, 2025). Original GitHub issue: https://github.com/probberechts/soccerdata/issues/896 **Describe the bug** Unable to scrape the schedule from FotMob. Produces a KeyError: 'matches' error. **Affected scrapers** This affects the following scrapers: - [x] FotMob **Code example** ```python import soccerdata as sd fotmob = sd.FotMob(leagues='ENG-Premier League', seasons='2025/2026', no_cache=True) schedule = fotmob.read_schedule() league_table = fotmob.read_league_table() ``` **Error message** ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) Cell In[2], line 3 1 import soccerdata as sd 2 fotmob = sd.FotMob(leagues='ENG-Premier League', seasons='2025/2026', no_cache=True) ----> 3 schedule = fotmob.read_schedule() 4 league_table = fotmob.read_league_table() File [~\AppData\Roaming\Python\Python311\site-packages\soccerdata\fotmob.py:298](https://file+.vscode-resource.vscode-cdn.net/c%3A/Test/~/AppData/Roaming/Python/Python311/site-packages/soccerdata/fotmob.py:298), in FotMob.read_schedule(self, force_cache) 295 reader = self.get(url, filepath, no_cache=current_season and not force_cache) 296 season_data = json.load(reader) --> 298 df = pd.json_normalize(season_data["matches"]["allMatches"]) 299 df["league"] = lkey 300 df["season"] = skey KeyError: 'matches' ``` **Additional context** Has worked for me many times in the past and I have changed nothing in my enviroment **Contributor Action Plan** - [x] I’m not able to fix this issue.
kerem 2026-03-02 15:56:34 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@abroadnax commented on GitHub (Nov 17, 2025):

It looks like FotMob changed their JSON key from "matches" to "fixtures" which is causing the issue in the following line of read_schedule() within the FotMob.py file.

df = pd.json_normalize(season_data["matches"]["allMatches"])

I've tested it locally by switching "matches" to "fixtures" and it appears to work.

<!-- gh-comment-id:3543870076 --> @abroadnax commented on GitHub (Nov 17, 2025): It looks like FotMob changed their JSON key from "matches" to "fixtures" which is causing the issue in the following line of read_schedule() within the FotMob.py file. df = pd.json_normalize(season_data["matches"]["allMatches"]) I've tested it locally by switching "matches" to "fixtures" and it appears to work.
Author
Owner

@n1ck-s1m commented on GitHub (Nov 18, 2025):

You are correct - I made the same change and it has worked for me locally also.

<!-- gh-comment-id:3546297037 --> @n1ck-s1m commented on GitHub (Nov 18, 2025): You are correct - I made the same change and it has worked for me locally also.
Author
Owner

@liamrogan1 commented on GitHub (Nov 19, 2025):

Did they already change it? I just modified that line to say fixtures and still getting the same error

<!-- gh-comment-id:3550501865 --> @liamrogan1 commented on GitHub (Nov 19, 2025): Did they already change it? I just modified that line to say fixtures and still getting the same error
Author
Owner

@n1ck-s1m commented on GitHub (Nov 19, 2025):

Did they already change it? I just modified that line to say fixtures and still getting the same error

Try restarting your kernel/environment as the above change definitely works for me.

<!-- gh-comment-id:3551309180 --> @n1ck-s1m commented on GitHub (Nov 19, 2025): > Did they already change it? I just modified that line to say fixtures and still getting the same error Try restarting your kernel/environment as the above change definitely works for me.
Author
Owner

@joeninhoanalytics commented on GitHub (Dec 1, 2025):

Chanigng 'matches' to 'fixtures' works, but only for this season's data. Previous seasons still look to be using 'matches'. Has anyone found a patch that works for both historic and new data?

<!-- gh-comment-id:3595358577 --> @joeninhoanalytics commented on GitHub (Dec 1, 2025): Chanigng 'matches' to 'fixtures' works, but only for this season's data. Previous seasons still look to be using 'matches'. Has anyone found a patch that works for both historic and new data?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/soccerdata#195
No description provided.