An API for scraping data from understat.com,
Low maintenance activity. Last release 9 months ago, commits in 0 of the last 26 weeks. Weaker on commit activity and contributor spread.
pip install understatapiREADME as published on PyPI with version 0.7.1.
understatAPI
This is a python API for scraping data from understat.com. Understat is a website with football data for 6 european leagues for every season since 2014/15 season. The leagues available are the Premier League, La Liga, Ligue 1, Serie A, Bundesliga and the Russian Premier League.
NOTE
I am not affiliated with understat.com in any way
Installation
To install the package run
pip install understatapi
If you would like to use the package with the latest development changes you can clone this repo and install the package
git clone git@github.com:collinb9/understatAPI understatAPI
cd understatAPI
python -m pip install .
Getting started
The API contains endpoints which reflect the structure of the understat website. Below is a table showing the different endpoints and the pages on understat.com to which they correspond
| Endpoint | Webpage |
|---|---|
| UnderstatClient.league | https://understat.com/league/<league_name> |
| UnderstatClient.team | https://understat.com/team/<team_name>/<season> |
| UnderstatClient.player | https://understat.com/player/<player_id> |
| UnderstatClient.match | https://understat.com/match/<match_id> |
Every method in the public API corresponds to one of the tables visible on the understat page for the relevant endpoint.
Each method returns JSON with the relevant data. Below are some examples of how to use the API. Note how the league() and team() methods can accept the names of leagues and teams respectively, but and must receive an id number.