LogoLogo
Quick StartFootball APIContactAPI 3.0
  • Welcome
  • Changelog
  • Getting Started
    • Get Started
    • Documentation for the documentation
  • Endpoint overview
    • Continents
      • GET All Continents
      • GET Continent by ID
    • Countries
      • GET All Countries
      • GET Country by ID
    • Leagues
      • GET All Leagues
      • GET League by ID
      • GET Leagues by Country ID
      • Search Leagues by Name
    • Seasons
      • GET All Seasons
      • GET Season by ID
    • Fixtures
      • GET Fixture by ID
      • GET Last Updated Fixtures
      • GET Fixtures by Date
      • GET Fixtures by Date Range
      • GET Fixtures by Date Range for Team
      • GET Fixtures by Multiple ID's
      • GET Deleted Fixtures
    • Statistics
    • Livescores
      • GET All Livescores
      • GET All In play Livescores
    • News API
      • GET All News
      • GET News For Upcoming Fixtures
      • GET News by Season ID
    • Commentaries
      • Commentaries by Fixture ID
    • Video Highlights
      • Get Video Highlights by Fixture ID
    • Head 2 Head
      • GET Head 2 Head by Team IDs
    • Standings
      • GET Standings by Season ID
      • GET LIVE Standings
      • GET Standings by Season ID and Round ID
      • GET Standings by Season and Date(time)
      • GET Standings Corrections by Season ID
    • Teams
      • GET Team by ID
      • GET Teams by Country ID
      • GET Teams by Season ID
      • Search Team by Name
      • GET Current Leagues by Team ID
      • Get All Leagues by Team ID
    • Players
      • GET Player by ID
      • GET Players by Country ID
      • Search Player by Name
    • Topscorers
      • GET Topscorers by Season ID
      • GET Topscorers Aggregated by Season ID
    • Rivals
      • GET Rivals by Team ID
    • Venues
      • GET Venue by ID
      • GET Venues by Season ID
    • Rounds
      • GET Rounds by Season ID
      • GET Round by ID
    • Odds
      • GET Odds by Fixture ID and Bookmaker ID
      • GET Odds by Fixture ID and Market ID
      • GET Odds by Fixture ID
      • GET Inplay Odds by Fixture ID
    • Coaches
      • GET Coach by ID
    • Stages
      • GET Stage by ID
      • GET Stages by Season ID
    • Bookmakers
      • GET All Bookmakers by Fixture ID
      • GET All Bookmakers
      • GET Bookmaker by ID
    • Markets
      • GET All Fixtures by Market ID
      • GET All Markets
      • GET Market by ID
    • Team Squads
      • GET Team Squad by Team and Season ID
    • TV Stations
      • GET TV Station by Fixture ID
    • Prediction API
      • GET Leagues and Performances
      • GET Probabilities
      • GET Probabilities by Fixture ID
      • GET Value Bets
      • GET Value Bet by Fixture ID
  • Tutorials
    • Introduction to our API
      • Make your first request
      • Set your time zone
      • Pagination
    • Enriching your response
      • Includes
      • Nested includes
    • Filtering, limiting & sorting
      • Filtering
      • Limiting
      • Sorting
    • Schedule, fixtures & livescores
      • Season schedule
      • Fixtures
      • Livescores
    • Statistics
      • Match statistics
      • Team statistics
      • Player statistics
      • Season statistics
    • League & topscorers standings
      • League standings
      • Topscorers standings
    • Odds & predictions
      • Odds
        • Odds by fixture, bookmaker and market id
        • FlatOdds
        • InplayOdds
      • Predictions
  • MySportmonks
    • How-to build a custom plan
    • ID Finder
  • How-to Guides
    • Get Started with our how-to guides
      • How-to build your API requests
    • Livescores & fixtures
      • How-to build a livescore website
      • How-to build a schedule page
    • Match & team pages
      • How-to build a match page with events and statistics
      • How-to build a match page with line-ups/formations
      • How-to build a team page with season stats and squads
    • How-to build standings and topscorer standings
      • League standings
      • Topscorer standings
    • Odds & predictions
      • How-to build a match page with odds
      • How-to build a betting odds portal
      • How-to use the predictions API
    • How-to build a fantasy game
    • Developer tools
      • How-to use Sportmonks' APIs in Postman
    • How-to keep your database in sync
    • World Cup 2022
    • EURO 2024
    • Football widgets
      • How-to set up football widgets in your web application
      • Configurations
      • Widgets overview
        • Livescore widget
        • International Cup widgets
  • API References
    • API reference guide
    • Data features
    • ID Finder
    • Code libraries
    • Demo response files
    • Statuses and definitions
    • API Rate limiting
    • Response codes
    • Meta description
  • General
  • Sportmonks
  • Plans & pricing
  • FAQ
  • Contact
