LogoLogo
Quick StartFootball APIContactAPI 3.0
  • Welcome
  • Changelog
  • Getting Started
    • Get Started
    • Documentation for the documentation
  • Endpoint overview
    • Continents
      • GET All Continents
      • GET Continent by ID
    • Countries
      • GET All Countries
      • GET Country by ID
    • Leagues
      • GET All Leagues
      • GET League by ID
      • GET Leagues by Country ID
      • Search Leagues by Name
    • Seasons
      • GET All Seasons
      • GET Season by ID
    • Fixtures
      • GET Fixture by ID
      • GET Last Updated Fixtures
      • GET Fixtures by Date
      • GET Fixtures by Date Range
      • GET Fixtures by Date Range for Team
      • GET Fixtures by Multiple ID's
      • GET Deleted Fixtures
    • Statistics
    • Livescores
      • GET All Livescores
      • GET All In play Livescores
    • News API
      • GET All News
      • GET News For Upcoming Fixtures
      • GET News by Season ID
    • Commentaries
      • Commentaries by Fixture ID
    • Video Highlights
      • Get Video Highlights by Fixture ID
    • Head 2 Head
      • GET Head 2 Head by Team IDs
    • Standings
      • GET Standings by Season ID
      • GET LIVE Standings
      • GET Standings by Season ID and Round ID
      • GET Standings by Season and Date(time)
      • GET Standings Corrections by Season ID
    • Teams
      • GET Team by ID
      • GET Teams by Country ID
      • GET Teams by Season ID
      • Search Team by Name
      • GET Current Leagues by Team ID
      • Get All Leagues by Team ID
    • Players
      • GET Player by ID
      • GET Players by Country ID
      • Search Player by Name
    • Topscorers
      • GET Topscorers by Season ID
      • GET Topscorers Aggregated by Season ID
    • Rivals
      • GET Rivals by Team ID
    • Venues
      • GET Venue by ID
      • GET Venues by Season ID
    • Rounds
      • GET Rounds by Season ID
      • GET Round by ID
    • Odds
      • GET Odds by Fixture ID and Bookmaker ID
      • GET Odds by Fixture ID and Market ID
      • GET Odds by Fixture ID
      • GET Inplay Odds by Fixture ID
    • Coaches
      • GET Coach by ID
    • Stages
      • GET Stage by ID
      • GET Stages by Season ID
    • Bookmakers
      • GET All Bookmakers by Fixture ID
      • GET All Bookmakers
      • GET Bookmaker by ID
    • Markets
      • GET All Fixtures by Market ID
      • GET All Markets
      • GET Market by ID
    • Team Squads
      • GET Team Squad by Team and Season ID
    • TV Stations
      • GET TV Station by Fixture ID
    • Prediction API
      • GET Leagues and Performances
      • GET Probabilities
      • GET Probabilities by Fixture ID
      • GET Value Bets
      • GET Value Bet by Fixture ID
  • Tutorials
    • Introduction to our API
      • Make your first request
      • Set your time zone
      • Pagination
    • Enriching your response
      • Includes
      • Nested includes
    • Filtering, limiting & sorting
      • Filtering
      • Limiting
      • Sorting
    • Schedule, fixtures & livescores
      • Season schedule
      • Fixtures
      • Livescores
    • Statistics
      • Match statistics
      • Team statistics
      • Player statistics
      • Season statistics
    • League & topscorers standings
      • League standings
      • Topscorers standings
    • Odds & predictions
      • Odds
        • Odds by fixture, bookmaker and market id
        • FlatOdds
        • InplayOdds
      • Predictions
  • MySportmonks
    • How-to build a custom plan
    • ID Finder
  • How-to Guides
    • Get Started with our how-to guides
      • How-to build your API requests
    • Livescores & fixtures
      • How-to build a livescore website
      • How-to build a schedule page
    • Match & team pages
      • How-to build a match page with events and statistics
      • How-to build a match page with line-ups/formations
      • How-to build a team page with season stats and squads
    • How-to build standings and topscorer standings
      • League standings
      • Topscorer standings
    • Odds & predictions
      • How-to build a match page with odds
      • How-to build a betting odds portal
      • How-to use the predictions API
    • How-to build a fantasy game
    • Developer tools
      • How-to use Sportmonks' APIs in Postman
    • How-to keep your database in sync
    • World Cup 2022
    • EURO 2024
    • Football widgets
      • How-to set up football widgets in your web application
      • Configurations
      • Widgets overview
        • Livescore widget
        • International Cup widgets
  • API References
    • API reference guide
    • Data features
    • ID Finder
    • Code libraries
    • Demo response files
    • Statuses and definitions
    • API Rate limiting
    • Response codes
    • Meta description
  • General
  • Sportmonks
  • Plans & pricing
  • FAQ
  • Contact
Powered by GitBook
On this page
  • Step 1: Gather the tools
  • Step 2: Decide what data you want to show
  • Squad statistics
  • Team seasonal statistics
  • Step 3: Choose the correct endpoints
  • Step 4: Example requests
  • Individual player statistics of a squad
  • Team season statistics
  • Step 5: Evaluate the response
  • Individual player statistics of a squad
  • Team season statistics

