Skip to content

Pre-match card of two teams

GET
/api/matches/pre-match-data
curl --request GET \
--url 'https://foxleague.ai/api/matches/pre-match-data?home_user_id=1' \
--header 'Authorization: Bearer <token>'

The pre-match card of a pairing: for each side its name, badge, formation, overall ratings, record, recent form, rating, league and lineup, plus the head-to-head of the two players. Leave out away_user_id for an AI opponent.

With match_id the card shows the lineups, formations and ratings recorded for that match; an AI opponent keeps its recorded name and rating. Without it the card reads the teams as they are now: an AI opponent is generated afresh and the other side’s lineup and formation stay empty.

Who: a signed-in player who is one of the two sides.

  • With match_id: you play in that ranked or casual match and home_user_id and away_user_id are its two sides. A tournament or challenge match answers like an unknown id, before and after its broadcast.
  • Without match_id: you are the home side when away_user_id is left out; otherwise you are one of the two sides and a match between them exists.

Refusals:

  • You are not a participant in this match: one of the conditions above fails, including a tournament or challenge match asked by its match id.
  • Home user not found: no account has home_user_id.
  • Home team not found: the home account has no team.
  • Away user not found: no account has away_user_id.
  • Away team not found: the away account has no team.
home_user_id
required
integer format: int32

Account id of the home side.

away_user_id
integer format: int32

Account id of the away side; leave it out for an AI opponent.

match_id
integer format: int32

The match the card is for. With it the card shows what was recorded for that match.

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
away
required

The away side.

object
badge

Badge URI; absent when the team has none (always for an AI team).

string | null
elo_rating
required

Rating; the one recorded for the match when the card is for a match.

integer format: int32
formation
required

Formation, for example 4-3-3; empty when not known.

string
leaderboard_place

The team’s place on the leaderboard (1 is first), by the same ranking as GET /api/leaderboard. Absent for an AI side or when it cannot be read.

integer | null format: int64
leaderboard_total

How many teams the leaderboard holds, as total in GET /api/leaderboard. Present with leaderboard_place.

integer | null format: int64
league
required

League: Bronze, Silver, Gold, Platinum or Diamond.

string
players
required

The lineup, in slot order; empty when not known.

Array<object>

A player on a pre-match card.

object
country
required

Country index; 0 for an AI player.

integer format: int32
name
required

The player’s name.

string
overall
required

Overall rating: the average of the seven attributes.

integer format: int32
position
required

GK, DEF, MID or FWD; an AI player reads Goalkeeper, Defender, Midfielder or Forward.

string
rarity
required

Common, Uncommon, Rare, Epic or Legendary.

string
shirt_number
required

Shirt number.

integer format: int32
recent_form
required

Latest results whose match is public, newest first: W, D or L, at most 5. An AI team shows five generated results.

Array<string>
record
required

The player’s wins, draws and losses. An AI team shows a generated record.

object
drawn
required

Draws.

integer format: int32
lost
required

Losses.

integer format: int32
won
required

Wins.

integer format: int32
stars_overall
required

Average overall of the five best players, one decimal.

number format: double
team_name
required

Team name.

string
team_overall
required

Average overall of the listed players, one decimal.

number format: double
head_to_head
required

The record between the two players.

object
away_wins
required

Matches the away side won.

integer format: int32
draws
required

Draws.

integer format: int32
home_wins
required

Matches the home side won.

integer format: int32
last_result
One of:

The latest match between the two players.

object
away_score
required

Goals of this card’s away side.

integer format: int32
date
required

The match date, YYYY-MM-DD.

string
home_score
required

Goals of this card’s home side.

integer format: int32
total_matches
required

Matches between the two players whose result is public, developer tournaments left out; 0 against an AI team.

integer format: int32
home
required

The home side.

object
badge

Badge URI; absent when the team has none (always for an AI team).

string | null
elo_rating
required

Rating; the one recorded for the match when the card is for a match.

integer format: int32
formation
required

Formation, for example 4-3-3; empty when not known.

string
leaderboard_place

The team’s place on the leaderboard (1 is first), by the same ranking as GET /api/leaderboard. Absent for an AI side or when it cannot be read.

integer | null format: int64
leaderboard_total

How many teams the leaderboard holds, as total in GET /api/leaderboard. Present with leaderboard_place.

integer | null format: int64
league
required

League: Bronze, Silver, Gold, Platinum or Diamond.

string
players
required

The lineup, in slot order; empty when not known.

Array<object>

A player on a pre-match card.

object
country
required

Country index; 0 for an AI player.

integer format: int32
name
required

The player’s name.

string
overall
required

Overall rating: the average of the seven attributes.

integer format: int32
position
required

GK, DEF, MID or FWD; an AI player reads Goalkeeper, Defender, Midfielder or Forward.

string
rarity
required

Common, Uncommon, Rare, Epic or Legendary.

string
shirt_number
required

Shirt number.

integer format: int32
recent_form
required

Latest results whose match is public, newest first: W, D or L, at most 5. An AI team shows five generated results.

Array<string>
record
required

The player’s wins, draws and losses. An AI team shows a generated record.

object
drawn
required

Draws.

integer format: int32
lost
required

Losses.

integer format: int32
won
required

Wins.

integer format: int32
stars_overall
required

Average overall of the five best players, one decimal.

number format: double
team_name
required

Team name.

string
team_overall
required

Average overall of the listed players, one decimal.

number format: double
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": {
"away": {
"badge": "ipfs://bafybeih5jkqz2o4r7wq3a6sxn4kq2l3m5ve6yt7ofsbc2j3dw2p3wrzwxa/badge.png",
"elo_rating": 1261,
"formation": "4-4-2",
"league": "Silver",
"players": [
{
"country": 19,
"name": "Teo Brandt",
"overall": 65,
"position": "GK",
"rarity": "Rare",
"shirt_number": 1
}
],
"recent_form": [
"L",
"W",
"W",
"W",
"D"
],
"record": {
"drawn": 6,
"lost": 11,
"won": 20
},
"stars_overall": 69.4,
"team_name": "Night Owls",
"team_overall": 62.8
},
"head_to_head": {
"away_wins": 1,
"draws": 1,
"home_wins": 1,
"last_result": {
"away_score": 2,
"date": "2026-09-27",
"home_score": 2
},
"total_matches": 3
},
"home": {
"badge": "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi/badge.png",
"elo_rating": 1254,
"formation": "4-3-3",
"league": "Silver",
"players": [
{
"country": 12,
"name": "Vulpes Keeper",
"overall": 63,
"position": "GK",
"rarity": "Uncommon",
"shirt_number": 1
},
{
"country": 31,
"name": "Ion Lupu",
"overall": 59,
"position": "DEF",
"rarity": "Common",
"shirt_number": 4
},
{
"country": 7,
"name": "Marco Vela",
"overall": 71,
"position": "FWD",
"rarity": "Rare",
"shirt_number": 9
}
],
"recent_form": [
"W",
"L",
"W",
"D",
"W"
],
"record": {
"drawn": 4,
"lost": 9,
"won": 12
},
"stars_overall": 68.2,
"team_name": "Red Foxes",
"team_overall": 61.4
}
},
"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