Match statistics and lineups
const url = 'https://foxleague.ai/api/matches/1/stats';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://foxleague.ai/api/matches/1/statsThe 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.
Authorizations
Section titled “Authorizations ”- None
- session
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The match id.
Responses
Section titled “ Responses ”Success or a refusal: read success (the refusals are in the description).
object
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.
The answer. Present when success is true.
object
Name of the analysis.
The away side’s formation, when known.
The away squad, when known, in the same form as home_lineup.
true on the lineup-only form; absent on the full analysis.
Every goal with its time, side and scorer.
The home side’s formation, when known.
The home squad, when known: formation, lineup and substitutes (NFT nonces) and players with each card’s attributes, level, condition and portrait.
Teams (left_team, right_team), final_score, penalties (null without a shootout), decided_by and the match’s length.
object
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
Map of squad slot (0 to 17 home, 18 to 35 away) to {name, shirt_number, country} of the card, for the viewer.
object
Technical data of the recording; not needed to show the match.
object
Per-player statistics for left and right.
object
Ball possession in percent: overall, first_half and second_half, each with left and right.
object
Technical data of the recording; not needed to show the match.
object
Team totals for left and right: shots, passes, tackles, saves, fouls, corners, cards and more.
object
The match’s events in order.
Version of the analysis format.
Why the request was refused, in plain words. Present when success is false.
true when the request did what it asked. false is a refusal: read error.
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.
Example
Session expired or invalidA server read failed. The body is empty.