Was this helpful?

Export as PDF
  1. How-to Guides
  2. Match & team pages

How-to build a team page with season stats and squads

PreviousHow-to build a match page with line-ups/formationsNextHow-to build standings and topscorer standings

Last updated 3 years ago

Was this helpful?

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.

We’ll show you three different endpoints that you can work with to get the seasonal statistics and squad data. Afterward, we’ll show you a basic implementation process in order to build the team page. We'll show you example requests of the Scottish Premiership team Celtic of the 20/21 season. This league is included in our free plan, so feel free to make the requests yourself.

Step 1: Gather the tools

You are going to need the following tools:

  • Sportmonks API token

  • Code editor (Visual studio used in examples)

  • Postman (optional)

Step 2: Decide what data you want to show

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 historic 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:

  • Player names

  • Playtime

  • Number of appearances in matches

  • Number of times substituted in or out

  • Number of goals scored, assists given

  • Number of cards received

And many more!

Team seasonal statistics

You can have statistics about almost anything in sports. 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:

  • Win-loss record

  • Number of attacks, fouls, cards, saves

  • Clean sheets

  • Number of goals scored between minute 0 and 15, or between minutes 75 and 90

  • Ranking and how many points they have

  • Average time for first goal scored/conceded

  • Average number of goals per match/win

And much more!

Step 3: Choose the correct endpoints

As mentioned before, we will discuss three different endpoints:

The first two request the individual player statistics of all the players in a squad, but in different ways, while the last one requests the statistics of the entire squad for either all the seasons for historical data or just for one specific season.

We’ll show you how to work with all three endpoints.

Step 4: Example requests

Individual player statistics of a squad

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.

https://soccer.sportmonks.com/api/v2.0/squad/season/{ID}/team/{ID}?api_token={API_TOKEN}&include=player
 https://soccer.sportmonks.com/api/v2.0/teams/{ID}/?api_token={API_TOKEN}&include=squad.player&season_id={ID}

Team season statistics

Probably the simplest of them all. This request also uses the team by id endpoint but the difference is that we use the include stats:

https://soccer.sportmonks.com/api/v2.0/teams/{ID}/?api_token={API_TOKEN}&include=stats&seasons={ID}

Step 5: Evaluate the response

Individual player statistics of a squad

