Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue report - 404 Client Error #60

Open
K1K1K1Zhang opened this issue Jan 30, 2024 · 1 comment
Open

Issue report - 404 Client Error #60

K1K1K1Zhang opened this issue Jan 30, 2024 · 1 comment
Assignees

Comments

@K1K1K1Zhang
Copy link

Contact Details

No response

Version

1.0.1

What platform are you seeing the problem on?

Windows

What Python version are you running, are you using a virtual environment? Give us as much info as you can.

Python 3.11

What happened?

After installing the 'statsbombpy' package, I successfully loaded the data of competitions just as you showed.
However, when looking for data in matches and lineups, I came across with this error:

微信图片_20240130152939

Is the link invaild?

Relevant log output

---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_119264\326908906.py in <module>
----> 1 sb.matches(competition_id=9, season_id=42)

D:\Software\Anaconda\lib\site-packages\statsbombpy\sb.py in matches(competition_id, season_id, fmt, creds)
     29         matches = api_client.matches(competition_id, season_id, creds=creds)
     30     else:
---> 31         matches = public.matches(competition_id, season_id)
     32     if fmt == "dataframe":
     33         home_managers = [

D:\Software\Anaconda\lib\site-packages\statsbombpy\public.py in matches(competition_id, season_id)
     22         competition_id=competition_id, season_id=season_id
     23     )
---> 24     matches = get_response(path)
     25     matches = ents.matches(matches)
     26     return matches

D:\Software\Anaconda\lib\site-packages\statsbombpy\public.py in get_response(path)
      7 def get_response(path):
      8     response = req.get(path)
----> 9     response.raise_for_status()
     10     data = response.json()
     11     return data

D:\Software\Anaconda\lib\site-packages\requests\models.py in raise_for_status(self)
   1019 
   1020         if http_error_msg:
-> 1021             raise HTTPError(http_error_msg, response=self)
   1022 
   1023     def close(self):

HTTPError: 404 Client Error: Not Found for url: https://raw.githubusercontent.com/statsbomb/open-data/master/data/matches/9/42.json

Code to reproduce issue

No response

Attempted solutions

No response

@WillTGM
Copy link
Contributor

WillTGM commented Jan 30, 2024

Hi,

That competition isn't available via the public open data I'm afraid.

You can try a different combination e.g. sb.matches(competition_id=9, season_id=27) which should be available. You can view the competitions available from the open-data here or via sb.competitions().

We're going to add something to make this more explicit for future reference.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants