Skip to content

Match statistics and lineups

GET
/api/matches/{id}/stats
curl --request GET \
--url https://foxleague.ai/api/matches/1/stats

The match analysis once the result is public: score, possession, team and player statistics, goals, a timeline, the formations and squads with the name behind each shirt. Before that a ranked or casual match whose result is not applied answers a lineup-only form {"gated": true}; its two players also get player_names and player_slot_identities. A tournament or challenge match answers Match not found like an unknown id, before and after its broadcast: ask by its public id (GET /api/public/tournament-match/{id}/stats).

Who: anyone, with more for a session: a session of one of the two players adds the names above. A session header that is present but invalid answers 401.

Refusals:

  • Match not found: no such match; a tournament or challenge match.
  • No stats available for this match: the result is public but no analysis exists for the match.
id
required
integer format: int32

The match id.

Success or a refusal: read success (the refusals are in the description).

Media type application/json
object
code

A machine-readable reason next to error, set only where the caller must act differently. tx_pending: the payment was not refused but could not be verified yet; keep the transaction hash and confirm again with the same hash, never pay twice.

string | null
data

The answer. Present when success is true.

object
analyzer

Name of the analysis.

string
away_formation

The away side’s formation, when known.

string
away_lineup

The away squad, when known, in the same form as home_lineup.

gated

true on the lineup-only form; absent on the full analysis.

boolean
goals

Every goal with its time, side and scorer.

Array
home_formation

The home side’s formation, when known.

string
home_lineup

The home squad, when known: formation, lineup and substitutes (NFT nonces) and players with each card’s attributes, level, condition and portrait.

match

Teams (left_team, right_team), final_score, penalties (null without a shootout), decided_by and the match’s length.

object
player_names

Map of home-<n> or away-<n> (the player’s number on the pitch, 1 to 11) to {name, shirt_number, country} of the card.

object
player_slot_identities

Map of squad slot (0 to 17 home, 18 to 35 away) to {name, shirt_number, country} of the card, for the viewer.

object
player_types

Technical data of the recording; not needed to show the match.

object
players

Per-player statistics for left and right.

object
possession

Ball possession in percent: overall, first_half and second_half, each with left and right.

object
server_params

Technical data of the recording; not needed to show the match.

object
team_stats

Team totals for left and right: shots, passes, tackles, saves, fouls, corners, cards and more.

object
timeline

The match’s events in order.

Array
version

Version of the analysis format.

string
error

Why the request was refused, in plain words. Present when success is false.

string | null
success
required

true when the request did what it asked. false is a refusal: read error.

boolean
Example
{
"data": {
"analyzer": "foxleague-match-analyzer",
"away_formation": "4-4-2",
"goals": [
{
"cycle": 1432,
"half": 1,
"minute": 21,
"scorer_unum": 9,
"team": "left"
},
{
"cycle": 3810,
"half": 2,
"minute": 57,
"scorer_unum": 10,
"team": "right"
},
{
"cycle": 5502,
"half": 2,
"minute": 82,
"scorer_unum": 11,
"team": "left"
}
],
"home_formation": "4-3-3",
"match": {
"decided_by": "regular",
"duration_seconds": 600,
"final_score": {
"left": 2,
"right": 1
},
"halfs": 2,
"left_team": "Red Foxes",
"penalties": null,
"right_team": "Night Owls",
"total_cycles": 6000
},
"player_names": {
"away-10": {
"country": 19,
"name": "Teo Brandt",
"shirt_number": 10
},
"home-9": {
"country": 7,
"name": "Marco Vela",
"shirt_number": 9
}
},
"player_slot_identities": {
"0": {
"country": 12,
"name": "Vulpes Keeper",
"shirt_number": 1
}
},
"player_types": {},
"players": {
"left": [
{
"assists": 0,
"distance_covered": 4120.5,
"goals": 1,
"interceptions": 1,
"pass_accuracy": 78.3,
"passes_completed": 18,
"shots": 4,
"shots_on_target": 2,
"tackles": 0,
"unum": 9,
"yellow_card": false
}
],
"right": []
},
"possession": {
"first_half": {
"left": 51,
"right": 49
},
"overall": {
"left": 54.2,
"right": 45.8
},
"second_half": {
"left": 57.4,
"right": 42.6
}
},
"server_params": {},
"team_stats": {
"left": {
"corners": 4,
"fouls_committed": 3,
"name": "Red Foxes",
"pass_accuracy": 81.3,
"red_cards": 0,
"saves": 2,
"total_passes_completed": 214,
"total_shots": 11,
"total_shots_on_target": 5,
"total_tackles": 9
},
"right": {
"corners": 2,
"fouls_committed": 5,
"name": "Night Owls",
"pass_accuracy": 77.9,
"red_cards": 0,
"saves": 3,
"total_passes_completed": 180,
"total_shots": 7,
"total_shots_on_target": 3,
"total_tackles": 12
}
},
"timeline": [
{
"cycle": 1432,
"team": "left",
"type": "goal"
}
],
"version": "1.3"
},
"success": true
}

No valid session. The body is plain text: Missing Authorization header, Invalid Authorization format, Invalid session token or Session expired or invalid. Sign in again.

Media type text/plain
string
Example
Session expired or invalid

A server read failed. The body is empty.