Matches
Get match shotmap
Returns every shot in a match with its xG, outcome, body part, situation and pitch coordinates, plus non-penalty xG totals for both teams. Add player_id to get one player’s shots. Check shotmap_available on the match first.
Example: GET /football/matches/mt_838955483/shotmap
GET
/
football
/
matches
/
{match_id}
/
shotmap
Get match shotmap
curl --request GET \
--url https://api.thestatsapi.com/api/football/matches/{match_id}/shotmap \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thestatsapi.com/api/football/matches/{match_id}/shotmap', 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}/shotmap"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"match_id": "mt_838955483",
"event": {
"id": "mt_838955483",
"home_team_id": "tm_1002",
"away_team_id": "tm_0406"
},
"data": [
{
"id": "sh_613690689",
"player_id": "pl_61849099",
"player_name": "Ollie Watkins",
"team_id": "tm_1002",
"team_name": "Aston Villa",
"x": 16.3,
"y": 45.8,
"minute": 2,
"result": "save",
"expected_goals": 0.118,
"situation": "fast_break",
"body_part": "right_foot",
"goal_type": null,
"goal_mouth_location": "low_centre",
"goal_mouth_coordinates": {
"x": 0,
"y": 50.1,
"z": 5.7
},
"block_coordinates": {
"x": 1.9,
"y": 50.2,
"z": 0
},
"is_blocked_shot": false,
"blocked_by_player_id": null,
"goalkeeper": {
"id": "pl_30223540",
"name": "Giorgi Mamardashvili"
},
"is_goal": false,
"is_on_target": true,
"is_headed": false,
"is_outside_box": false,
"is_penalty": false
}
],
"np_xg_summary": {
"live": {
"home_team": 2.397,
"away_team": 1.572
},
"stored": {
"home_team": 2.397,
"away_team": 1.572
}
},
"meta": {
"is_final": true
}
}Walkthrough with code: 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
Response
The shots and xG summary.
⌘I
Get match shotmap
curl --request GET \
--url https://api.thestatsapi.com/api/football/matches/{match_id}/shotmap \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thestatsapi.com/api/football/matches/{match_id}/shotmap', 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}/shotmap"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"match_id": "mt_838955483",
"event": {
"id": "mt_838955483",
"home_team_id": "tm_1002",
"away_team_id": "tm_0406"
},
"data": [
{
"id": "sh_613690689",
"player_id": "pl_61849099",
"player_name": "Ollie Watkins",
"team_id": "tm_1002",
"team_name": "Aston Villa",
"x": 16.3,
"y": 45.8,
"minute": 2,
"result": "save",
"expected_goals": 0.118,
"situation": "fast_break",
"body_part": "right_foot",
"goal_type": null,
"goal_mouth_location": "low_centre",
"goal_mouth_coordinates": {
"x": 0,
"y": 50.1,
"z": 5.7
},
"block_coordinates": {
"x": 1.9,
"y": 50.2,
"z": 0
},
"is_blocked_shot": false,
"blocked_by_player_id": null,
"goalkeeper": {
"id": "pl_30223540",
"name": "Giorgi Mamardashvili"
},
"is_goal": false,
"is_on_target": true,
"is_headed": false,
"is_outside_box": false,
"is_penalty": false
}
],
"np_xg_summary": {
"live": {
"home_team": 2.397,
"away_team": 1.572
},
"stored": {
"home_team": 2.397,
"away_team": 1.572
}
},
"meta": {
"is_final": true
}
}