Top goal scorers

  1. Endpoint
  2. Parameters
  3. Response
  4. Getting Top Scorers In Various Languages

On this football API documentation page, we go though the competition top goal scorers API endpoint.

No football API product will be complete without the possibility to get the list of the top goal scorers 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.


This football API endpoint supports data in various languages. To find out more about this, check out our documentation on language support.

Endpoint


In order, to obtain the top goa lscorers 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, you can go through our competitions listing API endpoint documentation page or do a competition search on our competitions coverage page.


GET:

Parameters


The competition top goal scorers football API endpoint takes two parameters called competition_id and lang. The parameter competition_id is required and you will receive an error if it is missing in the URL that you use to access our data. Using the lang parameter allows you to get translations of the teams, competitions, and players names in the provided language, if your subscription package supports this feature.


NameTypeRequiredExampleDescription
competition_idnumber11The id of the competition which top goal scorers we are getting.
langstringar2 letter ISO 639-1 language code. Find out more on our data in various languages.

Response


In the response from this football API endpoint you will receive up to 20 of the top goal scorers for the chosen competition_id (In the example below we have listed only 3 players for brevity). These scorers 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 the players' performance and the teams that they represent in the competition. The list with the top goal scorers is ordered with the best performing player on the top of the list and the player with least scored goals at the bottom.


{
    "success": true,
    "data": {
        "competition": {
            "id": 1,
            "name": "Bundesliga",
            "is_league": true,
            "is_cup": false,
            "tier": 1,
            "has_groups": true,
            "active": true,
            "national_teams_only": false
        },
        "edition": {
            "id": 1640,
            "season_id": 26,
            "is_current": true
        },
        "season": {
            "id": 26,
            "name": "2023\/2024",
            "start": "2023-07-01",
            "end": "2024-06-30"
        },
        "topscorers": [
            {
                "goals": 20,
                "assists": 5,
                "played": 14,
                "team": {
                    "id": 46,
                    "name": "Bayern Munich",
                    "stadium": "Allianz Arena",
                    "country_id": 1
                },
                "player": {
                    "id": 18431,
                    "name": "Harry Kane"
                }
            },
            {
                "goals": 16,
                "assists": 1,
                "played": 13,
                "team": {
                    "id": 54,
                    "name": "VfB Stuttgart",
                    "stadium": "Mercedes-Benz-Arena",
                    "country_id": 1
                },
                "player": {
                    "id": 966,
                    "name": "Sehrou Guirassy"
                }
            },
            {
                "goals": 10,
                "assists": 4,
                "played": 15,
                "team": {
                    "id": 44,
                    "name": "RasenBallsport Leipzig",
                    "stadium": "Red Bull Arena",
                    "country_id": 1
                },
                "player": {
                    "id": 4486,
                    "name": "Lois Openda"
                }
            }
        ]
    }
}


NameTypeExampleDescription
competitionobjectAn object holding the information about the competition. It has the structure of our standard competition object.
editionobjectAn object holding the information about the edition of the competition. It has the structure of our standard edition object.
seasonobjectAn object holding the information about the season of the competition for which we are getting the top scorers. It has the structure of our standard season object.
topscorerslistThe list with the competitions top goal scorers.
topscorers.assistsnumber4The number of assists that the player has provided for other players goals.
topscorers.goalsnumber20The number of goals scored by the player.
topscorers.playednumber15The number of matches that player has taken part in the current edition of the competition.
topscorers.playerobjectAn object holding the information about the player. It has the structure of our standard player object.
topscorers.teamobjectAn object holding the information about the team for which the player is competing. It has the structure of our standard team object.

Getting top scorers in various languages


If your subscription package supports translations of data in various languages, you can use the lang parameter to get get the names of the competition, teams, and players in the chosen language. cUrl:

curl -XGET "https://livescore-api.com/api-client/competitions/topscorers.json?key=demo_key&secret=demo_secret&competition_id=362&lang=ar"
PHP:
file_get_contents('https://livescore-api.com/api-client/competitions/topscorers.json?key=demo_key\&secret=demo_secret\&competition_id=362&lang=ar');
Python:
import urllib2
req = urllib2.Request('https://livescore-api.com/api-client/competitions/topscorers.json?key=demo_key\&secret=demo_secret\&competition_id=362&lang=ar')
response = urllib2.urlopen(req)
print response.read()


Didn't find what you need?

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