Powered by GitBook
On this page
  • Step 1: Gather the tools
  • Step 2: Decide which events and statistics you want to show
  • Step 3: Choose the correct endpoint/include
  • Events
  • Statistics
  • Head-2-head
  • Step 4: Example basic requests
  • Step 5: Evaluate the response
  • Player statistics
  • Team statistics
  • Events
  • Head2head

Was this helpful?

Export as PDF
  1. How-to Guides
  2. Match & team pages

How-to build a match page with events and statistics

PreviousMatch & team pagesNextHow-to build a match page with line-ups/formations

Last updated 3 years ago

Was this helpful?

Welcome to our how-to guide about creating a match page that is filled with various events and statistics. This is a follow-up on the guide. The livescore page only shows the live score of the match and sometimes the bigger events such as goals, substitutions, and cards. For basic knowledge about , , and please see our tutorials.

Step 1: Gather the tools

You are going to need the following tools:

  • SportMonks API token

  • Code editor (Visual studio used in examples)

  • Postman (optional)

Step 2: Decide which events and statistics you want to show

At SportMonks we offer the following events:

  • Goals

  • Red and yellow cards

  • Substitutions

  • VAR

  • Extra time

  • Score in between Half and Final time

  • Corners

For match statistics, think about anything that can happen during a match such as: The number of shots, passes, attacks, fouls, corners, offsides, yellow/red cards, saves, substitutions, goal attempts, penalties, injuries, and many more. Player statistics are all the relevant statistics regarding a player, such as the number of goals scored, how many fouls he made, and the number of cards received, etc.

Step 3: Choose the correct endpoint/include

Events

Statistics

Player and match statistics do not have endpoints, but instead can be evoked with includes.

  • Match statistics use the include stats.

  • Player statistics use the includes lineup and bench.

Lineup only gives us the 11 starting players, while we want everyone from the bench as well.

It’s also possible to include both stats, lineup and bench includes in the same request, but expect a lengthy response in that case.

Head-2-head

Step 4: Example basic requests

In this how-to guide, we’ll show you how to request events data, player and match statistics, and head2head data:

https://soccer.sportmonks.com/api/v2.0/fixtures/{ID}?api_token={API_TOKEN}&include=stats,lineup,bench,events
https://soccer.sportmonks.com/api/v2.0/head2head/{TEAM1_ID}/{TEAM2_ID}/?api_token={API_TOKEN}

It’s also possible to use the stats and lineup includes in the head2head endpoint, in case you want to show even more in-depth data about the history of these matches.

Step 5: Evaluate the response

