Teams
Last updated
Was this helpful?
Last updated
Was this helpful?
Every country, league, and season has multiple teams included. The team endpoints are important to show the teams, team stats, and other team data.
This section will briefly discuss all the options available to request teams.
An overview of all the options available:
GET All Teams: returns all the teams that are accessible within your subscription.
GET Team by ID: returns the single team you’ve requested by id.
GET Team by Country ID: returns all the teams from your requested country id.
GET Team by Season ID: returns all the teams from your requested season id.
GET Team Search by Name: returns all the teams that match your search query.
GET Team Current Leagues by ID: returns all the current leagues from your requested team id.
GET Team All Leagues by ID: returns all the current and historical leagues from your requested team id.
The base URL is the same for all team endpoints:
https://api.sportmonks.com/v3/football/teams
Per endpoint, the rest of the URL requires additional information. We will explain this per endpoint.
To get your database filled with all teams in your subscription, you can gather all teams via the The URL to get all your teams is the same as the base URL for teams. All you have to do is authorize the request with your API token. Check our for more info.
Let’s take a look together at what the API returns. As you can see, the API returns all the teams available in the free plan.
You can see the team id, country id, venue id, gender, name, shortcode and image. You can see details about when the club was founded and played its last match.
This endpoint is useful if you only want information about one particular team. You need to add the team_id
to your request:
https://api.sportmonks.com/v3/football/teams
/{team_id}
For example, if you’re interested in information about Celtic (team id: 53).
This endpoint is useful if you only want information about teams from a specific country. You need to add the country_id
to your request:
https://api.sportmonks.com/v3/football/teams
/countries/{country_id}
For example, if you’re interested in all available Scottish teams in your subscription. (team id: 1161).
The fourth option is to retrieve all teams from a specific season. This endpoint is useful if you want team information about current or historical seasons. You need to add the season_id
to your request:
https://api.sportmonks.com/v3/football/teams
/seasons/{season_id}
For example, if you’re interested in all the teams participating in the 2022/2023 Scottish Premiership. (season id: 19735).
https://api.sportmonks.com/v3/football/teams
/search/{search_query}
For example, if you could not find Celtic:
For example, if you’re interested in all the statistics of Celtic (team id: 53)
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.
You can add the &select=
parameter followed by the fields you want. In our case: &select=name,image_path
. This results in the below request and response:
Now that you've requested all the teams, you also know their unique team id. You can use this id in the second option:
Easy isn’t it? You can now request information per team. Now let’s imagine you want an overview of all the teams in a specific country. The option could be just the endpoint you’re looking for.
returns all the teams based on your search query. This might come in handy if you cannot find a team. To search on a team name, you’ll need to add /search/{search_query}
to the teams base URL:
As you’ve learnt in the , you can enrich your request with includes. This section will discuss some of the most common requests on the teams’ endpoints.
First of all, you can find a list of all available includes on the . For teams the most common includes are: players
, seasons,
statistics
and sidelined
.
In our , you’ve learnt how to select specific fields or filter only on the data you’re interested in. Our API returns a set of data related to the team by default. We imagine you’re not interested in all the team data the API returns. Let’s say you’re only interested in the team name and logo of Celtic.
Check our for more information and tips.