In this tutorial, we will teach you how to request the top scorers per stage and the entire season.
Let’s start right away.
You can use the top scorers by season id endpoint if you want to request all the top scorers per stage* of a season. The endpoint returns the top 25 players per type: goals, cards and assists. *Please check our stages tutorial for more information
Let's say you want to request the topscorers of the English Premier League season 20/21 (season id: 17420):
Season Field Description
Topscorers Field Description
In the response example, we only included the goalscorers type. If you look at the complete response you will also see the assists and card scorers.
Naturally, you can also enrich the response by using includes. However, you need to prefix the include.
Please read the responses carefully. Sometimes the standings for cards are based on points instead of the total amount of cards. A red card is worth 2 points and a yellow card 1.
What is prefixing exactly? With nested includes, you add the additional information at the end of the include, i.e., lineup.player
With prefixing, it’s just the other way around. You will need to prefix every available include with the actual include you’re looking for.
So, for example, if you want to have additional information about the goalscorers and team, you will need to include goalscorers.player
and goalscorers.team.
A list of available includes are:
goalscorers.player
goalscorers.team
assistscorers.player
assistscorers.team
cardscorer.player
cardscorers.team
We're going to only show you additional information about the goalscorers for this tutorial:
As you can see, you now have more information about both the player himself and his team.
As mentioned before, the previous request will give you all the top scorers of goals, cards and assist per stage. But what if you want the total amount of a season? We have the aggregated topscorers endpoint for this.
This endpoint is often used for cups like the UEFA Champions and Europa League. The preliminary stages for these cups are not included in the response as we follow the official UEFA guidelines.
The response is the same as the previous one. The only difference is that it will give you a list of the entire season or the cup’s top scorers. You can also enrich the data response you get by using includes.
You will need to prefix every available include with the actual include you’re looking for. For example, if you want to have additional information about the goalscorers and team, you will need to include aggregatedGoalscorers.player
and aggregatedGoalscorers.team
.
A list of available includes are:
aggregatedGoalscorers.player
aggregatedGoalscorers.team
aggregatedAssistscorers.player
aggregatedAssistscorers.team
aggregatedCardscorers.player
aggregatedCardscorers.team
Field
Description
id
The unique id of the current stage
name
The name of the stage
league_id
The unique league id the stage belongs to
season_id
The unique id of the current season
round_id
The unique id of the current round
round_name
The name of the round
type
Indicates what kind of type this stage is
stage_id
The unique id of the current stage
stage_name
The name of the stage
Field
Description
position
The actual position in the rankings in the stage
player_id
The unique player id of the player in that position in the stage
team_id
The unique id of the the player plays for
stage_id
The unique id of the current stage
goals
The total number of goals the player has scored in the stage
penalty_goals
The total number of penalty goals the player has scored in the stage
type
The type of the standings. Possible values are: goals, cards or assists