Matches
Get live match stats
Returns running team stats while a match is in play, with the clock and score in data.meta. Poll it during the match; responses may be cached for up to 30 seconds.
For up to 5 minutes after full-time it still returns the final snapshot with meta.match_status = "finished". After that, and for matches that haven’t started or were postponed or cancelled, it returns 409. Use /stats for post-match totals.
Example: GET /football/matches/mt_838955483/live-stats
GET
/
football
/
matches
/
{match_id}
/
live-stats
Get live match stats
curl --request GET \
--url https://api.thestatsapi.com/api/football/matches/{match_id}/live-stats \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thestatsapi.com/api/football/matches/{match_id}/live-stats', 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}/live-stats"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": {
"match_id": "mt_838955483",
"meta": {
"match_status": "first_half",
"elapsed_minutes": 35,
"home_goals": 0,
"away_goals": 0,
"ht_score": null,
"period": "first_half"
},
"stats": {
"ball_possession": {
"all": {
"home": 47,
"away": 53
}
},
"total_shots": {
"all": {
"home": 2,
"away": 2
}
},
"corner_kicks": {
"all": {
"home": 0,
"away": 1
}
}
}
}
}After full-time, use Get match stats. How to poll during a match: Live matches.
Authorizations
Your API key, sent as Authorization: Bearer YOUR_API_KEY. Get one at https://www.thestatsapi.com/api-keys
Path Parameters
⌘I
Get live match stats
curl --request GET \
--url https://api.thestatsapi.com/api/football/matches/{match_id}/live-stats \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thestatsapi.com/api/football/matches/{match_id}/live-stats', 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}/live-stats"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": {
"match_id": "mt_838955483",
"meta": {
"match_status": "first_half",
"elapsed_minutes": 35,
"home_goals": 0,
"away_goals": 0,
"ht_score": null,
"period": "first_half"
},
"stats": {
"ball_possession": {
"all": {
"home": 47,
"away": 53
}
},
"total_shots": {
"all": {
"home": 2,
"away": 2
}
},
"corner_kicks": {
"all": {
"home": 0,
"away": 1
}
}
}
}
}