⚽
API 3.0
OddsCoreFootball APIAPI 2 (Deprecated)WidgetsContact
Football API 3.0
Football API 3.0
  • Welcome
    • 🛬Welcome
    • 🙋‍♂️Getting Started
    • 🤓What can you do with Sportmonks' data?
    • 🆕Differences between API 2 and API 3
      • API Changes
      • Syntax and filters
      • New endpoints and data features
    • 🔐Authentication
    • 👶Making your first request
    • 🔧Best Practices
  • API coach (BETA)
  • Changelog
    • 📄Changelog
    • 📁Changelog (BETA)
  • API
    • 💡Request options
      • Includes
        • Nested includes
      • Selecting fields
      • Filtering
      • Selecting and filtering
      • Ordering and sorting
    • 🔤Syntax
    • ♾️Rate limit
    • 👀Meta description
    • 📔Error codes
      • Include Exceptions
      • Filtering and Complexity Exceptions
      • Other Exceptions
    • 📚Code libraries
    • Translations (beta)
    • Demo response files
    • Data corrections
    • API 2.0 (Deprecated)
  • Endpoints and Entities
    • Endpoints
      • 📡Livescores
        • GET Inplay Livescores
        • GET All Livescores
        • GET Latest Updated Livescores
      • 🥅Fixtures
        • GET All Fixtures
        • GET Fixture by ID
        • GET Fixtures by Multiple IDs
        • GET Fixtures by Date
        • GET Fixtures by Date Range
        • GET Fixtures by Date Range for Team
        • GET Fixtures by Head To Head
        • GET Fixtures by Search by Name
        • GET Upcoming Fixtures by Market ID
        • GET Upcoming Fixtures by TV Station ID
        • GET Past Fixtures by TV Station ID
        • GET Latest Updated Fixtures
      • 🛰️States
        • GET All States
        • GET State by ID
      • ⌨️Types
        • GET All Types
        • GET Type by ID
        • GET Type by Entity
      • 🏆Leagues
        • GET All Leagues
        • GET League by ID
        • GET Leagues by Live
        • GET Leagues by Fixture Date
        • GET Leagues by Country ID
        • GET Leagues Search by Name
        • GET All Leagues by Team ID
        • GET Current Leagues by Team ID
      • 🗓️Seasons
        • GET All Seasons
        • GET Seasons by ID
        • GET Seasons by Team ID
        • GET Seasons by Search by Name
      • 📊Statistics
        • GET Season Statistics by Participant
        • GET Stage Statistics by ID
        • GET Round Statistics by ID
      • 📅Schedules
        • GET Schedules by Season ID
        • GET Schedules by Team ID
        • GET Schedules by Season ID and Team ID
      • 🪜Stages
        • GET All Stages
        • GET Stage by ID
        • GET Stages by Season ID
        • GET Stages by Search by Name
      • 🔂Rounds
        • GET All Rounds
        • GET Round by ID
        • GET Rounds by Season ID
        • GET Rounds by Search by Name
      • 🔢Standings
        • GET All Standings
        • GET Standings by Season ID
        • GET Standings by Round ID
        • GET Standing Correction by Season ID
        • Get Live Standings by League ID
      • 🥇Topscorers
        • GET Topscorers by Season ID
        • GET Topscorers by Stage ID
      • 🏃Teams
        • GET All Teams
        • GET Team by ID
        • GET Teams by Country ID
        • GET Teams by Season ID
        • GET Teams by Search by Name
      • 🧑Players
        • GET All Players
        • GET Player by ID
        • GET Players by Country ID
        • GET Players by Search by Name
        • GET Last Updated Players
      • 🧑‍🦱Team Squads
        • GET Team Squad by Team ID
        • GET Extended Team Squad by Team ID
        • GET Team Squad by Team and Season ID
      • 👨‍🏫Coaches
        • GET All Coaches
        • GET Coach by ID
        • GET Coaches by Country ID
        • GET Coaches Search by Name
        • GET Last Updated Coaches
      • 🕴️Referees
        • GET All Referees
        • GET Referee by ID
        • GET Referees by Country ID
        • GET Referees by Season ID
        • GET Referees Search by Name
      • ↔️Transfers
        • GET All Transfers
        • GET Transfer by ID
        • GET Latest Transfers
        • GET Transfers Between Date Range
        • GET Transfers by Team ID
        • GET Transfers by Player ID
      • 🏟️Venues
        • GET All Venues
        • GET Venue by ID
        • GET Venues by Season ID
        • GET Venues by Search by Name
      • 📺TV Stations
        • GET All TV Stations
        • GET TV Station by ID
        • GET TV Stations by Fixture ID
      • 🔮Expected (xG)
        • GET Expected by Team
        • GET Expected by Player
      • 🔭Predictions
        • GET Probabilities
        • GET Predictability by League ID
        • GET Probabilities by Fixture ID
        • GET Value Bets
        • GET Value Bets by Fixture ID
      • 🧙Standard Odds Feed
        • 👓Pre-match Odds
          • GET All Odds
          • Get Odds by Fixture ID
          • GET Odds by Fixture ID and Bookmaker ID
          • GET Odds by Fixture ID and Market ID
          • GET Last Updated Odds
        • 🧠Inplay Odds
          • GET All Inplay Odds
          • GET Inplay Odds by Fixture ID
          • GET Inplay Odds by Fixture ID and Bookmaker ID
          • GET Inplay Odds by Fixture ID and Market ID
          • GET Last Updated Inplay Odds
      • 🧙‍♂️Premium Odds Feed
        • 🕶️Premium Pre-match Odds
          • GET All Premium Odds
          • Get Premium Odds by Fixture ID
          • GET Premium Odds by Fixture ID and Bookmaker ID
          • GET Premium Odds by Fixture ID and Market ID
          • GET Updated Premium Odds Between Time Range
          • GET Updated Historical Odds Between Time Range
          • GET All Historical Odds
      • 🛒Markets
        • GET All Markets
        • GET All Premium Markets
        • GET Market by ID
        • GET Market by Search
      • 📑Bookmakers
        • GET All Bookmakers
        • GET All Premium Bookmakers
        • GET Bookmaker by ID
        • GET Bookmaker by Search
        • GET Bookmaker by Fixture ID
      • 📰News
        • GET Pre-Match News
        • GET Pre-Match News by Season ID
        • GET Pre-Match News for Upcoming Fixtures
        • GET Post-Match News
        • GET Post-Match News by Season ID
      • ⚔️Rivals
        • GET All Rivals
        • GET Rivals by Team ID
      • 🎙️Commentaries
        • GET All Commentaries
        • GET Commentaries by Fixture ID
    • Entities
      • 🥅Fixture
      • 🏆League, Season, Schedule, Stage and Round
      • 🧑‍🤝‍🧑Team, Player, Squad, Coach and Referee
      • 🔢Statistic
      • 🔮Expected
      • 🥇Standing and Topscorer
      • 🔭Odd and Prediction
      • Other
  • Tutorials and Guides
    • Tutorials
      • Introduction
        • Make your first request
        • Set your time zone
        • Pagination
      • Enrich your response
        • Nested includes
          • Syntax and relations
      • Includes
        • Events
        • States
        • Periods
        • Scores
        • Participants
        • Lineups
        • ballCoordinates
        • Pressure Index
        • Tips and tricks
      • Filter and select fields
        • Selecting fields
        • Filtering
        • Selecting and filtering
      • Leagues and seasons
        • Leagues
        • Seasons
      • Season schedule
        • Schedules
        • Stages
        • Rounds
      • Livescores and fixtures
        • Livescores
        • Fixtures
      • Lineups and formations
      • Statistics
        • Statistics types
        • Season statistics
        • Fixture statistics
        • Team statistics
        • Players statistics
      • Teams, players, coaches and referees
        • Teams
        • Players
        • Coaches
        • Referees
      • Standings
        • Season standings
        • Topscorer standings
      • Odds and predictions
        • Bookmakers
        • Markets
        • Pre-match odds
        • Live(Inplay) odds
        • hasOdds
        • Predictions
          • Probabilities
          • Value Bet
      • Expected
        • Endpoints
        • Includes
        • Coverage
      • News
        • Pre-match News
        • Post-match News
      • Placeholders
      • Timezone parameters on different endpoints
    • Guides
      • How-to use components
      • How-to use the Football API with Postman
      • How-to use the Football API tester
      • How-to use the Football API ID finder
      • How-to build a livescore website
      • How-to use the Predictions API
      • How-to build a match page
      • How-to build a custom plan
      • How-to build a match page with odds
      • How-to use xG data
      • How-to build a news website
      • How-to build a fantasy game guide
      • How-to use the new Champions League data
      • How-to build your World Cup application
      • How-to build a team page
      • How-to keep your database in SYNC
      • How-to use team mode in MySportmonks
      • How-to use TOTW
    • Programming languages
      • A developers guide: Unleashing the power of the football API with JSON
      • A developers guide: Unleashing the power of the football API with PHP
      • A developers guide: Unleashing the power of the football API with Python
  • Definitions
    • 📔Response Codes
    • 🛰️States
    • ⌨️Types
      • Lineups, positions and formations
      • Events
      • Statistics
        • Coach statistics
        • Referee statistics
        • Stage statistics
        • Season statistics
        • Fixture statistics
        • Team statistics
        • Player statistics
      • Expected
      • Leagues and stages
      • Standings
      • Transfers
      • Highlights
      • Weather and pitch
  • FAQ
    • API 3.0
    • Odds
    • Integration
    • Sportmonks
  • Quicklinks
    • Postman
    • ID Finder
    • Sportmonks
    • MySportmonks
    • Football widgets
    • Plans and Pricing
    • Data features
    • FAQ