Since the two requests return the same data, we’ll only show you the output of the squad by team and season id endpoint.

 https://soccer.sportmonks.com/api/v2.0/squad/season/{ID}/team/{ID}?api_token={API_TOKEN}&include=player
        {
            "player_id": 171725,
            "position_id": 3,
            "number": 8,
            "captain": 1,
            "injured": false,
            "minutes": 896,
            "appearences": 12,
            "lineups": 10,
            "substitute_in": 2,
            "substitute_out": 3,
            "substitutes_on_bench": 2,
            "goals": null,
            "owngoals": null,
            "assists": null,
            "saves": null,
            "inside_box_saves": null,
            "dispossesed": 37,
            "interceptions": 14,
            "yellowcards": 5,
            "yellowred": null,
            "redcards": null,
            "tackles": 18,
            "blocks": null,
            "hit_post": null,
            "cleansheets": 5,
            "rating": "6.93",
            "fouls": {
                "committed": 17,
                "drawn": 24
            },
            "crosses": {
                "total": 1,
                "accurate": 0
            },
            "dribbles": {
                "attempts": 7,
                "success": 5,
                "dribbled_past": 9
            },
            "duels": {
                "total": 107,
                "won": 64
            },
            "passes": {
                "total": 655,
                "accuracy": 49,
                "key_passes": 10
            },
            "penalties": {
                "won": null,
                "scores": null,
                "missed": null,
                "committed": null,
                "saves": null
            },
            "shots": {
                "shots_total": 7,
                "shots_on_target": 1,
                "shots_off_target": null
            },
            "player": {
                "data": {
                    "player_id": 171725,
                    "team_id": 53,
                    "country_id": 1161,
                    "position_id": 3,
                    "common_name": "S. Brown",
                    "display_name": "Scott Brown",
                    "fullname": "Scott Brown",
                    "firstname": "Scott",
                    "lastname": "Brown",
                    "nationality": "Scotland",
                    "birthdate": "25/06/1985",
                    "birthcountry": "Scotland",
                    "birthplace": "Dunfermline",
                    "height": "165 cm",
                    "weight": "64 kg",
                    "image_path": "https://cdn.sportmonks.com/images/soccer/players/13/171725.png"
                }
            }

Let's look at Celtic's captain Scott Brown. There’s a lot of information about his stats, such as minutes played, times he got substituted out, duels won, clean sheets, etc.

Lastly, there’s detailed information about the player, such as his name, height, weight, date of birth, etc.

Team season statistics

Now for the team by id endpoint with the stats include:

https://soccer.sportmonks.com/api/v2.0/teams/{ID}/?api_token={API_TOKEN}&include=squad.player&season_id={ID}
{
                    "team_id": 53,
                    "season_id": 17141,
                    "stage_id": 77447501,
                    "win": {
                        "total": 9,
                        "home": 4,
                        "away": 5
                    },
                    "draw": {
                        "total": 2,
                        "home": 0,
                        "away": 2
                    },
                    "lost": {
                        "total": 1,
                        "home": 1,
                        "away": 0
                    },
                    "goals_for": {
                        "total": 32,
                        "home": 14,
                        "away": 18
                    },
                    "goals_against": {
                        "total": 11,
                        "home": 5,
                        "away": 6
                    },
                    "clean_sheet": {
                        "total": 5,
                        "home": 2,
                        "away": 3
                    },
                    "failed_to_score": {
                        "total": 1,
                        "home": 1,
                        "away": 0
                    },
                    "scoring_minutes": [
                        {
                            "period": [
                                {
                                    "minute": "0-15",
                                    "count": 4,
                                    "percentage": 12.5
                                },
                                {
                                    "minute": "15-30",
                                    "count": 6,
                                    "percentage": 18.8
                                },
                                {
                                    "minute": "30-45",
                                    "count": 4,
                                    "percentage": 12.5
                                },
                                {
                                    "minute": "45-60",
                                    "count": 5,
                                    "percentage": 15.6
                                },
                                {
                                    "minute": "60-75",
                                    "count": 3,
                                    "percentage": 9.4
                                },
                                {
                                    "minute": "75-90",
                                    "count": 10,
                                    "percentage": 31.3
                                }
                            ]
                        }
                    ],
                    "goals_conceded_minutes": [
                        {
                            "period": [
                                {
                                    "minute": "0-15",
                                    "count": 2,
                                    "percentage": 18.2
                                },
                                {
                                    "minute": "15-30",
                                    "count": 2,
                                    "percentage": 18.2
                                },
                                {
                                    "minute": "30-45",
                                    "count": 2,
                                    "percentage": 18.2
                                },
                                {
                                    "minute": "45-60",
                                    "count": 1,
                                    "percentage": 9.1
                                },
                                {
                                    "minute": "60-75",
                                    "count": 2,
                                    "percentage": 18.2
                                },
                                {
                                    "minute": "75-90",
                                    "count": 2,
                                    "percentage": 18.2
                                }
                            ]
                        }
                    ],
                    "avg_goals_per_game_scored": {
                        "total": 2.67,
                        "home": 2.8,
                        "away": 2.57
                    },
                    "avg_goals_per_game_conceded": {
                        "total": 0.92,
                        "home": 1,
                        "away": 0.86
                    },
                    "avg_first_goal_scored": {
                        "total": "32m",
                        "home": "22m",
                        "away": "38m"
                    },
                    "avg_first_goal_conceded": {
                        "total": "28m",
                        "home": "36m",
                        "away": "13m"
                    },
                    "attacks": 1534,
                    "dangerous_attacks": 766,
                    "avg_ball_possession_percentage": "66.58",
                    "fouls": 84,
                    "avg_fouls_per_game": "7.00",
                    "offsides": 13,
                    "redcards": 0,
                    "yellowcards": 13,
                    "shots_blocked": 32,
                    "shots_off_target": 129,
                    "avg_shots_off_target_per_game": "10.75",
                    "shots_on_target": 79,
                    "avg_shots_on_target_per_game": "6.58",
                    "avg_corners": "5.92",
                    "total_corners": 71,
                    "btts": 50,
                    "goal_line": {
                        "over": {
                            "0_5": {
                                "home": 100,
                                "away": 100
                            },
                            "1_5": {
                                "home": 100,
                                "away": 85.71
                            },
                            "2_5": {
                                "home": 80,
                                "away": 57.14
                            },
                            "3_5": {
                                "home": 40,
                                "away": 42.86
                            },
                            "4_5": {
                                "home": 40,
                                "away": 42.86
                            },
                            "5_5": {
                                "home": 20,
                                "away": 14.29
                            }
                        },
                        "under": {
                            "0_5": {
                                "home": 0,
                                "away": 0
                            },
                            "1_5": {
                                "home": 0,
                                "away": 14.29
                            },
                            "2_5": {
                                "home": 20,
                                "away": 42.86
                            },
                            "3_5": {
                                "home": 60,
                                "away": 57.14
                            },
                            "4_5": {
                                "home": 60,
                                "away": 57.14
                            },
                            "5_5": {
                                "home": 80,
                                "away": 85.71
                            }
                        }
                    },
                    "avg_player_rating": 6.94,
                    "avg_player_rating_per_match": 7,
                    "tackles": 359
                },

Without a filter this request will give you all seasons stats that Celtic has played in, starting chronologically from the first to the most current season.

For convenience, we once again show you the statistics of their current season. The request contains lots of detailed information for you to use as you please.

You can find a link to another article where we discuss the tools in-depth on our

with some includes

Note that for the get squad by season and team id includes, we added the includeplayerfor more detailed player information. For team by id, we enriched the request with and on season id.

This request also on the season id that you’re interested in. This is optional as some web applications also like to show historical team statistics. In this how-to guide, we’ll work with the current season id.

Developer Tools Guide.
Squad by team and season id endpoint
Team by id endpoint
Team season statistics
nested includes
filtered
filters