Players statistics
Last but not least, you can retrieve player statistics. The fundamentals and steps are the same as for the team endpoint. First, you can use one of our players' endpoints. For example, the Player by ID endpoint:
Let's say you want the statistics of James Tavernier (id 758). You can use the statistics include:
Now, just like in the previous section, you need to add details
to retrieve the statistics values and type
to retrieve the name of the statistics:
Please check the response carefully to see the correct values for the types.
Including .type
is not recommended as an include on any endpoint. Types are used throughout the entire API. We recommend retrieving all types from the types endpoint and storing them in your database or other data structure. Only include the type if no other option is available or when testing the API.
Filtering player statistics
The API returns all the available season statistics for the requested player. Only interested in some of the seasons? You can use a filter to only retrieve stats for a specific season.
Add the parameter
&filters=
Select the entity you want to filter on
Select the field you want to filter on
Fill in the IDs you're interested in
Let's say you're only interested in the statistics of the 2022/2023 season (id: 19735). This will result in the following steps:
Add the parameter
&filters=
Select the entity you want to filter on:
playerStatistic
Select the field you want to filter on:
Seasons
Fill in the IDs you're interested in:
19735
Are you only interested in a specific statistic, like key passes? Add another filter to your request:
Add the parameter
&filters=
Select the entity you want to filter on:
playerStatisticDetail
Select the field you want to filter on:
Types
Fill in the IDs you're interested in:
117
(You can retrieve them via the Types endpoint or by looking at the previous request)
It's important to note that you can retrieve statistics from multiple entities. Therefore, you also need to specify for which entity you want to filter the statistics. You can do this by prefixing the filter with the entity's name. So in our case: playerStatisticDetail
Are you interested in player statistics for a specific fixture? Check our fixture statistics tutorial.
Interested in coaches and referees? You can use the same steps as for the player's statistics tutorial. Simply change the entity from players to referees or coaches and use the according endpoints.
Coach example:
https://api.sportmonks.com/v3/football/coaches/{ID}?api_token=YOUR_TOKEN&include=statistics.details.type
Referee example:
https://api.sportmonks.com/v3/football/referees/{ID}?api_token=YOUR_TOKEN&include=statistics.details.type
Last updated