Powered by GitBook
On this page
  • What are includes?
  • Creating the request
  • Evaluating the response
  • Enrich your response with includes
  • Conclusion

Was this helpful?

  1. Tutorials and Guides
  2. Tutorials

Includes

On this page you will learn about includes and how they will enrich your response, so you will get exactly the API response you need/expect.

PreviousSyntax and relationsNextEvents

Last updated 10 months ago

Was this helpful?

What are includes?

Includes are the cornerstone of our API and allow you to enrich and customise your requests. This flexibility is what distinguishes Sportmonks from all competitors. Each endpoint comes with a list of includes. For more information, please refer to our API reference guide.

Creating the request

In this tutorial, our goal is to analyze a match played on the 3rd of September, 2022. We want to know who the teams are and what events (goals, cards, substitutions) happened during the match.

Our starting endpoint will be the endpoint:

https://api.sportmonks.com/v3/football/fixtures/date/2022-09-03?api_token=YOUR_TOKEN

The date is in YYYY-MM-DD format.

This request will give you all the fixtures of a specific date. In our case, the 3rd of September 2022, which is what we want.

Note that you only have access to the leagues that are available in your plan.

Evaluating the response

All of our endpoints will give you a ‘basic’ response by default. As you can see, we will receive information mostly containing unique ids.

