Team statistics
Next to the fixture and season fixtures, you can request team statistics. You can use the Team by ID endpoint with the statistics
include. For example, for Rangers (id: 62)
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 with 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 team statistics
The API returns all the available season statistics for the requested team. Only interested in some of the seasons? You can use a filter only to 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:
teamStatistic
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 total team wins? Add another filter to your request:
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 number of wins. The this will result in the following steps:
Add the parameter
&filters=
Select the entity you want to filter on:
teamStatisticDetail
Select the field you want to filter on:
Types
Fill in the IDs you're interested in:
214
(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: teamStatisticDetail
Are you interested in team statistics for a specific fixture? Check our fixture statistics tutorial.
Last updated