Filtering
Last updated
Last updated
Next to selecting specific fields on the base entity or includes, it’s possible to filter your request.
Filters are improved in API 3 to give even more possibilities to get the data the way you need it. Each endpoint has two types of filters, static and dynamic filters. You can combine any dynamic filter with any static filter or use a multitude.
Static filters are always the same and filter in one specific way without any custom options.
The dynamic filters are based on entities and includes. Each dynamic filter uses an entity to filter on and one entity to apply the filter to. Below is an example with an explanation of how filters are set up.
https://api.sportmonks.com/v3/football/fixtures?api_token=YOUR_TOKEN&include=statistics&filters=statisticTypes:42,49
The include or base Entity you want to filter, this entity defines what you are filtering and what results are modified. In this case, you want to filter statistics. This is always a singular version of the entity.
The Entities you expect to receive when filtering. In this case, you want to receive all the statistics that have a specific type. This is always a plural version of the entity.
The ID's you want to filter on for the 2nd part, in this case types. You can separate the ID's by using a comma.
You can find more information in our Filtering Tutorial:
Filtering