Get live match player stats
Get every player's stats while a match is being played, with the same fields as the match player stats endpoint. Poll it to keep live ratings, fantasy scores or player cards up to date. Pass player_ids to follow only a few players.
https://api.soccer-data.co/v1/matches/{match_id}/live-player-stats
Live
- Only works while the match is in play. Otherwise it returns 409, so switch to the match player stats endpoint after full-time.
- Find matches in play with List matches and status=live.
- 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.
- rating, the xG fields, ball_recoveries and the substitution fields can be null.
The match's id, like match_…. Find one with the ID guide.
Comma-separated player ids. Only these players are returned. Leave it out to get every player.
Player's id.
Player's name.
Id of the team the player plays for in this match.
G, D, M or F. An empty string when unknown.
Match rating so far.
Minutes on the pitch so far.
Whether the player was in the starting XI.
Whether the player has had any minutes yet.
Passing counts. Stats: total_passes, accurate_passes, key_passes, assists, total_crosses, accurate_crosses, total_long_balls, accurate_long_balls.
Shooting counts. Stats: goals, total_shots, shots_on_target, shots_off_target, blocked_shots, big_chances_created.
Expected goals (xG) from the player's shots so far.
Expected assists (xA) from the player's passes so far.
xG without penalties.
Duel counts. Stats: duel_won, duel_lost, aerial_won, challenge_lost, won_contest (take-ons won), dispossessed.
Defensive counts. Stats: tackles, interceptions, clearances.
Times the player won the ball back. Null when not recorded; 0 means none.
Saves made.
General counts. Stats: touches, fouls (committed), was_fouled, offsides, yellow_cards, red_cards, possession_lost.
Id of the player who came on to replace this player. Null if this player hasn't been taken off.
Id of the player this player replaced when coming on. Null if this player didn't come off the bench.
Always live on this endpoint.
curl "https://api.soccer-data.co/v1/matches/{match_id}/live-player-stats" \
-H "X-Api-Key: $SOCCER_DATA_KEY"
const res = await fetch("https://api.soccer-data.co/v1/matches/{match_id}/live-player-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_id}/live-player-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_id}/live-player-stats')
->json('data');
{
"data": [
{
"player_id": "player_lmlngjs41xni",
"player_name": "Alexis Mac Allister",
"team_id": "team_74p8tg2k93z4",
"position": "M",
"rating": 6.4,
"minutes_played": 55,
"started": true,
"played": true,
"passing": {
"total_passes": 36,
"accurate_passes": 32,
"key_passes": 1,
"assists": 0,
"total_crosses": 1,
"accurate_crosses": 0,
"total_long_balls": 3,
"accurate_long_balls": 2
},
"shooting": {
"goals": 0,
"total_shots": 1,
"shots_on_target": 0,
"shots_off_target": 1,
"blocked_shots": 0,
"big_chances_created": 0,
"expected_goals": 0.04,
"expected_assists": 0.05,
"np_expected_goals": 0.04
},
"duels": {
"duel_won": 3,
"duel_lost": 4,
"aerial_won": 1,
"challenge_lost": 1,
"won_contest": 0,
"dispossessed": 1
},
"defending": {
"tackles": 1,
"interceptions": 1,
"clearances": 0,
"ball_recoveries": 4
},
"goalkeeping": {
"saves": 0
},
"general": {
"touches": 44,
"fouls": 1,
"was_fouled": 1,
"offsides": 0,
"yellow_cards": 0,
"red_cards": 0,
"possession_lost": 5,
"player_subbed_on": null,
"player_subbed_off": null
}
}
],
"meta": {
"match_status": "live"
}
}
### GET /matches/{match_id}/live-player-stats
Get live match player stats
Get every player's stats while a match is being played, with the same fields as the match player stats endpoint. Poll it to keep live ratings, fantasy scores or player cards up to date. Pass player_ids to follow only a few players.
- Only works while the match is in play. Otherwise it returns 409, so switch to the match player stats endpoint after full-time.
- Find matches in play with List matches and status=live.
- 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.
- rating, the xG fields, ball_recoveries and the substitution fields can be null.
Query parameters:
- `player_ids` (string): Comma-separated player ids. Only these players are returned. Leave it out to get every player.
Response fields:
- `data[].player_id` (string): Player's id.
- `data[].player_name` (string): Player's name.
- `data[].team_id` (string): Id of the team the player plays for in this match.
- `data[].position` (string): G, D, M or F. An empty string when unknown.
- `data[].rating` (number|null): Match rating so far.
- `data[].minutes_played` (integer): Minutes on the pitch so far.
- `data[].started` (boolean): Whether the player was in the starting XI.
- `data[].played` (boolean): Whether the player has had any minutes yet.
- `data[].passing.{stat}` (integer): Passing counts. Stats: total_passes, accurate_passes, key_passes, assists, total_crosses, accurate_crosses, total_long_balls, accurate_long_balls.
- `data[].shooting.{stat}` (integer): Shooting counts. Stats: goals, total_shots, shots_on_target, shots_off_target, blocked_shots, big_chances_created.
- `data[].shooting.expected_goals` (number|null): Expected goals (xG) from the player's shots so far.
- `data[].shooting.expected_assists` (number|null): Expected assists (xA) from the player's passes so far.
- `data[].shooting.np_expected_goals` (number|null): xG without penalties.
- `data[].duels.{stat}` (integer): Duel counts. Stats: duel_won, duel_lost, aerial_won, challenge_lost, won_contest (take-ons won), dispossessed.
- `data[].defending.{stat}` (integer): Defensive counts. Stats: tackles, interceptions, clearances.
- `data[].defending.ball_recoveries` (integer|null): Times the player won the ball back. Null when not recorded; 0 means none.
- `data[].goalkeeping.saves` (integer): Saves made.
- `data[].general.{stat}` (integer): General counts. Stats: touches, fouls (committed), was_fouled, offsides, yellow_cards, red_cards, possession_lost.
- `data[].general.player_subbed_on` (string|null): Id of the player who came on to replace this player. Null if this player hasn't been taken off.
- `data[].general.player_subbed_off` (string|null): Id of the player this player replaced when coming on. Null if this player didn't come off the bench.
- `meta.match_status` (string): Always live on this endpoint.
Example: curl "https://api.soccer-data.co/v1/matches/{match_id}/live-player-stats" -H "X-Api-Key: $SOCCER_DATA_KEY"