Players
Get a player's season heatmap
Returns a player’s touches across every match they played in one competition season, grouped into pitch cells with a count. For tournaments such as the World Cup, group and knockout matches are combined into one map. Returns 400 if season_id belongs to a different competition, and 404 when there’s no heatmap (for example a season not played yet, or a competition without positional data).
Example: GET /football/players/pl_84027040/competitions/comp_6107/seasons/sn_326766/heatmap (Dušan Vlahović, World Cup 2022)
GET
/
football
/
players
/
{player_id}
/
competitions
/
{competition_id}
/
seasons
/
{season_id}
/
heatmap
Get a player's season heatmap
curl --request GET \
--url https://api.thestatsapi.com/api/football/players/{player_id}/competitions/{competition_id}/seasons/{season_id}/heatmap \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thestatsapi.com/api/football/players/{player_id}/competitions/{competition_id}/seasons/{season_id}/heatmap', 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/{player_id}/competitions/{competition_id}/seasons/{season_id}/heatmap"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": {
"player": {
"id": "pl_84027040",
"name": "Dušan Vlahović"
},
"competition": {
"id": "comp_6107",
"name": "FIFA World Cup"
},
"season": {
"id": "sn_326766",
"name": "World Cup 2022"
},
"points": [
{
"x": 41,
"y": 73,
"count": 3
}
]
}
}For one match, use Get a player’s match heatmap.
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 player's season heatmap
curl --request GET \
--url https://api.thestatsapi.com/api/football/players/{player_id}/competitions/{competition_id}/seasons/{season_id}/heatmap \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thestatsapi.com/api/football/players/{player_id}/competitions/{competition_id}/seasons/{season_id}/heatmap', 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/{player_id}/competitions/{competition_id}/seasons/{season_id}/heatmap"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": {
"player": {
"id": "pl_84027040",
"name": "Dušan Vlahović"
},
"competition": {
"id": "comp_6107",
"name": "FIFA World Cup"
},
"season": {
"id": "sn_326766",
"name": "World Cup 2022"
},
"points": [
{
"x": 41,
"y": 73,
"count": 3
}
]
}
}