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 how-to build your livescore website 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 livescores, includes, and nested includes please see our tutorials.
You are going to need the following tools:
SportMonks API token
Code editor (Visual studio used in examples)
Postman (optional)
You can find a link to another article where we discuss the tools in-depth on our Developer Tools Guide.
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.
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 API reference guide.
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.
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 fixtures by id endpoint.
It’s also possible to include both stats, lineup and bench includes in the same request, but expect a lengthy response in that case.
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 head2head.
In this how-to guide, we’ll show you how to request events data, player and match statistics, and head2head data:
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.
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.
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 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.
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
.
For an overview of field descriptions, you can refer to our statuses and definitions.