Players
List players
Returns players, 20 per page. Search by name, list a team’s players, or fetch several players by ID in one call. With search, the best match comes first.
Examples
- Find a player:
GET /football/players?search=saka - Several players at once:
GET /football/players?player_ids=pl_45126714,pl_29627593
GET
/
football
/
players
List players
curl --request GET \
--url https://api.thestatsapi.com/api/football/players \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thestatsapi.com/api/football/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/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
},
"date_of_birth": "1999-09-21",
"age": 27
}
],
"meta": {
"page": 1,
"per_page": 20,
"total": 100,
"total_pages": 5
}
}Use it to find a
player_id. More ways to look up IDs: Finding IDs.Authorizations
Your API key, sent as Authorization: Bearer YOUR_API_KEY. Get one at https://www.thestatsapi.com/api-keys
Query Parameters
⌘I
List players
curl --request GET \
--url https://api.thestatsapi.com/api/football/players \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thestatsapi.com/api/football/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/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
},
"date_of_birth": "1999-09-21",
"age": 27
}
],
"meta": {
"page": 1,
"per_page": 20,
"total": 100,
"total_pages": 5
}
}