Teams
Get a team's squad
Returns the players registered to a team (up to 100), with extra profile fields such as preferred foot, contract end date, market value and national team. For a national team, returns the players who represent it.
Example: GET /football/teams/tm_9145/players (Arsenal)
GET
/
football
/
teams
/
{team_id}
/
players
Get a team's squad
curl --request GET \
--url https://api.thestatsapi.com/api/football/teams/{team_id}/players \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thestatsapi.com/api/football/teams/{team_id}/players', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.thestatsapi.com/api/football/teams/{team_id}/players"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": [
{
"id": "pl_29627593",
"name": "Alexander Isak",
"first_name": "Alexander",
"last_name": "Isak",
"position": "F",
"nationality": "Sweden",
"height_cm": 193,
"current_team": {
"id": "tm_0406",
"name": "Liverpool",
"jersey_number": 9
},
"slug": "alexander-isak-pl_29627593",
"short_name": "A. Isak",
"preferred_foot": "right",
"country_slug": "sweden",
"market_value": 88000000,
"contract_until": "2031-06-30",
"national_team": {
"id": "tm_86978",
"name": "Sweden"
},
"date_of_birth": "1999-09-21",
"age": 27
}
]
}Use it to get the
player_ids in a squad, then call Get a player’s season stats. See Player and team stats.Authorizations
Your API key, sent as Authorization: Bearer YOUR_API_KEY. Get one at https://www.thestatsapi.com/api-keys
Path Parameters
⌘I
Get a team's squad
curl --request GET \
--url https://api.thestatsapi.com/api/football/teams/{team_id}/players \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thestatsapi.com/api/football/teams/{team_id}/players', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.thestatsapi.com/api/football/teams/{team_id}/players"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": [
{
"id": "pl_29627593",
"name": "Alexander Isak",
"first_name": "Alexander",
"last_name": "Isak",
"position": "F",
"nationality": "Sweden",
"height_cm": 193,
"current_team": {
"id": "tm_0406",
"name": "Liverpool",
"jersey_number": 9
},
"slug": "alexander-isak-pl_29627593",
"short_name": "A. Isak",
"preferred_foot": "right",
"country_slug": "sweden",
"market_value": 88000000,
"contract_until": "2031-06-30",
"national_team": {
"id": "tm_86978",
"name": "Sweden"
},
"date_of_birth": "1999-09-21",
"age": 27
}
]
}