Statistics types
A brief introduction about types
We introduced states and types to ensure data quality and consistency for specific fields. Something has a type when there are multiple variants of a particular variant. Sounds difficult? Let's explain with an example:
Hint: you can request all possible types with their unique id via the types endpoint: https://api.sportmonks.com/v3/core/types?api_token=YOUR_TOKEN
Fixture statistics
As you’ve learned in our includes tutorial, you can quickly enrich your request by using includes. You can obtain the statistics for your favourite fixture by adding the &include=statistics
to your request. So, for example, the Celtic vs. Rangers fixture:
This request returns all the match statistics of both teams for the requested fixture. As you might have noticed, you receive a lot of values belonging to different type ids. What does this mean exactly?
Just add the nested &include=statistics.type
to receive a textual representation:
Now you can distinguish between the various match statistics for both teams.
Interested in an overview of all statistics types? Check our statistics types overview page.
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.
With this in mind, dive into one of our statistics tutorials:
Season statisticsFixture statisticsTeam statisticsPlayers statistics
Last updated