Welcome to the tutorial about statistics. At Sportmonks we have plenty of statistics to offer you, such as match, team, season, player and in-play player statistics.
In this tutorial, we will go through every option one by one.
Let’s get started.
Last but not least: we offer season statistics. We calculate a wide range of stats for you like the number of matches, matches played, goals scored, clean sheets, yellow cards, average goals per minute, etc
To request this, you can use our season by id endpoint with the include stats
. The response below will give you all the season statistics of the Bundesliga 2019/2020 ( id: 16264) season.
Season Field Description
Season Stats Field Description
And that rounds up the tutorial about statistics.
Interested in the detailed team or player level? Please note that you can use the below includes to add this information:
stats.topscorer
, stats.assisttopscorer
, stats.mostcleansheetsteam
, stats.mostcleansheetsgoalkeeper
, stats.mostgoalsteam
, stats.mostgoalspermatchteam
, stats.mostconcededgoalsteam
, stats.mostcornersteam
In our next extra tutorial, we’re going to discuss standings.
Field
Description
data
Opens an array of data you've requested
id
A unique season id
name
The name of the season
league_id
The unique league id the season belongs to
is_current_season
Indicates if the season is the current one. Possible values are "true" or "false"
current_round_id
The unique id of the current round
current_stage_id
The unique id of the current stage
Field
Description
season_id
The unique season id the stats belong to
league_id
The unique league id the stats belongs to
number_of_clubs
The number of clubs in the requested season
number_of_matches
The number of matches in the requested season
number_of_matches_played
The number of matches played in the requested season
number_of_goals
The number of goals in the requested season
matches_both_teams_scored
The number of times both teams scored in a match in the requested season
number_of_yellowcards
The number of yellow cards in the requested season
number_of_yellowredcards
The number of yellow-red cards in the requested season
number_of_redcards
The number of red cards in the requested season
avg_goals_per_match
The average goals per match in the requested season
avg_yellowcards_per_match
The average yellow cards per match in the requested season
avg_yellowredcards_per_match
The average yellow-red cards per match in the requested season
avg_redcards_per_match
The average red cards per match in the requested season
team_with_most_goals_id
The unique team id of the team that scored the most goals in the requested season
team_with_most_goals_number
The number of goals from the team that scored the most goals in the requested season
team_with_most_conceded_goals_id
The unique team id of the team that conceded the most goals in the requested season
team_with_most_conceded_goals_number
The number of conceded goals from the team that conceded the most goals in the requested season
team_with_most_goals_per_match_id
The unique team id of the team that scored the most goals per match in the requested season
team_with_most_goals_per_match_number
The number of goals from the team that scored the most goals per match in the requested season
season_topscorer_id
The unique player id of the player that scored the most goals in the requested season
season_topscorer_number
The number of goals from the player that scored the most goals in the requested season
season_assist_topscorer_id
The unique player id of the player that assisted the most goals in the requested season
season_assist_topscorer_number
The number of assists from the player that assisted the most goals in the requested season
team_most_cleansheets_id
The unique team id of the team that has the most clean sheets in the requested season
team_most_cleansheets_number
The number of clean sheets from the team that has the most clean sheets in the requested season
goals_scored_minute
The total amount of goals in the season divided in minute periods
goalkeeper_most_cleansheets_id
The unique player id of the goalkeeper that has the most clean sheets in the requested season
goalkeeper_most_cleansheets_number
The number of clean sheets from the goalkeeper that has the most clean sheets in the requested season
goal_scored_every_minutes
How many minutes per goal in the requested season
btts
The amount of times both teams scored in percentage in the requested season
goal_line
The average goal line market in the requested season
avg_corners_per_match
The average amount of corners per game in the requested season
team_most_corners_count
The number of corners from the team that has the most corners in the requested season
team_most_corners_id
The unique team id of the team that has the most corners in the requested season
goals_conceded
The average amount of goals conceded in the requested season. Divided in all, home and away
goals_scored
The average amount of goals scored in the requested season. Divided in all, home and away
win_percentage
The average win percentage in the requested season. Divided in all, home and away
defeat_percentage
The average defeat percentage in the requested season. Divided in all, home and away
draw_percentage
The average draw percentage in the requested season
avg_homegoals_per_match
The average amount of home goals per match in the requested season
avg_awaygoals_per_match
The average amount of away goals per match in the requested season
avg_player_rating
The average player rating in the requested season
One of the most frequently asked questions is: “How can I get match statistics just like below?”.
Please note that above is just a snippet of the match stats we cover.
There are many possible ways, thanks to the flexibility of our API.
As you've seen in our previous tutorials, every fixture has a unique id. Therefore, you can use one of our fixtures by id endpoints, or you can request them by date. In our fixtures tutorial, we’ve discussed all the different ways to access fixtures.
Now, as you have read in our includes tutorial, you can enrich the API response. If you want statistics, you can add the include stats
.
Stats Field Description
Nothing more, nothing less.
Let’s say you want the statistics of matches that are currently live. As you know you can use our livescores/now endpoint to request all the in-play fixtures:
The only thing you need to do is to add the stats
include:
The stats
include will enrich your response with all the match statistics of all games that are currently live.
If you only want to have stats for certain live fixtures, then you can filter. For instance, if you only want all the live matches from the English Premier League (league id: 8) with stats, you can use this request:
You've just learnt how you can request match and team statistics. Now, we’re going to request the statistics of one specific player.
For this example, we’ll go with Robert Lewandowski (player id: 31000). The endpoint you'll need to use is our player by id endpoint. Just like with the match and team stats, you'll only need to use the stats
include.
Be aware that, just like with the team statistics, this request will give you all the player statistics of the seasons the player has played or is active in. If you only want the player’s statistics of one particular season, you can filter on it.
For example, below request return the statistics of Robert Lewandowski for his German Bundesliga 2019/2020 season (season id: 16264)
Player Field Description
Player Stats Field Description
You might notice that the stats include on our fixtures/livescores endpoint will only provide you with statistics of the match. But, where are the player statistics? Great question! The player statistics are available via the lineup
include.
The lineup
include will provide you with the starting eleven of both teams. Next to that, each player will also have an array of stats.
For example, below you can view the in-play stats of Marcus Rashford in the Champions League match PSG – United.
As you can see the lineup
include will return all the statistics of the players in the match. Furthermore, we used the nested include.player
to include some basic player information. More information about nested includes can be found in our nested include tutorial.
If you also want access to stats from players who were substituted later on, you will need to use thebench
include as well.
It’s possible to request statistics per team. This could be really interesting if you want to build a football application showing all the statistics of your favorite team. Requesting team statistics is easy!
Simply, use the team by id endpoint and once again use the include stats
. For this example, we’ll request the team statistics of Real Madrid (team id: 3468):
Be aware that this request will give you all the team statistics of the seasons the team has played or is active in. Therefore, it might be useful to add a filter to only request the team statistics of the season you’re interested in.
For example, the request below will return all the team statistics of Real Madrid, but only for the Spanish La Liga 2019/2020 season (season id: 16326).
Team Field Description
Team Stats Field Description
Field
Description
team_id
The unique id of the team to which the stats belong
fixture_id
A unique fixture id
shots
Opens an array containing the shots statistics
ongoal
The number of shots on goal in a fixture of one team
blocked
The times the opponent has blocked a shot
offgoal
The number of shots off goal in a fixture of one team
insidebox
The number of shots from inside the box (16-meter area) in a fixture of one team
outsidebox
The number of shots from outside the box (16-meter area) in a fixture of one team
passes
Opens an array containing the pass statistics
total
The number of passes in a fixture of one team
accurate
The total accurate passes in a fixture of one team
percentage
The accurate passes (in percentage %) in a fixture of one team
attacks
Opens an array containing the attacks statistics
attacks
The attacks in a fixture of one team
dangerous_attacks
The dangerous attacks in a fixture of one team. A dangerous attack is calculated when the attack almost resulted in a goal.
fouls
The number of fouls committed of one team
corners
The number of corners of one team
offsides
The number of times one team was flagged offside by the (assistant) referee
possesiontime
The number of times one team has had the ball in percentage
yellowcards
The number of yellow cards for one team
yellowredcards
The total times a second yellow card has resulted in a red card for one team
redcards
The total number of red cards for one team
saves
The total number of saves the goalkeeper of one team has made
substitutions
The total number of substitutions of one team
goal_kicks
The number of goal kicks for one team
goal_attempts
The number of goal attempt of one team
free_kick
The number of free kicks for one team
throw_in
The amount of throw ins for one team
ball_safe
This is the number of times the attacking team plays the ball back to their own half.
For example:
Barcelona is on the attack and are on the half of the opposition, but decide to pass the ball back to their own half.
This is ball safe 1.
goals
The number of goals for one team
penalties
The number of penalties for one team
injuries
The number of injuries for one team
Field
Description
player_id
The unique id of the main player
team_id
The unique id of the team the player belongs to
country_id
The unique id of the country the player is from
position_id
The unique id of the position the player plays in
common_name
The common name the player is known for
display_name
The display name of the player. Often used to show in the lineup formation
fullname
The full name of the player
firstname
The first name of the player
lastname
The last name of the player
nationality
The nationality of the player
birthdate
The date of birth of the player
birthcountry
The country the player was born in
birthplace
The place the player was born in
height
The height of the player
weight
The weight of the player
image_path
The URL of the player image
Field
Description
player_id
The unique id of the player
team_id
The unique id of the team the player plays for
league_id
The unique id of the league the season belongs to
season_id
The unique id of the season you've requested the stats for
captain
The total number of times the player was captain in the requested season
minutes
The total number of minutes played in the requested season
appearences
The total number of appearences in the requested season
lineups
The total number of times the player was included in the lineup in the requested season
substitute_in
The total number of times the player was substituted into the field in the requested season
substitute_out
The total number of times the player was substituted off the field in the requested season
substitutes_on_bench
Number of times the player is in the squad, but starts a match on the bench
goals
The total number of goals the player has scored in the requested season
owngoals
The total number of own goals the player has scored in the requested season
assists
The total number of assists the player has given in the requested season
saves
The total number of saves the player has made. (only available for goalkeepers.)
inside_box_saves
The total number of inside the box (the goalkeeper area) saves the player has made. (only available for goalkeepers)
dispossesed
The total number of times the player was dispossesed in the requested season
interceptions
The total number of interceptions the player has made in the requested season
yellowcards
The total number of yellow cards the player has received in the requested season
yellowred
The total number of yellow-red cards the player has received in the requested season. In other words: if the player received a second yellow card that resulted in a red card.
redcards
The total number of red cards the player has received in the requested season
type
The season type
tackles
The total number of tackles the player has made in the requested season
blocks
The total number of blocks the player has made in the requested season
hit_post
The total number of times the player has hit the woodwork in the requested season
cleansheets
The total number of times the player has maintained a clean sheet in the requested season
rating
The average player rating in the requested season
fouls
Opens an array containing information about the fouls committed and drawn in the requested season
crosses
Opens an array containing information about the crosses the player has made in the requested season. Divided by total and accurate
dribbles
Opens an array containing information about dribbles the player was involved with in the requested season. Divided by attempts, success and the times an opponent dribbled past him
duels
Opens an array containing information about the duels the player was involved with in the requested season. Divided by total and won.
passes
Opens an array containing information about the passes the player has made in the requested season. Divided by total, accurate and key passes
penalties
Opens an array containing information about the penalties the player was involved with in the requested season. Divided by won, scored, missed, committed and saved
Field
Description
id
The unique id of the team
legacy_id
This was for our API version 1.0. It's only of use for old users of our API
name
The name of the team
short_code
The short code of the team
twitter
The official twitter page of the team
country_id
The unique country id the team is from
national_team
Indicates if the team is a national team
founded
The year when the team was founded
logo_path
The logo URL path of the team logo
venue_id
The official venue of the team
current_season_id
The unique id of the season the team is active in
is_placeholder
Added a property on both fixture and team responses called is_placeholder
. This property indicates if the resource is used to display dummy data. The false of this property will always be a boolean
value.
Field
Description
team_id
The unique id of the team
season_id
The id of the season you've requested the stats for
stage_id
The id of the stage the stats belong to
win
Opens an array containing information about the number of times the team won a match in the requested season and stage. Divided by total, home and away
draw
Opens an array containing information about the number of times the team has played a match which ended in a draw in the requested season and stage. Divided by total, home and away
lost
Opens an array containing information about the number of times the team lost a match in the requested season and stage. Divided by total, home and away
goals_for
Opens an array containing information about the number of times the team has scored a goal in the requested season and stage. Divided by total, home and away
goals_against
Opens an array containing information about the number of times the team has conceded a goal in the requested season and stage. Divided by total, home and away
clean_sheet
Opens an array containing information about the number of times the team has maintained a clean sheet in the requested season and stage. Divided by total, home and away
failed_to_score
Opens an array containing information about the number of times the team has failed to score in a match in the requested season and stage. Divided by total, home and away
scoring_minutes
The total number of times the team has scored divided in minute periods
goals_conceded_minutes
The total number of times the team has conceded a goal divided in minute periods
avg_goals_per_game_scored
Opens an array containing information about the average goals the team has scored per game. Divided by total, home and away
avg_goals_per_game_conceded
Opens an array containing information about the average goals the team has conceded per game. Divided by total, home and away
avg_first_goal_scored
Opens an array containing information about the average minute the team has scored the first goal per game. Divided by total, home and away
avg_first_goal_conceded
Opens an array containing information about the average minute the team has conceded the first goal per game. Divided by total, home and away
attacks
The total number of attacks in the requested season and stage
dangerous_attacks
The total number of dangerous attacks in the requested season and stage
avg_ball_possession_percentage
The average ball possession, in percentage % in the requested season and stage
fouls
The total number of fouls in the requested season and stage
avg_fouls_per_game
The total number of fouls per game in the requested season and stage
offsides
The total number of offsides in the requested season and stage
redcards
The total number of red cards in the requested season and stage
yellowcards
The total number of yellow cards in the requested season and stage
shots_blocked
The total number of shots blocked by the opponent in the requested season and stage
shots_off_target
The total number of shots off target in the requested season and stage
avg_shots_off_target_per_game
The average number of shots off target per game in the requested season and stage
shots_on_target
The total number of shots on target in the requested season and stage
avg_shots_on_target_per_game
The average number shots on target per game in the requested season and stage
avg_corners
The average number of corners per game in the requested season and stage
total_corners
The total number of corners in the requested season and stage
btts
The number of times both teams scored in percentage in the requested season and stage
goal_line
The average goal line market in the requested season and stage
avg_player_rating
The average player rating in the requested season and stage
avg_player_rating_per_match
The average player rating per match in the requested season and stage
tackles
The total number of tackles in the requested season and stage