[GH-ISSUE #742] [FotMob] API calls now check for 'x-fm-req' in headers #160

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

Originally created by @tobias199822 on GitHub (Oct 31, 2024).
Original GitHub issue: https://github.com/probberechts/soccerdata/issues/742

Describe the bug
A clear and concise description of what the bug is and the expected behavior.

Affected scrapers
This affects the following scrapers:

  • ClubElo
  • ESPN
  • FBref
  • FiveThirtyEight
  • FotMob
  • Match History
  • SoFIFA
  • Understat
  • WhoScored

Code example

import soccerdata as sd

fotmob = FotMob(leagues='GER-Bundesliga', seasons='2024/25', no_cache=True)
match_stats = fotmob.read_team_match_stats(stat_type='Top stats')

Error message

Error while scraping                _common.py:545
                             https://www.fotmob.com/api/leagues?               
                             id=54&season=2024/2025. Retrying...               
                             (attempt 1 of 5).                                 
                             Traceback (most recent call last):                
                               File                                            
                             "C:\Users\tobia\AppData\Local\Progr               
                             ams\Python\Python312\Lib\site-packa               
                             ges\soccerdata\_common.py", line                  
                             525, in _download_and_save                        
                                 response.raise_for_status()                   
                               File                                            
                             "C:\Users\tobia\AppData\Local\Progr               
                             ams\Python\Python312\Lib\site-packa               
                             ges\requests\models.py", line 1021,               
                             in raise_for_status                               
                                 raise HTTPError(http_error_msg,               
                             response=self)                                    
                             requests.exceptions.HTTPError: 401                
                             Client Error: Unauthorized for url:               
                             https://www.fotmob.com/api/leagues?               
                             id=54&season=2024/2025          

Additional context

https://www.fotmob.com/api/leagues is not reachable manually too

Contributor Action Plan

  • I can fix this issue and will submit a pull request.
  • I’m unsure how to fix this, but I'm willing to work on it with guidance.
  • I’m not able to fix this issue.
Originally created by @tobias199822 on GitHub (Oct 31, 2024). Original GitHub issue: https://github.com/probberechts/soccerdata/issues/742 **Describe the bug** A clear and concise description of what the bug is and the expected behavior. **Affected scrapers** This affects the following scrapers: - [ ] ClubElo - [ ] ESPN - [ ] FBref - [ ] FiveThirtyEight - [x] FotMob - [ ] Match History - [ ] SoFIFA - [ ] Understat - [ ] WhoScored **Code example** ```py import soccerdata as sd fotmob = FotMob(leagues='GER-Bundesliga', seasons='2024/25', no_cache=True) match_stats = fotmob.read_team_match_stats(stat_type='Top stats') ``` **Error message** ``` Error while scraping _common.py:545 https://www.fotmob.com/api/leagues? id=54&season=2024/2025. Retrying... (attempt 1 of 5). Traceback (most recent call last): File "C:\Users\tobia\AppData\Local\Progr ams\Python\Python312\Lib\site-packa ges\soccerdata\_common.py", line 525, in _download_and_save response.raise_for_status() File "C:\Users\tobia\AppData\Local\Progr ams\Python\Python312\Lib\site-packa ges\requests\models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://www.fotmob.com/api/leagues? id=54&season=2024/2025 ``` **Additional context** https://www.fotmob.com/api/leagues is not reachable manually too **Contributor Action Plan** - [ ] I can fix this issue and will submit a pull request. - [ ] I’m unsure how to fix this, but I'm willing to work on it with guidance. - [ ] I’m not able to fix this issue.
kerem 2026-03-02 15:56:17 +03:00
  • closed this issue
  • added the
    bug
    label
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#160
No description provided.