Live now!

Progress of current post

How-to build a team page

Welcome to our guide about building a team page that shows the squad of a team for a specific season, as well as the seasonal statistics of the team. A squad is the entire group of players related to a team in a particular Season.

Published 18 March 2024
Last updated 10 December 2024
Jordy Post
How-to build a team page
Contents

We’ll show you three different endpoints that you can work with to get the seasonal statistics and squad data. Afterwards, we’ll show you a basic implementation process to build the team page. Example requests of the English Premier League team Liverpool of the 23/24 season will be shown.

Step 1: Gather the tools

You are going to need the following tools:

  • Football image
    Sportmonks API token
  • Football image
    Code editor (Visual studio used in examples)
  • Football image
    Postman (optional)

Squad statistics

To get all players of a squad and squad stats, you can opt to only show the current season, but if you value historical data, then you might as well show past iterations of the squad. It’s common to show all the members of the squad on one page for a nice overview of all their statistics, such as:

Football image

Player names

Football image

Playtime

Football image

Number of appearances in matches

Football image

Number of times substituted in or out

Football image

Number of goals scored, assists given

Football image

Number of cards received

And there are many more options available in the Football API.

Team seasonal statistics

You can have statistics about almost anything in Football. So, it’s up to you to decide what statistics you want to show to your users. At Sportmonks we offer you highly detailed season statistics per team such as:

Football image

Win-loss record

Football image

Number of attacks, fouls, cards, saves

Football image

Clean sheets

Football image

Number of goals scored between periods

Football image

Ranking and how many points they have

Football image

Average time for first goal scored/conceded

Football image

Average number of goals per match/win

And much more!

Step 2: The request

The squad by team and season id endpoint requires you to simply fill in the ids of the season and team you want. While the team by id endpoint has you fill in the team id and filter on season id.

Team by ID:

https://api.sportmonks.com/v3/football/teams/8?api_token=YOUR_TOKEN&&include=statistics.details&filters=teamStatisticSeasons:21646 
toevoegen

Team Squad by Team ID and Season ID

https://api.sportmonks.com/v3/football/squads/seasons/21646/teams/8?api_token=YOUR_TOKEN&include=player;details.type

*Keep in mind that the Squad endpoint provides player statistics, while the Team endpoint provides team statistics.

