Players statistics

Last but not least, you can retrieve player statistics. The fundamentals and steps are the same as for the team endpoint. First, you can use one of our players' endpoints. For example, the Player by ID endpoint:

https://api.sportmonks.com/v3/football/players/{id}?api_token=YOUR_TOKEN

Let's say you want the statistics of James Tavernier (id 758). You can use the statistics include:

https://api.sportmonks.com/v3/football/players/758?api_token=YOUR_TOKEN&include=statistics
Response
{
  "data": {
    "id": 758,
    "sport_id": 1,
    "country_id": 462,
    "nationality_id": 462,
    "city_id": null,
    "position_id": 25,
    "detailed_position_id": 154,
    "type_id": 25,
    "common_name": "J. Tavernier",
    "firstname": "James",
    "lastname": "Tavernier",
    "name": "James Tavernier",
    "display_name": "James Tavernier",
    "image_path": "https://cdn.sportmonks.com/images/soccer/players/22/758.png",
    "height": 182,
    "weight": 75,
    "date_of_birth": "1991-10-31",
    "gender": "male",
    "statistics": [
      {
        "id": 27324842,
        "player_id": 758,
        "team_id": 62,
        "season_id": 825,
        "position_id": 25,
        "jersey_number": 2
      },
      {
        "id": 216445028,
        "player_id": 758,
        "team_id": 62,
        "season_id": 1929,
        "position_id": null,
        "jersey_number": 2
      },

Now, just like in the previous section, you need to add details to retrieve the statistics values and type to retrieve the name of the statistics:

https://api.sportmonks.com/v3/football/players/758?api_token=YOUR_TOKEN&include=statistics.details.type
Response
{
  "data": {
    "id": 758,
    "sport_id": 1,
    "country_id": 462,
    "nationality_id": 462,
    "city_id": null,
    "position_id": 25,
    "detailed_position_id": 154,
    "type_id": 25,
    "common_name": "J. Tavernier",
    "firstname": "James",
    "lastname": "Tavernier",
    "name": "James Tavernier",
    "display_name": "James Tavernier",
    "image_path": "https://cdn.sportmonks.com/images/soccer/players/22/758.png",
    "height": 182,
    "weight": 75,
    "date_of_birth": "1991-10-31",
    "gender": "male",
    "statistics": [
      {
        "id": 27324842,
        "player_id": 758,
        "team_id": 62,
        "season_id": 825,
        "position_id": 25,
        "jersey_number": 2,
        "details": [
          {
            "id": 23799175,
            "player_statistic_id": 27324842,
            "type_id": 52,
            "value": {
              "total": 1,
              "goals": 1,
              "penalties": 0
            },
            "type": {
              "id": 52,
              "name": "Goals",
              "code": "goals",
              "developer_name": "GOALS",
              "model_type": "statistic",
              "stat_group": "offensive"
            }
          },
          {
            "id": 2926412,
            "player_statistic_id": 27324842,
            "type_id": 59,
            "value": {
              "in": 1,
              "out": 1
            },
            "type": {
              "id": 59,
              "name": "Substitutions",
              "code": "substitutions",
              "developer_name": "SUBSTITUTIONS",
              "model_type": "statistic",
              "stat_group": "overall"
            }
          },
          //And more

Please check the response carefully to see the correct values for the types.

Including .type is not recommended as an include on any endpoint. Types are used throughout the entire API. We recommend retrieving all types from the types endpoint and storing them in your database or other data structure. Only include the type if no other option is available or when testing the API.

Filtering player statistics

The API returns all the available season statistics for the requested player. Only interested in some of the seasons? You can use a filter to only retrieve stats for a specific season.

  1. Add the parameter &filters=

  2. Select the entity you want to filter on

  3. Select the field you want to filter on

  4. Fill in the IDs you're interested in

Let's say you're only interested in the statistics of the 2022/2023 season (id: 19735). This will result in the following steps:

  1. Add the parameter &filters=

  2. Select the entity you want to filter on: playerStatistic

  3. Select the field you want to filter on: Seasons

  4. Fill in the IDs you're interested in: 19735

https://api.sportmonks.com/v3/football/players/758?api_token=YOUR_TOKEN&include=statistics.details.type&filters=playerStatisticSeasons:19735
Response
{
  "data": {
    "id": 758,
    "sport_id": 1,
    "country_id": 462,
    "nationality_id": 462,
    "city_id": null,
    "position_id": 25,
    "detailed_position_id": 154,
    "type_id": 25,
    "common_name": "J. Tavernier",
    "firstname": "James",
    "lastname": "Tavernier",
    "name": "James Tavernier",
    "display_name": "James Tavernier",
    "image_path": "https://cdn.sportmonks.com/images/soccer/players/22/758.png",
    "height": 182,
    "weight": 75,
    "date_of_birth": "1991-10-31",
    "gender": "male",
    "statistics": [
      {
        "id": 520829,
        "player_id": 758,
        "team_id": 62,
        "season_id": 19735,
        "position_id": 25,
        "jersey_number": 2,
        "details": [
          {
            "id": 19937718,
            "player_statistic_id": 520829,
            "type_id": 40,
            "value": {
              "total": 26
            },
            "type": {
              "id": 40,
              "name": "Captain",
              "code": "captain",
              "developer_name": "CAPTAIN",
              "model_type": "statistic",
              "stat_group": "overall"
            }
          },
          {
            "id": 25931945,
            "player_statistic_id": 520829,
            "type_id": 41,
            "value": {
              "total": 2
            },
            "type": {
              "id": 41,
              "name": "Shots Off Target",
              "code": "shots-off-target",
              "developer_name": "SHOTS_OFF_TARGET",
              "model_type": "statistic",
              "stat_group": "offensive"
            }
          },
          //And more

Are you only interested in a specific statistic, like key passes? Add another filter to your request:

  1. Add the parameter &filters=

  2. Select the entity you want to filter on: playerStatisticDetail

  3. Select the field you want to filter on: Types

  4. Fill in the IDs you're interested in: 117 (You can retrieve them via the Types endpoint or by looking at the previous request)

https://api.sportmonks.com/v3/football/players/758?api_token=YOUR_TOKEN&include=statistics.details.type&filters=playerStatisticSeasons:19735;playerStatisticDetailTypes:117
Response
{
  "data": {
    "id": 758,
    "sport_id": 1,
    "country_id": 462,
    "nationality_id": 462,
    "city_id": null,
    "position_id": 25,
    "detailed_position_id": 154,
    "type_id": 25,
    "common_name": "J. Tavernier",
    "firstname": "James",
    "lastname": "Tavernier",
    "name": "James Tavernier",
    "display_name": "James Tavernier",
    "image_path": "https://cdn.sportmonks.com/images/soccer/players/22/758.png",
    "height": 182,
    "weight": 75,
    "date_of_birth": "1991-10-31",
    "gender": "male",
    "statistics": [
      {
        "id": 520829,
        "player_id": 758,
        "team_id": 62,
        "season_id": 19735,
        "position_id": 25,
        "jersey_number": 2,
        "details": [
          {
            "id": 24430323,
            "player_statistic_id": 520829,
            "type_id": 117,
            "value": {
              "total": 72
            },
            "type": {
              "id": 117,
              "name": "Key Passes",
              "code": "key-passes",
              "developer_name": "KEY_PASSES",
              "model_type": "statistic",
              "stat_group": "overall"
            }
          }
        ]
      }
    ]
  },

It's important to note that you can retrieve statistics from multiple entities. Therefore, you also need to specify for which entity you want to filter the statistics. You can do this by prefixing the filter with the entity's name. So in our case: playerStatisticDetail

Are you interested in player statistics for a specific fixture? Check our fixture statistics tutorial.

Interested in coaches and referees? You can use the same steps as for the player's statistics tutorial. Simply change the entity from players to referees or coaches and use the according endpoints.

Coach example:

https://api.sportmonks.com/v3/football/coaches/{ID}?api_token=YOUR_TOKEN&include=statistics.details.type

Referee example:

https://api.sportmonks.com/v3/football/referees/{ID}?api_token=YOUR_TOKEN&include=statistics.details.type

Last updated