Matches
Get a player's match heatmap
Returns the pitch locations where one player touched the ball in one match, as x and y from 0 to 100. Returns 404 when there’s no heatmap, for example for an unused substitute or a match without positional data.
Example: GET /football/matches/mt_404012971/players/pl_84027040/heatmap
GET
/
football
/
matches
/
{match_id}
/
players
/
{player_id}
/
heatmap
Get a player's match heatmap
curl --request GET \
--url https://api.thestatsapi.com/api/football/matches/{match_id}/players/{player_id}/heatmap \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thestatsapi.com/api/football/matches/{match_id}/players/{player_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/matches/{match_id}/players/{player_id}/heatmap"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": {
"match_id": "mt_404012971",
"player": {
"id": "pl_84027040",
"name": "Dušan Vlahović"
},
"team": {
"id": "tm_37201",
"name": "Juventus",
"side": "home"
},
"points": [
{
"x": 41,
"y": 9
}
]
}
}
For a whole season, use Get a player’s season 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 match heatmap
curl --request GET \
--url https://api.thestatsapi.com/api/football/matches/{match_id}/players/{player_id}/heatmap \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thestatsapi.com/api/football/matches/{match_id}/players/{player_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/matches/{match_id}/players/{player_id}/heatmap"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": {
"match_id": "mt_404012971",
"player": {
"id": "pl_84027040",
"name": "Dušan Vlahović"
},
"team": {
"id": "tm_37201",
"name": "Juventus",
"side": "home"
},
"points": [
{
"x": 41,
"y": 9
}
]
}
}