Response
{
  "data": [
      {
        "id": 18537988,
        "sport_id": 1,
        "league_id": 501,
        "season_id": 19735,
        "stage_id": 77457866,
        "group_id": null,
        "aggregate_id": null,
        "round_id": 275093,
        "state_id": 1,
        "venue_id": 336296,
        "name": "Hearts vs St. Johnstone",
        "starting_at": "2023-03-04 15:00:00",
        "result_info": null,
        "leg": "1/1",
        "details": null,
        "length": 90,
        "placeholder": false,
        "last_processed_at": "2023-03-02 00:15:27",
        "has_odds": true,
        "starting_at_timestamp": 1677942000
      },
      {
        "id": 18537977,
        "sport_id": 1,
        "league_id": 501,
        "season_id": 19735,
        "stage_id": 77457866,
        "group_id": null,
        "aggregate_id": null,
        "round_id": 275091,
        "state_id": 5,
        "venue_id": 8946,
        "name": "Hibernian vs Kilmarnock",
        "starting_at": "2023-02-18 15:00:00",
        "result_info": "Hibernian won after full-time.",
        "leg": "1/1",
        "details": null,
        "length": 90,
        "placeholder": false,
        "last_processed_at": "2023-02-25 14:55:39",
        "has_odds": true,
        "starting_at_timestamp": 1676732400
      },
      {
        "id": 18537990,
        "sport_id": 1,
        "league_id": 501,
        "season_id": 19735,
        "stage_id": 77457866,
        "group_id": null,
        "aggregate_id": null,
        "round_id": 275093,
        "state_id": 1,
        "venue_id": 8914,
        "name": "Rangers vs Kilmarnock",
        "starting_at": "2023-03-04 15:00:00",
        "result_info": null,
        "leg": "1/1",
        "details": null,
        "length": 90,
        "placeholder": false,
        "last_processed_at": "2023-03-02 00:15:27",
        "has_odds": true,
        "starting_at_timestamp": 1677942000
      },
//And more

You can see the fixture id, the names of the teams involved and the home and away scores. However, what if we want to know more about the participating teams, their team names, or what their logos look like?

Enrich your response with includes

This is where includes come into play. By merely adding &include=participants to the request, we have successfully used includes. This request will show you the extra data about the participants because we've ‘included’ information about the participants.

Your request:

https://api.sportmonks.com/v3/football/fixtures/date/2022-09-03?api_token=YOUR_TOKEN&include=participants
Response
{
  "data": {
    "id": 18535605,
    "sport_id": 1,
    "league_id": 501,
    "season_id": 19735,
    "stage_id": 77457866,
    "group_id": null,
    "aggregate_id": null,
    "round_id": 274733,
    "state_id": 5,
    "venue_id": 8914,
    "name": "Rangers vs Celtic",
    "starting_at": "2023-01-02 12:30:00",
    "result_info": "Game ended in draw.",
    "leg": "1/1",
    "details": null,
    "length": 90,
    "placeholder": false,
    "last_processed_at": "2023-02-17 10:19:54",
    "has_odds": true,
    "starting_at_timestamp": 1672662600,
    "participants": [
      {
        "id": 53,
        "sport_id": 1,
        "country_id": 1161,
        "venue_id": 8909,
        "gender": "male",
        "name": "Celtic",
        "short_code": "CEL",
        "image_path": "https://cdn.sportmonks.com/images/soccer/teams/21/53.png",
        "founded": 1888,
        "type": "domestic",
        "placeholder": false,
        "last_played_at": "2023-02-26 15:00:00",
        "meta": {
          "location": "away",
          "winner": false,
          "position": 1
        }
      },
      {
        "id": 62,
        "sport_id": 1,
        "country_id": 1161,
        "venue_id": 8914,
        "gender": "male",
        "name": "Rangers",
        "short_code": "RAN",
        "image_path": "https://cdn.sportmonks.com/images/soccer/teams/30/62.png",
        "founded": 1873,
        "type": "domestic",
        "placeholder": false,
        "last_played_at": "2023-02-26 15:00:00",
        "meta": {
          "location": "home",
          "winner": false,
          "position": 2
        }
      }
    ]
  },

The API will give you all the information about the participants. You can see the team names, the logos when the team was founded, the venue id, and more.

Like shooting fish in a barrel, right?

But we’re not done yet! We still want to know about the events (goals, cards, and substitutions) that happened during the match.

We can simply add the include events to our request:

https://api.sportmonks.com/v3/football/fixtures/date/2022-09-03?api_token=YOUR_TOKEN&include=participants;events

And we'll get all the events per fixture.

You can view a snippet of the response below.

Response
{
  "data": {
    "id": 18535605,
    "sport_id": 1,
    "league_id": 501,
    "season_id": 19735,
    "stage_id": 77457866,
    "group_id": null,
    "aggregate_id": null,
    "round_id": 274733,
    "state_id": 5,
    "venue_id": 8914,
    "name": "Rangers vs Celtic",
    "starting_at": "2023-01-02 12:30:00",
    "result_info": "Game ended in draw.",
    "leg": "1/1",
    "details": null,
    "length": 90,
    "placeholder": false,
    "last_processed_at": "2023-02-17 10:19:54",
    "has_odds": true,
    "starting_at_timestamp": 1672662600,
    "participants": [
      {
        "id": 53,
        "sport_id": 1,
        "country_id": 1161,
        "venue_id": 8909,
        "gender": "male",
        "name": "Celtic",
        "short_code": "CEL",
        "image_path": "https://cdn.sportmonks.com/images/soccer/teams/21/53.png",
        "founded": 1888,
        "type": "domestic",
        "placeholder": false,
        "last_played_at": "2023-02-26 15:00:00",
        "meta": {
          "location": "away",
          "winner": false,
          "position": 1
        }
      },
      {
        "id": 62,
        "sport_id": 1,
        "country_id": 1161,
        "venue_id": 8914,
        "gender": "male",
        "name": "Rangers",
        "short_code": "RAN",
        "image_path": "https://cdn.sportmonks.com/images/soccer/teams/30/62.png",
        "founded": 1873,
        "type": "domestic",
        "placeholder": false,
        "last_played_at": "2023-02-26 15:00:00",
        "meta": {
          "location": "home",
          "winner": false,
          "position": 2
        }
      }
    ],
    "events": [
      {
        "id": 71257512,
        "fixture_id": 18535605,
        "period_id": 4546648,
        "participant_id": 53,
        "type_id": 14,
        "section": "event",
        "player_id": 319282,
        "related_player_id": null,
        "player_name": "Daizen Maeda",
        "related_player_name": null,
        "result": "0-1",
        "info": null,
        "addition": "1st Goal",
        "minute": 5,
        "extra_minute": null,
        "injured": null,
        "on_bench": false,
        "coach_id": null,
        "sub_type_id": 1522
      },
      {
        "id": 71257554,
        "fixture_id": 18535605,
        "period_id": 4546648,
        "participant_id": 53,
        "type_id": 18,
        "section": "event",
        "player_id": 74000,
        "related_player_id": 173080,
        "player_name": "Josip Juranovic",
        "related_player_name": "Greg Taylor",
        "result": null,
        "info": null,
        "addition": null,
        "minute": 21,
        "extra_minute": null,
        "injured": true,
        "on_bench": false,
        "coach_id": null,
        "sub_type_id": 1524
      },
 // and more! 

Now we have extra information about the participating teams and all the fixtures' events! Just like that, we achieved our goal.

Includes are basically add-ons that you can use with your request for additional information. The endpoint provides basic data, while the include gives you extra information.

Conclusion

Are you interested in an explanation of all the fields? Check the .

Our API uses the query complexity mechanism to determine the number of includes you can use. More info: .

The API is very flexible. You will find out more about the flexibility and request options . Not all includes work with every endpoint. So please make sure that you check which includes are available per endpoint in our API reference guide.

There are also more advanced includes called nested includes. These are relationships of relationships. You can already check out our for more information.

Not seeing all the data you expected to see? Check out our tutorial about .

GET Fixture by Date
query complexity
here
nested includes tutorial
pagination
fixture entities page