[GH-ISSUE #528] [FotMob] Multiple Invalid Stat Types for FotMob #96

Closed
opened 2026-03-02 15:55:44 +03:00 by kerem · 6 comments
Owner

Originally created by @6abd on GitHub (Apr 1, 2024).
Original GitHub issue: https://github.com/probberechts/soccerdata/issues/528

When trying to call read_team_match_stats(), the stat types given by the docs cause an "Invalid stat type" error for multiple categories. The "Top stats" category seems to be one of the only working ones.

Originally created by @6abd on GitHub (Apr 1, 2024). Original GitHub issue: https://github.com/probberechts/soccerdata/issues/528 When trying to call `read_team_match_stats()`, the stat types given by the docs cause an "Invalid stat type" error for multiple categories. The "Top stats" category seems to be one of the only working ones.
kerem 2026-03-02 15:55:44 +03:00
  • closed this issue
  • added the
    bug
    FotMob
    labels
Author
Owner

@6abd commented on GitHub (Apr 1, 2024):

I also just discovered that stats in the working "Top stats" category show the opponents' stats for each metric.

<!-- gh-comment-id:2029401206 --> @6abd commented on GitHub (Apr 1, 2024): I also just discovered that stats in the working "Top stats" category show the opponents' stats for each metric.
Author
Owner

@marcjbaron commented on GitHub (Apr 3, 2024):

What seasons and leagues are causing the issues?

<!-- gh-comment-id:2034888593 --> @marcjbaron commented on GitHub (Apr 3, 2024): What seasons and leagues are causing the issues?
Author
Owner

@6abd commented on GitHub (Apr 3, 2024):

What seasons and leagues are causing the issues?

I've only done the 2015-16 Barcelona season because that's what I'm using for a project, but it is probably a site-wide thing due to changes. FBref also could have an added playing-time stat and I think some outdated requests because some of the stat categories don't work on that site too.

<!-- gh-comment-id:2034942590 --> @6abd commented on GitHub (Apr 3, 2024): > What seasons and leagues are causing the issues? I've only done the 2015-16 Barcelona season because that's what I'm using for a project, but it is probably a site-wide thing due to changes. FBref also could have an added playing-time stat and I think some outdated requests because some of the stat categories don't work on that site too.
Author
Owner

@marcjbaron commented on GitHub (Apr 3, 2024):

I've only done the 2015-16 Barcelona season because that's what I'm using for a project, but it is probably a site-wide thing due to changes.

Yes, it looks like there are limited stats available for seasons prior to 2016-2017, so the available stats are all in the "Top stats" category.

For the second issue, if you set opponent_stats=False, it will give you the requested team's stats. When it is set to True (the default setting), it should give both team's stats, but it only returns the opponent's stats, so that's an issue that may be worth looking into.

<!-- gh-comment-id:2035126880 --> @marcjbaron commented on GitHub (Apr 3, 2024): > I've only done the 2015-16 Barcelona season because that's what I'm using for a project, but it is probably a site-wide thing due to changes. Yes, it looks like there are limited stats available for seasons prior to 2016-2017, so the available stats are all in the "Top stats" category. For the second issue, if you set `opponent_stats=False`, it will give you the requested team's stats. When it is set to `True` (the default setting), it should give both team's stats, but it only returns the opponent's stats, so that's an issue that may be worth looking into.
Author
Owner

@6abd commented on GitHub (Apr 4, 2024):

I've only done the 2015-16 Barcelona season because that's what I'm using for a project, but it is probably a site-wide thing due to changes.

Yes, it looks like there are limited stats available for seasons prior to 2016-2017, so the available stats are all in the "Top stats" category.

For the second issue, if you set opponent_stats=False, it will give you the requested team's stats. When it is set to True (the default setting), it should give both team's stats, but it only returns the opponent's stats, so that's an issue that may be worth looking into.

Ok, thank you.

<!-- gh-comment-id:2037034657 --> @6abd commented on GitHub (Apr 4, 2024): > > I've only done the 2015-16 Barcelona season because that's what I'm using for a project, but it is probably a site-wide thing due to changes. > > > > Yes, it looks like there are limited stats available for seasons prior to 2016-2017, so the available stats are all in the "Top stats" category. > > > > For the second issue, if you set `opponent_stats=False`, it will give you the requested team's stats. When it is set to `True` (the default setting), it should give both team's stats, but it only returns the opponent's stats, so that's an issue that may be worth looking into. Ok, thank you.
Author
Owner

@squirrelplays commented on GitHub (Jun 18, 2024):

Hey, just to add to this.

When I run Bolton Wanderers in ENG League One for the 2023/24 season using this code

match_stats = fotmob.read_team_match_stats(opponent_stats=True, team='Bolton Wanderers', stat_type='Expected goals (xG)')

I get an error - and closer inspection this appears to be that some of this club's games were abandoned in the year.

Specifically when I run this code

schedule = fotmob.read_schedule()
bolton_games = schedule[(schedule['home_team'] == 'Bolton Wanderers') | (schedule['away_team'] == 'Bolton Wanderers')]
bolton_games

Then for some games status = Ab (as opposed to FT, which is what most games say) and this leads to an error

<!-- gh-comment-id:2176260337 --> @squirrelplays commented on GitHub (Jun 18, 2024): Hey, just to add to this. When I run Bolton Wanderers in ENG League One for the 2023/24 season using this code match_stats = fotmob.read_team_match_stats(opponent_stats=True, team='Bolton Wanderers', stat_type='Expected goals (xG)') I get an error - and closer inspection this appears to be that some of this club's games were abandoned in the year. Specifically when I run this code schedule = fotmob.read_schedule() bolton_games = schedule[(schedule['home_team'] == 'Bolton Wanderers') | (schedule['away_team'] == 'Bolton Wanderers')] bolton_games Then for some games status = Ab (as opposed to FT, which is what most games say) and this leads to an error
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#96
No description provided.