Top goalscorers
In the following paragraphs, we show you how you can get the top goalscorers of competitions using our football API.
No football API product will be complete without the possibility to get the top goalscorers of the competitions. That is why we are more than happy to announce the release of this API endpoint which allows you to do just that.
Endpoint
In order, to obtain the top goalscorers of competitions through our football API all you need to do is to know the id of the competition in which you are interested and then call the URL below. There are many endpoints in our product that contain competition_id
-s, but if you want to obtain the complete list with competitions so you have all the id
-s at your disposal you can go through our competitions listing API endpoint documentation page.
Parameters
The competition top goalscorers football API endpoint takes only one parameter called competition_id
. This parameter is required and you will receive an error if it is missing in the URL that you use to access our data.
Name | Type | Required | Example | Description |
---|---|---|---|---|
competition_id | number | 1 | 1 | The id of the competition which top goalscorers we are getting. |
Response
In the response from this football API endpoint you will receive from 15 to 20 of the top goalscorers for the chosen competition_id
(In the example below we have listed only 3 players for brevity). These goalscorers will be for the current season of the competition. This will be if the season is running right now or has finished recently. If the new season is about to start soon, the list might be empty since the season has not started yet. In addition, there is general information about the competition, as well as about the players' goalscoring performance and the teams that represent in the competition.
The list with the top goalscorers is ordered with the best performing player on the top of the list and the player with least scored goals in the bottom.
{
"success": true,
"data": {
"competition": {
"id": "1",
"name": "Bundesliga"
},
"goalscorers": [
{
"player_id": "2365",
"name": "Robert Lewandowski",
"team_id": "46",
"goals": "34",
"assists": "4",
"played": "31",
"competition_id": "1",
"season_id": "4",
"edition_id": "426",
"team": {
"id": "46",
"name": "Bayern Munich",
"stadium": "Allianz Arena",
"location": "Allianz Arena"
}
},
{
"player_id": "14828",
"name": "Timo Werner",
"team_id": "17",
"goals": "28",
"assists": "8",
"played": "34",
"competition_id": "1",
"season_id": "4",
"edition_id": "426",
"team": {
"id": "17",
"name": "Chelsea",
"stadium": "Stamford Bridge",
"location": "Stamford Bridge"
}
},
{
"player_id": "2916",
"name": "Jadon Sancho",
"team_id": "41",
"goals": "17",
"assists": "16",
"played": "32",
"competition_id": "1",
"season_id": "4",
"edition_id": "426",
"team": {
"id": "41",
"name": "Borussia Dortmund",
"stadium": "Signal-Iduna-Park",
"location": "Signal-Iduna-Park"
}
}
]
}
}
Name | Type | Example | Description |
---|---|---|---|
competition | object | Contains the general competition data | |
competition.id | number | 1 | Contains the id of the competition |
competition.name | string | Contains the name of the competition | |
goalscorers | list | The list with the competitions top goalsscorers | |
goalscorers.assists | number | 4 | The number of assists that the player has in this competition |
goalscorers.competition_id | number | 1 | The id of the competition |
goalscorers.goals | number | 34 | The number of goals scored by the player in the competition |
goalscorers.name | string | Timo Werner | The name of the player |
goalscorers.player | number | 31 | The number of matches in which the player participated in both as a starting eleven player or as a substitute |
goalscorers.player_id | number | 2365 | The id of the player |
goalscorers.season_id | number | 4 | The id of the season which is considered the currently running for this competition |
goalscorers.team | object | Contains the general team data where the player played in the competition | |
goalscorers.team.id | number | 46 | The id of the team where the player played in the competition |
goalscorers.team.name | string | Bayern Munich | The name of the team |
goalscorers.team.stadium | string | Allianz Arena | The name of the stadium where the team plays their home games if such exists. |
goalscorers.team_id | number | 17 | The id of the team that the player is playing for in the competition |