Get live match stats
Get running team stats for a match in play, along with the clock and the score. Poll it during the match to keep a live stats panel up to date. Values are totals for the match so far, split into home and away.
https://api.soccer-data.co/v1/matches/{match_id}/live-stats
Live
- Only works while the match is in play. Before kickoff, and for postponed or cancelled matches, it returns 409.
- For up to 5 minutes after full-time you still get the final snapshot, with meta.match_status set to finished. After that it returns 409, so switch to the match stats endpoint.
- Which stats appear depends on the match. Don't expect every stat from the match stats endpoint to be present.
- Responses are normally at most 5 minutes old on Free and 15 seconds old on Pro and Business. If a fresh answer can't be fetched, you may get an older copy marked X-Cache: STALE instead: see When an answer is stale.
- There are no webhooks or streams. Poll this endpoint to pick up changes.
- Find matches in play with List matches and status=live.
The match's id, like match_…. Find one with the ID guide.
The match's id.
The clock and score at the moment of this snapshot.
Detailed state: not_started, first_half, halftime, second_half, extra_time, penalties, finished, suspended or in_progress. finished only shows for up to 5 minutes after full-time.
Minutes since kickoff, counted straight through both halves, as a whole number. Stoppage time isn't split out. The same value appears as live.elapsed_minutes in List matches.
Home team's goals so far.
Away team's goals so far.
Half-time score as text. Can be null.
first_half, halftime, second_half or finished.
One running total per stat, keyed by stat name. Names are the same as in the match stats endpoint, for example ball_possession, expected_goals, total_shots and corner_kicks.
Home team's value for the match so far.
Away team's value for the match so far.
curl "https://api.soccer-data.co/v1/matches/match_9pd0ck6g2m9i/live-stats" \ -H "X-Api-Key: $SOCCER_DATA_KEY"
const res = await fetch("https://api.soccer-data.co/v1/matches/match_9pd0ck6g2m9i/live-stats", {
headers: { "X-Api-Key": process.env.SOCCER_DATA_KEY },
});
const { data } = await res.json();
import os, requests
res = requests.get(
"https://api.soccer-data.co/v1/matches/match_9pd0ck6g2m9i/live-stats",
headers={"X-Api-Key": os.environ["SOCCER_DATA_KEY"]},
)
data = res.json()["data"]
$data = Http::withHeaders(['X-Api-Key' => env('SOCCER_DATA_KEY')])
->get('https://api.soccer-data.co/v1/matches/match_9pd0ck6g2m9i/live-stats')
->json('data');
{
"data": {
"match_id": "match_9pd0ck6g2m9i",
"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
}
}
}
}
}
### GET /matches/{match_id}/live-stats
Get live match stats
Get running team stats for a match in play, along with the clock and the score. Poll it during the match to keep a live stats panel up to date. Values are totals for the match so far, split into home and away.
- Only works while the match is in play. Before kickoff, and for postponed or cancelled matches, it returns 409.
- For up to 5 minutes after full-time you still get the final snapshot, with meta.match_status set to finished. After that it returns 409, so switch to the match stats endpoint.
- Which stats appear depends on the match. Don't expect every stat from the match stats endpoint to be present.
- Responses are normally at most 5 minutes old on Free and 15 seconds old on Pro and Business. If a fresh answer can't be fetched, you may get an older copy marked X-Cache: STALE instead: see [When an answer is stale](/docs/concepts/rate-limits#when-an-answer-is-stale).
- There are no webhooks or streams. Poll this endpoint to pick up changes.
- Find matches in play with List matches and status=live.
Response fields:
- `data.match_id` (string): The match's id.
- `data.meta` (object): The clock and score at the moment of this snapshot.
- `data.meta.match_status` (string|null): Detailed state: not_started, first_half, halftime, second_half, extra_time, penalties, finished, suspended or in_progress. finished only shows for up to 5 minutes after full-time.
- `data.meta.elapsed_minutes` (integer|null): Minutes since kickoff, counted straight through both halves, as a whole number. Stoppage time isn't split out. The same value appears as live.elapsed_minutes in List matches.
- `data.meta.home_goals` (integer|null): Home team's goals so far.
- `data.meta.away_goals` (integer|null): Away team's goals so far.
- `data.meta.ht_score` (string|null): Half-time score as text. Can be null.
- `data.meta.period` (string|null): first_half, halftime, second_half or finished.
- `data.stats.{stat}` (object): One running total per stat, keyed by stat name. Names are the same as in the match stats endpoint, for example ball_possession, expected_goals, total_shots and corner_kicks.
- `data.stats.{stat}.all.home` (number): Home team's value for the match so far.
- `data.stats.{stat}.all.away` (number): Away team's value for the match so far.
Example: curl "https://api.soccer-data.co/v1/matches/match_9pd0ck6g2m9i/live-stats" -H "X-Api-Key: $SOCCER_DATA_KEY"