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.


GET:

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.


NameTypeRequiredExampleDescription
competition_idnumber11The 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"
                }
            }
        ]
    }
}


NameTypeExampleDescription
competitionobjectContains the general competition data
competition.idnumber1Contains the id of the competition
competition.namestringContains the name of the competition
goalscorerslistThe list with the competitions top goalsscorers
goalscorers.assistsnumber4The number of assists that the player has in this competition
goalscorers.competition_idnumber1The id of the competition
goalscorers.goalsnumber34The number of goals scored by the player in the competition
goalscorers.namestringTimo WernerThe name of the player
goalscorers.playernumber31The number of matches in which the player participated in both as a starting eleven player or as a substitute
goalscorers.player_idnumber2365The id of the player
goalscorers.season_idnumber4The id of the season which is considered the currently running for this competition
goalscorers.teamobjectContains the general team data where the player played in the competition
goalscorers.team.idnumber46The id of the team where the player played in the competition
goalscorers.team.namestringBayern MunichThe name of the team
goalscorers.team.stadiumstringAllianz ArenaThe name of the stadium where the team plays their home games if such exists.
goalscorers.team_idnumber17The id of the team that the player is playing for in the competition

Didn't find what you need?

Do no hesitate to contact us. We will get back to you as soon as possible.