Your request would look like this:
https://api.sportmonks.com/v3/football/fixtures/18452325?api_token=YOUR_TOKEN&include=events
The response
{
"data": {
"id": 18452325,
"sport_id": 1,
"league_id": 732,
"season_id": 18017,
"stage_id": 77452381,
"group_id": null,
"aggregate_id": null,
"round_id": null,
"state_id": 8,
"venue_id": 343341,
"name": "Argentina vs France",
"starting_at": "2022-12-18 15:00:00",
"result_info": "Argentina won after penalties.",
"leg": "1/1",
"details": null,
"length": 90,
"placeholder": false,
"last_processed_at": "2023-03-02 17:50:41",
"has_odds": true,
"starting_at_timestamp": 1671375600,
"events": [
{
"id": 71140989,
"fixture_id": 18452325,
"period_id": 4539357,
"participant_id": 18644,
"type_id": 16,
"section": "event",
"player_id": 184798,
"related_player_id": null,
"player_name": "Lionel Messi",
"related_player_name": null,
"result": "1-0",
"info": null,
"addition": "1st Goal",
"minute": 23,
"extra_minute": null,
"injured": null,
"on_bench": false,
"coach_id": null,
"sub_type_id": 1522
},
{
"id": 71141553,
"fixture_id": 18452325,
"period_id": 4539357,
"participant_id": 18644,
"type_id": 14,
"section": "event",
"player_id": 4105,
"related_player_id": 216612,
"player_name": "Ángel Di María ",
"related_player_name": "A. Mac Allister",
"result": "2-0",
"info": null,
"addition": "2nd Goal",
"minute": 36,
"extra_minute": null,
"injured": null,
"on_bench": false,
"coach_id": null,
"sub_type_id": 1522
},
{
"id": 71145170,
"fixture_id": 18452325,
"period_id": 4539357,
"participant_id": 18647,
"type_id": 18,
"section": "event",
"player_id": 432872,
"related_player_id": 32403,
"player_name": "R. Kolo Muani",
"related_player_name": "Ousmane Dembélé",
"result": null,
"info": null,
"addition": null,
"minute": 41,
"extra_minute": null,
"injured": false,
"on_bench": false,
"coach_id": null,
"sub_type_id": 1523
},
{
"id": 71145474,
"fixture_id": 18452325,
"period_id": 4539357,
"participant_id": 18647,
"type_id": 18,
"section": "event",
"player_id": 99000,
"related_player_id": 798,
"player_name": "Marcus Thuram",
"related_player_name": "Olivier Giroud",
"result": null,
"info": null,
"addition": null,
"minute": 41,
"extra_minute": null,
"injured": false,
"on_bench": false,
"coach_id": null,
"sub_type_id": 1523
},
{
"id": 71149608,
"fixture_id": 18452325,
"period_id": 4539396,
"participant_id": 18644,
"type_id": 18,
"section": "event",
"player_id": 212976,
"related_player_id": 4105,
"player_name": "Marcos Acuña",
"related_player_name": "Ángel Di María ",
"result": null,
"info": null,
"addition": null,
"minute": 64,
"extra_minute": null,
"injured": false,
"on_bench": false,
"coach_id": null,
"sub_type_id": 1523
},
{
"id": 71149766,
"fixture_id": 18452325,
"period_id": 4539396,
"participant_id": 18647,
"type_id": 14,
"section": "event",
"player_id": 96611,
"related_player_id": 99000,
"player_name": "Kylian Mbappé",
"related_player_name": "Marcus Thuram",
"result": "2-2",
"info": null,
"addition": "4th Goal",
"minute": 81,
"extra_minute": null,
"injured": null,
"on_bench": false,
"coach_id": null,
"sub_type_id": 1522
},
//and more!
As you can see in the response, you will receive all match events. But what if you’re only interested in a specific event like goals, cards or substitutions? You can filter on the specific data you’re interested in. For this example, we are only interested in the substitutions and goals. To filter your request, you need to:
- 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.
In our case, this will result in the following steps:
- Add the parameter &filters=
- Select the entity you want to filter on: event
- Select the field you want to filter on: Types (the event type substitution and goals)
- Fill in the IDs you’re interested in: 18,14
This results in the filter: evenTypes:18,14
https://api.sportmonks.com/v3/football/fixtures/18452325?api_token=YOUR_TOKEN&include=events&filters=eventTypes:18,14
Please check our request options page for more detailed information and helpful examples.
3.2 Selecting fields
API 3.0 introduces the possibility of requesting specific fields on entities. This possibility is useful when you only use particular fields in an API response. The advantage of selecting specific fields is that it decreases the response times and size, especially in large responses. In addition to reducing response time, the response size can also be drastically reduced. Let’s take a look at a quick example together.
One of our new additions to API 3.0 is a name field on the fixtures. The name field contains a textual representation of the participants playing the fixture. Without selecting a specific field, the API request and response would look like this:
Request
https://api.sportmonks.com/v3/football/fixtures/18452325?api_token=YOUR_TOKEN
Response
{
"data": {
"id": 18452325,
"sport_id": 1,
"league_id": 732,
"season_id": 18017,
"stage_id": 77452381,
"group_id": null,
"aggregate_id": null,
"round_id": null,
"state_id": 8,
"venue_id": 343341,
"name": "Argentina vs France",
"starting_at": "2022-12-18 15:00:00",
"result_info": "Argentina won after penalties.",
"leg": "1/1",
"details": null,
"length": 90,
"placeholder": false,
"last_processed_at": "2023-03-02 17:50:41",
"has_odds": true,
"starting_at_timestamp": 1671375600
},
As you can see, the API response is rather large if you’re only interested in the fixture’s name. Let’s select that API field to reduce the response length and size.
We’re using the fixtures endpoint. This means we can select all the fields of the fixtures entity.
You can add &select={specific fields on the base entity}.
In our example, this would result in the below API request and response:
Request
https://api.sportmonks.com/v3/football/fixtures/18452325?api_token=YOUR_TOKEN&select=name
Response
{
"data": {
"name": "Argentina vs France",
"id": 18452325,
"sport_id": 1,
"round_id": null,
"stage_id": 77452381,
"group_id": null,
"aggregate_id": null,
"league_id": 732,
"season_id": 18017,
"venue_id": 343341,
"state_id": 8,
"starting_at_timestamp": null
},
Quite convenient, isn’t it? Please check our documentation pages for more examples and information.
4. New syntax
5. Renewed Docs
Along with our API update, our documentation pages are also updated. With all these changes, that was essential. So, let’s find out where you can find the information you need.
Football
As mentioned before, there is a new set-up in our API. Football, Core and Odds are different domains. You can visit our Football domain for all information about our Football API.
Core
One of the other domains is Core. All information about continents, countries, regions, cities, types and filters can be found here. Also, the endpoints showing your subscription information can be found in Core.
Odds
The Odds domain shows information about all endpoints related to odds. Like pre-match odds, inplay odds, bookmakers and markets.
Changelog
We always seek ways to expand our coverage and offer new features. We closely monitor our changelog to keep you updated about new features and changes to the latest version of our API.
Entities
The new documentation delivers all information about entities as well. You will find field descriptions, usable includes and filters and more at the chapter entities.
Tutorials
We’ve written some well-explained tutorials to give you a head start on how to use our API. First, we describe the basics, and later, in the articles, we explain how to make more advanced requests.
How-to guides
Our how-to guides explain how to use our API to reach specific goals. For example, if you want to create a livescore page, team page or standing page. We even made pages to help you configure widgets and create custom plans. Please remember that you are always free to contact us if you still have questions.
Want to get started right away? Start- now