{
       {
      "id": 483841183,
      "player_id": 4125,
      "team_id": 8,
      "season_id": 21646,
      "has_values": true,
      "position_id": 27,
      "jersey_number": 11,
      "player": {
        "id": 4125,
        "sport_id": 1,
        "country_id": 886,
        "nationality_id": 886,
        "city_id": null,
        "position_id": 27,
        "detailed_position_id": 156,
        "type_id": 27,
        "common_name": "M. Salah Ghaly",
        "firstname": "Mohamed",
        "lastname": "Salah Ghaly",
        "name": "Mohamed Salah Ghaly",
        "display_name": "Mohamed Salah",
        "image_path": "https://cdn.sportmonks.com/images/soccer/players/29/4125.png",
        "height": 175,
        "weight": 71,
        "date_of_birth": "1992-06-15",
        "gender": "male"
      },
      "details": [
        {
          "id": 34125724,
          "player_statistic_id": 483841183,
          "type_id": 41,
          "value": {
            "total": 22
          },
          "type": {
            "id": 41,
            "name": "Shots Off Target",
            "code": "shots-off-target",
            "developer_name": "SHOTS_OFF_TARGET",
            "model_type": "statistic",
            "stat_group": "offensive"
          }
        },
        {
          "id": 31622847,
          "player_statistic_id": 483841183,
          "type_id": 42,
          "value": {
            "total": 70
          },
          "type": {
            "id": 42,
            "name": "Shots Total",
            "code": "shots-total",
            "developer_name": "SHOTS_TOTAL",
            "model_type": "statistic",
            "stat_group": "offensive"
          }
        },
        {
          "id": 33880432,
          "player_statistic_id": 483841183,
          "type_id": 47,
          "value": {
            "total": 6,
            "won": 1,
            "scored": 4,
            "committed": 0,
            "saved": 0,
            "missed": 2
          },
          "type": {
            "id": 47,
            "name": "Penalties",
            "code": "penalties",
            "developer_name": "PENALTIES",
            "model_type": "statistic",
            "stat_group": "offensive"
          }
        },
        {
          "id": 31622771,
          "player_statistic_id": 483841183,
          "type_id": 51,
          "value": {
            "total": 10
          },
          "type": {
            "id": 51,
            "name": "Offsides",
            "code": "offsides",
            "developer_name": "OFFSIDES",
            "model_type": "statistic",
            "stat_group": "offensive"
          }
        },
        {
          "id": 31695365,
          "player_statistic_id": 483841183,
          "type_id": 52,
          "value": {
            "total": 15,
            "goals": 11,
            "penalties": 4
          },
          "type": {
            "id": 52,
            "name": "Goals",
            "code": "goals",
            "developer_name": "GOALS",
            "model_type": "statistic",
            "stat_group": "offensive"
          }
        },
        {
          "id": 31807863,
          "player_statistic_id": 483841183,
          "type_id": 56,
          "value": {
            "total": 7
          },
          "type": {
            "id": 56,
            "name": "Fouls",
            "code": "fouls",
            "developer_name": "FOULS",
            "model_type": "statistic",
            "stat_group": "defensive"
          }
        },
        {
          "id": 31622853,
          "player_statistic_id": 483841183,
          "type_id": 58,
          "value": {
            "total": 13
          },
          "type": {
            "id": 58,
            "name": "Shots Blocked",
            "code": "shots-blocked",
            "developer_name": "SHOTS_BLOCKED",
            "model_type": "statistic",
            "stat_group": "offensive"
          }
        },
        {
          "id": 31622874,
          "player_statistic_id": 483841183,
          "type_id": 59,
          "value": {
            "in": 2,
            "out": 5
          },
          "type": {
            "id": 59,
            "name": "Substitutions",
            "code": "substitutions",
            "developer_name": "SUBSTITUTIONS",
            "model_type": "statistic",
            "stat_group": "overall"
          }
        },
        {
          "id": 31622712,
          "player_statistic_id": 483841183,
          "type_id": 64,
          "value": {
            "total": 2
          },
          "type": {
            "id": 64,
            "name": "Hit Woodwork",
            "code": "hit-woodwork",
            "developer_name": "HIT_WOODWORK",
            "model_type": "statistic",
            "stat_group": "offensive"
          }
        },
        {
          "id": 31622889,
          "player_statistic_id": 483841183,
          "type_id": 78,
          "value": {
            "total": 13
          },
          "type": {
            "id": 78,
            "name": "Tackles",
            "code": "tackles",
            "developer_name": "TACKLES",
            "model_type": "statistic",
            "stat_group": "defensive"
          }
        },
        {
          "id": 31622602,
          "player_statistic_id": 483841183,
          "type_id": 79,
          "value": {
            "total": 9
          },
          "type": {
            "id": 79,
            "name": "Assists",
            "code": "assists",
            "developer_name": "ASSISTS",
            "model_type": "statistic",
            "stat_group": "offensive"
          }
        },
        {
          "id": 31622787,
          "player_statistic_id": 483841183,
          "type_id": 80,
          "value": {
            "total": 683
          },
          "type": {
            "id": 80,
            "name": "Passes",
            "code": "passes",
            "developer_name": "PASSES",
            "model_type": "statistic",
            "stat_group": "overall"
          }
        },
        {
          "id": 33302229,
          "player_statistic_id": 483841183,
          "type_id": 84,
          "value": {
            "total": 2,
            "home": 1,
            "away": 1
          },
          "type": {
            "id": 84,
            "name": "Yellowcards",
            "code": "yellowcards",
            "developer_name": "YELLOWCARDS",
            "model_type": "statistic",
            "stat_group": "overall"
          }
        },
        {
          "id": 31695445,
          "player_statistic_id": 483841183,
          "type_id": 86,
          "value": {
            "total": 35
          },
          "type": {
            "id": 86,
            "name": "Shots On Target",
            "code": "shots-on-target",
            "developer_name": "SHOTS_ON_TARGET",
            "model_type": "statistic",
            "stat_group": "offensive"
          }
        },
        {
          "id": 31622705,
          "player_statistic_id": 483841183,
          "type_id": 88,
          "value": {
            "total": 18
          },
          "type": {
            "id": 88,
            "name": "Goals Conceded",
            "code": "goals-conceded",
            "developer_name": "GOALS_CONCEDED",
            "model_type": "statistic",
            "stat_group": "defensive"
          }
        },
        {
          "id": 31622636,
          "player_statistic_id": 483841183,
          "type_id": 94,
          "value": {
            "total": 40
          },
          "type": {
            "id": 94,
            "name": "Dispossessed",
            "code": "dispossessed",
            "developer_name": "DISPOSSESSED",
            "model_type": "statistic",
            "stat_group": "offensive"
          }
        },
        {
          "id": 31695359,
          "player_statistic_id": 483841183,
          "type_id": 96,
          "value": {
            "total": 19
          },
          "type": {
            "id": 96,
            "name": "Fouls Drawn",
            "code": "fouls-drawn",
            "developer_name": "FOULS_DRAWN",
            "model_type": "statistic",
            "stat_group": "overall"
          }
        },
        {
          "id": 33374732,
          "player_statistic_id": 483841183,
          "type_id": 97,
          "value": {
            "total": 1
          },
          "type": {
            "id": 97,
            "name": "Blocked Shots",
            "code": "blocked-shots",
            "developer_name": "BLOCKED_SHOTS",
            "model_type": "statistic",
            "stat_group": "defensive"
          }
        },
        {
          "id": 31622911,
          "player_statistic_id": 483841183,
          "type_id": 98,
          "value": {
            "total": 28
          },
          "type": {
            "id": 98,
            "name": "Total Crosses",
            "code": "total-crosses",
            "developer_name": "TOTAL_CROSSES",
            "model_type": "statistic",
            "stat_group": "offensive"
          }
        },
        {
          "id": 31622557,
          "player_statistic_id": 483841183,
          "type_id": 99,
          "value": {
            "total": 5
          },
          "type": {
            "id": 99,
            "name": "Accurate Crosses",
            "code": "accurate-crosses",
            "developer_name": "ACCURATE_CROSSES",
            "model_type": "statistic",
            "stat_group": "offensive"
          }
        },
        {
          "id": 31807875,
          "player_statistic_id": 483841183,
          "type_id": 100,
          "value": {
            "total": 2
          },
          "type": {
            "id": 100,
            "name": "Interceptions",
            "code": "interceptions",
            "developer_name": "INTERCEPTIONS",
            "model_type": "statistic",
            "stat_group": "defensive"
          }
        },
        {
          "id": 31622658,
          "player_statistic_id": 483841183,
          "type_id": 105,
          "value": {
            "total": 160
          },
          "type": {
            "id": 105,
            "name": "Total Duels",
            "code": "total-duels",
            "developer_name": "TOTAL_DUELS",
            "model_type": "statistic",
            "stat_group": "offensive"
          }
        },
        {
          "id": 31622670,
          "player_statistic_id": 483841183,
          "type_id": 106,
          "value": {
            "total": 55
          },
          "type": {
            "id": 106,
            "name": "Duels Won",
            "code": "duels-won",
            "developer_name": "DUELS_WON",
            "model_type": "statistic",
            "stat_group": "offensive"
          }
        },
        {
          "id": 31879015,
          "player_statistic_id": 483841183,
          "type_id": 107,
          "value": {
            "total": 4
          },
          "type": {
            "id": 107,
            "name": "Aerials Won",
            "code": "aeriels-won",
            "developer_name": "AERIALS_WON",
            "model_type": "statistic",
            "stat_group": "overall"
          }
        },
        {
          "id": 31695350,
          "player_statistic_id": 483841183,
          "type_id": 108,
          "value": {
            "total": 54
          },
          "type": {
            "id": 108,
            "name": "Dribble Attempts",
            "code": "dribble-attempts",
            "developer_name": "DRIBBLED_ATTEMPTS",
            "model_type": "statistic",
            "stat_group": "offensive"
          }
        },
        {
          "id": 33032141,
          "player_statistic_id": 483841183,
          "type_id": 109,
          "value": {
            "total": 16
          },
          "type": {
            "id": 109,
            "name": "Successful Dribbles",
            "code": "successful-dribbles",
            "developer_name": "SUCCESSFUL_DRIBBLES",
            "model_type": "statistic",
            "stat_group": "offensive"
          }
        },
        {
          "id": 31879021,
          "player_statistic_id": 483841183,
          "type_id": 110,
          "value": {
            "total": 11
          },
          "type": {
            "id": 110,
            "name": "Dribbled Past",
            "code": "dribbled-past",
            "developer_name": "DRIBBLED_PAST",
            "model_type": "statistic",
            "stat_group": "offensive"
          }
        },
        {
          "id": 31622582,
          "player_statistic_id": 483841183,
          "type_id": 116,
          "value": {
            "total": 519
          },
          "type": {
            "id": 116,
            "name": "Accurate Passes",
            "code": "accurate-passes",
            "developer_name": "ACCURATE_PASSES",
            "model_type": "statistic",
            "stat_group": "overall"
          }
        },
        {
          "id": 31622736,
          "player_statistic_id": 483841183,
          "type_id": 117,
          "value": {
            "total": 52
          },
          "type": {
            "id": 117,
            "name": "Key Passes",
            "code": "key-passes",
            "developer_name": "KEY_PASSES",
            "model_type": "statistic",
            "stat_group": "overall"
          }
        },
        {
          "id": 31622818,
          "player_statistic_id": 483841183,
          "type_id": 118,
          "value": {
            "average": 7.88,
            "highest": 9.49,
            "lowest": 6.73
          },
          "type": {
            "id": 118,
            "name": "Rating",
            "code": "rating",
            "developer_name": "RATING",
            "model_type": "statistic",
            "stat_group": "overall"
          }
        },
        {
          "id": 31622763,
          "player_statistic_id": 483841183,
          "type_id": 119,
          "value": {
            "total": 1819
          },
          "type": {
            "id": 119,
            "name": "Minutes Played",
            "code": "minutes-played",
            "developer_name": "MINUTES_PLAYED",
            "model_type": "statistic",
            "stat_group": "NULL"
          }
        },
        {
          "id": 31695382,
          "player_statistic_id": 483841183,
          "type_id": 122,
          "value": {
            "total": 27
          },
          "type": {
            "id": 122,
            "name": "Long Balls",
            "code": "long-balls",
            "developer_name": "LONG_BALLS",
            "model_type": "statistic",
            "stat_group": "overall"
          }
        },
        {
          "id": 31695385,
          "player_statistic_id": 483841183,
          "type_id": 123,
          "value": {
            "total": 14
          },
          "type": {
            "id": 123,
            "name": "Long Balls Won",
            "code": "long-balls-won",
            "developer_name": "LONG_BALLS_WON",
            "model_type": "statistic",
            "stat_group": "overall"
          }
        },
        {
          "id": 31622898,
          "player_statistic_id": 483841183,
          "type_id": 124,
          "value": {
            "total": 4
          },
          "type": {
            "id": 124,
            "name": "Through Balls",
            "code": "through-balls",
            "developer_name": "THROUGH_BALLS",
            "model_type": "statistic",
            "stat_group": "overall"
          }
        },
        {
          "id": 31622906,
          "player_statistic_id": 483841183,
          "type_id": 125,
          "value": {
            "total": 2
          },
          "type": {
            "id": 125,
            "name": "Through Balls Won",
            "code": "through-balls-won",
            "developer_name": "THROUGH_BALLS_WON",
            "model_type": "statistic",
            "stat_group": "overall"
          }
        },
        {
          "id": 31622597,
          "player_statistic_id": 483841183,
          "type_id": 321,
          "value": {
            "total": 22
          },
          "type": {
            "id": 321,
            "name": "Appearances",
            "code": "appearances",
            "developer_name": "APPEARANCES",
            "model_type": "statistic",
            "stat_group": null
          }
        },
        {
          "id": 31622741,
          "player_statistic_id": 483841183,
          "type_id": 322,
          "value": {
            "total": 20
          },
          "type": {
            "id": 322,
            "name": "Lineups",
            "code": "lineups",
            "developer_name": "LINEUPS",
            "model_type": "statistic",
            "stat_group": null
          }
        },
        {
          "id": 35708057,
          "player_statistic_id": 483841183,
          "type_id": 323,
          "value": {
            "total": 2
          },
          "type": {
            "id": 323,
            "name": "Bench",
            "code": "bench",
            "developer_name": "BENCH",
            "model_type": "statistic",
            "stat_group": null
          }
        },
        {
          "id": 31622613,
          "player_statistic_id": 483841183,
          "type_id": 580,
          "value": {
            "total": 19
          },
          "type": {
            "id": 580,
            "name": "Big Chances Created",
            "code": "big-chances-created",
            "developer_name": "BIG_CHANCES_CREATED",
            "model_type": "statistic",
            "stat_group": "offensive"
          }
        },
        {
          "id": 31695336,
          "player_statistic_id": 483841183,
          "type_id": 581,
          "value": {
            "total": 9
          },
          "type": {
            "id": 581,
            "name": "Big Chances Missed",
            "code": "big-chances-missed",
            "developer_name": "BIG_CHANCES_MISSED",
            "model_type": "statistic",
            "stat_group": "offensive"
          }
        },
        {
          "id": 31622569,
          "player_statistic_id": 483841183,
          "type_id": 1584,
          "value": {
            "total": 75.99
          },
          "type": {
            "id": 1584,
            "name": "Accurate Passes Percentage",
            "code": "accurate-passes-percentage",
            "developer_name": "ACCURATE_PASSES_PERCENTAGE",
            "model_type": "statistic",
            "stat_group": "offensive"
          }
        }
      ]

Step 3: Evaluate the response

We’ll now only show you the output of the GET Team Squad by ID and Season ID endpoint including statistics.

Let’s take a look at Mohammed Salah’s stats for the Premier League. There’s a lot of information about his stats, such as minutes played, times he got substituted in or out, duels won, goals, etc.

Now for the team by id endpoint with the statistics include, this request returns all the season with statistics. Please check out team statistics tutorial to learn how to filter on specific data.

Step 4: Extra’s

To add more to your team page you could add league standings and topscorer standings for the league you prefer.

You can retrieve seasonal standings; we simply have the endpoint: “GET Standings by Season ID.”

https://api.sportmonks.com/v3/football/standings/seasons/{ID}?api_token=YOUR_TOKEN

There is a lot more information regarding their standings that you can opt to use for your application.

You can also add the top scorers’ standings to your page. For that, we have created the ‘topscorers endpoint‘.

https://api.sportmonks.com/v3/football/topscorers/seasons/{ID}?api_token=YOUR_TOKEN

By using these endpoints, you can add more depth to your team page.

Written by Jordy Post

Jordy Post is a seasoned football data and marketing expert with over 3 years of industry experience. With an in-depth understanding of Football Data, he stands out as a leading authority in delivering comprehensive insights. Jordy specializes in uncovering new stats, tracking market trends, and identifying emerging patterns, consistently providing innovative analyses that offer invaluable insights to Sports Data lovers.

Ready to create your team page?

Now you are able to get the right data for the perfect match page. Do you want to try?

Try for free