"data": [
                {
                    "team_id": 53,
                    "fixture_id": 16475287,
                    "player_id": 172923,
                    "player_name": "S. Bain",
                    "number": 29,
                    "position": "G",
                    "additional_position": null,
                    "formation_position": 1,
                    "posx": null,
                    "posy": null,
                    "captain": false,
                    "type": "lineup",
                    "stats": {
                        "shots": {
                            "shots_total": 0,
                            "shots_on_goal": 0
                        },
                        "goals": {
                            "scored": 0,
                            "assists": 0,
                            "conceded": 1,
                            "owngoals": 0
                        },
                        "fouls": {
                            "drawn": 0,
                            "committed": 0
                        },
                        "cards": {
                            "yellowcards": 0,
                            "redcards": 0,
                            "yellowredcards": 0
                        },
                        "passing": {
                            "total_crosses": 0,
                            "crosses_accuracy": 0,
                            "passes": 23,
                            "accurate_passes": 20,
                            "passes_accuracy": 91,
                            "key_passes": 0
                        },
                        "dribbles": {
                            "attempts": 0,
                            "success": 0,
                            "dribbled_past": 0
                        },
                        "duels": {
                            "total": 1,
                            "won": 1
                        },
                        "other": {
                            "aerials_won": null,
                            "punches": null,
                            "offsides": 0,
                            "saves": 1,
                            "inside_box_saves": 0,
                            "pen_scored": 0,
                            "pen_missed": 0,
                            "pen_saved": 0,
                            "pen_committed": 0,
                            "pen_won": 0,
                            "hit_woodwork": 0,
                            "tackles": 0,
                            "blocks": 0,
                            "interceptions": 0,
                            "clearances": 0,
                            "dispossesed": 0,
                            "minutes_played": 90
                        },
                        "rating": "6.42"
                    }
"stats": {
            "data": [
                {
                    "team_id": 53,
                    "fixture_id": 16475287,
                    "shots": {
                        "total": 28,
                        "ongoal": 15,
                        "blocked": 6,
                        "offgoal": 13,
                        "insidebox": 18,
                        "outsidebox": 7
                    },
                    "passes": {
                        "total": 670,
                        "accurate": 587,
                        "percentage": 87.61
                    },
                    "attacks": {
                        "attacks": 115,
                        "dangerous_attacks": 55
                    },
                    "fouls": 9,
                    "corners": 11,
                    "offsides": 0,
                    "possessiontime": 80,
                    "yellowcards": 1,
                    "redcards": 0,
                    "yellowredcards": 0,
                    "saves": 1,
                    "substitutions": 4,
                    "goal_kick": null,
                    "goal_attempts": 19,
                    "free_kick": null,
                    "throw_in": null,
                    "ball_safe": 91,
                    "goals": 5,
                    "penalties": 0,
                    "injuries": 0
                },
                {
                    "team_id": 338,
                    "fixture_id": 16475287,
                    "shots": {
                        "total": 6,
                        "ongoal": 2,
                        "blocked": 1,
                        "offgoal": 4,
                        "insidebox": 4,
                        "outsidebox": 3
                    },
                    "passes": {
                        "total": 157,
                        "accurate": 85,
                        "percentage": 54.14
                    },
                    "attacks": {
                        "attacks": 70,
                        "dangerous_attacks": 41
                    },
                    "fouls": 9,
                    "corners": 8,
                    "offsides": 2,
                    "possessiontime": 20,
                    "yellowcards": 3,
                    "redcards": 0,
                    "yellowredcards": 0,
                    "saves": 9,
                    "substitutions": 3,
                    "goal_kick": null,
                    "goal_attempts": 7,
                    "free_kick": null,
                    "throw_in": null,
                    "ball_safe": 67,
                    "goals": 1,
                    "penalties": 0,
                    "injuries": 1
                }
"events": {
            "data": [
                {
                    "id": 16475287001,
                    "team_id": "338",
                    "type": "yellowcard",
                    "var_result": null,
                    "fixture_id": 16475287,
                    "player_id": 174161,
                    "player_name": "S. Martin",
                    "related_player_id": null,
                    "related_player_name": null,
                    "minute": 17,
                    "extra_minute": null,
                    "reason": null,
                    "injuried": null,
                    "result": null
                },
                {
                    "id": 16475287002,
                    "team_id": "53",
                    "type": "goal",
                    "var_result": null,
                    "fixture_id": 16475287,
                    "player_id": 96792,
                    "player_name": "O. Édouard",
                    "related_player_id": 173080,
                    "related_player_name": "G. Taylor",
                    "minute": 20,
                    "extra_minute": null,
                    "reason": null,
                    "injuried": null,
                    "result": "1-0"
                },
                {
                    "id": 16475287003,
                    "team_id": "53",
                    "type": "goal",
                    "var_result": null,
                    "fixture_id": 16475287,
                    "player_id": 8403182,
                    "player_name": "J. Frimpong",
                    "related_player_id": 173080,
                    "related_player_name": "G. Taylor",
                    "minute": 31,
                    "extra_minute": null,
                    "reason": null,
                    "injuried": null,
                    "result": "2-0"
                },
                {
                    "id": 16475287004,
                    "team_id": "338",
                    "type": "own-goal",
                    "var_result": null,
                    "fixture_id": 16475287,
                    "player_id": 32761,
                    "player_name": "C. Jullien",
                    "related_player_id": null,
                    "related_player_name": null,
                    "minute": 34,
                    "extra_minute": null,
                    "reason": null,
                    "injuried": null,
                    "result": "2-1"
                },
                {
                    "id": 16475287005,
                    "team_id": "338",
                    "type": "yellowcard",
                    "var_result": null,
                    "fixture_id": 16475287,
                    "player_id": 173774,
                    "player_name": "R. Callachan",
                    "related_player_id": null,
                    "related_player_name": null,
                    "minute": 36,
                    "extra_minute": null,
                    "reason": null,
                    "injuried": null,
                    "result": null
                },
                {
                    "id": 16475287006,
                    "team_id": "338",
                    "type": "substitution",
                    "var_result": null,
                    "fixture_id": 16475287,
                    "player_id": 111635,
                    "player_name": "M. Ogkmpoe",
                    "related_player_id": 173093,
                    "related_player_name": "R. Hughes",
                    "minute": 42,
                    "extra_minute": null,
                    "reason": null,
                    "injuried": null,
                    "result": null
 "data": [
        {
            "id": 16475287,
            "league_id": 501,
            "season_id": 17141,
            "stage_id": 77447501,
            "round_id": 194968,
            "group_id": null,
            "aggregate_id": null,
            "venue_id": 8909,
            "referee_id": 14859,
            "localteam_id": 53,
            "visitorteam_id": 338,
            "winner_team_id": 53,
            "weather_report": {
                "code": "clouds",
                "type": "few clouds",
                "icon": "https://cdn.sportmonks.com/images/weather/02d.png",
                "temperature": {
                    "temp": 59.94,
                    "unit": "fahrenheit"
                },
                "temperature_celcius": {
                    "temp": 15.5,
                    "unit": "celcius"
                },
                "clouds": "20%",
                "humidity": "67%",
                "pressure": 1014,
                "wind": {
                    "speed": "10.29 m/s",
                    "degree": 300
                },
                "coordinates": {
                    "lat": 55.87,
                    "lon": -4.26
                },
                "updated_at": "2020-08-02T17:15:04.814798Z"
            },
            "commentaries": false,
            "attendance": null,
            "pitch": null,
            "details": null,
            "neutral_venue": false,
            "winning_odds_calculated": true,
            "formations": {
                "localteam_formation": "4-2-3-1",
                "visitorteam_formation": "4-4-2"
            },
            "scores": {
                "localteam_score": 5,
                "visitorteam_score": 1,
                "localteam_pen_score": null,
                "visitorteam_pen_score": null,
                "ht_score": "2-1",
                "ft_score": "5-1",
                "et_score": null,
                "ps_score": null
            },
            "time": {
                "status": "FT",
                "starting_at": {
                    "date_time": "2020-08-02 15:30:00",
                    "date": "2020-08-02",
                    "time": "15:30:00",
                    "timestamp": 1596382200,
                    "timezone": "UTC"
                },
                "minute": 90,
                "second": null,
                "added_time": null,
                "extra_minute": null,
                "injury_time": null
            },
            "coaches": {
                "localteam_coach_id": 1467946,
                "visitorteam_coach_id": 30082158
            },
            "standings": {
                "localteam_position": 1,
                "visitorteam_position": 12
            },
            "assistants": {
                "first_assistant_id": 12118,
                "second_assistant_id": 17249,
                "fourth_official_id": 15815
            },
            "leg": "1/1",
            "colors": {
                "localteam": {
                    "color": "#007848",
                    "kit_colors": "#F0F0F0,#139343,#5B0623,#0A0A0A,#5C8FAE,#FFDF1B,#F0F0F0"
                },
                "visitorteam": {
                    "color": "#0046A8",
                    "kit_colors": "#0046A8,#0046A8,#0046A8,#0046A8,#C40010,#0046A8,#0046A8"
                }
            },
            "deleted": false
        },
        {
            "id": 11879682,
            "league_id": 501,
            "season_id": 16222,
            "stage_id": 77444704,
            "round_id": 173664,
            "group_id": null,
            "aggregate_id": null,
            "venue_id": 288196,
            "referee_id": 14468,
            "localteam_id": 338,
            "visitorteam_id": 53,
            "winner_team_id": 53,
            "weather_report": {
                "code": "clear",
                "type": "clear sky",
                "icon": "https://cdn.sportmonks.com/images/weather/01d.png",
                "temperature": {
                    "temp": 38.34,
                    "unit": "fahrenheit"
                },
                "temperature_celcius": {
                    "temp": 3.5,
                    "unit": "celcius"
                },
                "clouds": "1%",
                "humidity": "80%",
                "pressure": 1005,
                "wind": {
                    "speed": "8.05 m/s",
                    "degree": 200
                },
                "coordinates": {
                    "lat": 39.18,
                    "lon": -84.53
                },
                "updated_at": "2020-02-02T14:15:03.048051Z"
            },
            "commentaries": true,
            "attendance": 4708,
            "pitch": null,
            "details": null,
            "neutral_venue": false,
            "winning_odds_calculated": true,
            "formations": {
                "localteam_formation": "4-1-4-1",
                "visitorteam_formation": "3-5-2"
            },
            "scores": {
                "localteam_score": 1,
                "visitorteam_score": 4,
                "localteam_pen_score": null,
                "visitorteam_pen_score": null,
                "ht_score": "1-1",
                "ft_score": "1-4",
                "et_score": null,
                "ps_score": null
            },
            "time": {
                "status": "FT",
                "starting_at": {
                    "date_time": "2020-02-02 12:30:00",
                    "date": "2020-02-02",
                    "time": "12:30:00",
                    "timestamp": 1580646600,
                    "timezone": "UTC"
                },
                "minute": 90,
                "second": null,
                "added_time": null,
                "extra_minute": null,
                "injury_time": null
            },
            "coaches": {
                "localteam_coach_id": 30082158,
                "visitorteam_coach_id": 1467946
            },
            "standings": {
                "localteam_position": 12,
                "visitorteam_position": 1
            },
            "assistants": {
                "first_assistant_id": 12122,
                "second_assistant_id": 21451,
                "fourth_official_id": 17250
            },
            "leg": "1/1",
            "colors": {
                "localteam": {
                    "color": "#D6003D",
                    "kit_colors": "#F0F0F0,#D6003D,#5B0623,#0A0A0A,#5C8FAE,#FFDF1B,#F0F0F0"
                },
                "visitorteam": {
                    "color": "#007848",
                    "kit_colors": "#F0F0F0,#139343,#5B0623,#0A0A0A,#5C8FAE,#FFDF1B,#F0F0F0"
                }
            },
            "deleted": false
        },

Player statistics

Here, we can see the detailed player statistics of the player named S. Bain. Apart from standard player information such as which team he belongs to, what his player id or position is. We can see the total number of shots, goals, fouls, cards, passing, dribbles and duels. There’s also an ‘other’ tab with even more information, but we won’t go into detail for that one.

Team statistics

As its name suggests, we can see the team statistics of the home team. We can see the number of shots, passes, attacks, and a plethora of other data of the entire team.

Events

Events show goals, cards, and substitutions and at which exact minute this happened. So, we can see that in the 14th-minute player S. Rosted scored the 0-1 and got an assist from J. Lindstrom.

Player J. Lauridsen got substituted for M. Kallesoe in the 25th minute. And finally, player M. Schwabe got a yellow card in the 91st minute.

Head2head

Now for the head2head, you’ll probably get a huge response because head2head is every single encounter the two teams have had. The most recent ones will be on top of the list. General information about each match will be given, such as its fixture id, season id, winner of the match, the final score, date of when the game was played, how many minutes the match was, and much more.

In case, you want to see the lineups of players who played at the time, you can simply add the include lineup,bench.

You can find a link to another article where we discuss the tools in-depth on our

The standard events include consists of goals, substitutions, and cards. There is also the include called corners and many more. For a full list of the possible includes see our

Since this is about a single match page with various events and stats, we will need the specific fixture ID. Henceforth, we’ll work with the

You can compare two teams' past results against each other. This is often used to see how one team performs against another. This endpoint is simply called

For an overview of field descriptions, you can refer to our .

Developer Tools Guide.
API reference guide.
fixtures by id endpoint.
head2head.
statuses and definitions
how-to build your livescore website
livescores
includes
nested includes