{
 "openapi": "3.1.0",
 "info": {
  "title": "Footy Ferret API",
  "version": "1.0.0",
  "summary": "Football lineups, ratings and results as JSON: lower leagues, women’s and youth football included.",
  "description": "Read-only football statistics from footyferret.com: the same data as the pages, as JSON. No key needed. Lineups appear 5 minutes after we had them; addresses are slugs, and a renamed one answers 301. Each response names the page that shows the same data (url): cite it, crediting \"Footy Ferret (footyferret.com)\". Statistics only: no betting content. Responses are cached for a minute (matches, days) to an hour (rankings).",
  "termsOfService": "https://footyferret.com/terms",
  "contact": {
   "name": "Footy Ferret",
   "email": "hello@footyferret.com",
   "url": "https://footyferret.com/contact"
  }
 },
 "servers": [
  {
   "url": "https://footyferret.com/api/v1"
  }
 ],
 "paths": {
  "/days/{date}.json": {
   "get": {
    "operationId": "getDay",
    "summary": "Matches on a day",
    "description": "Every match of one UTC day, grouped by competition, strongest first, with the day’s totals.",
    "parameters": [
     {
      "name": "date",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^(?:\\d{4}-\\d{2}-\\d{2}|today)$"
      },
      "description": "YYYY-MM-DD in UTC, or \"today\"."
     }
    ],
    "responses": {
     "200": {
      "description": "The resource.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/DayResponse"
        }
       }
      }
     },
     "400": {
      "description": "Malformed input.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "No such address.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "Busy: try again after Retry-After seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/matches/{slug}.json": {
   "get": {
    "operationId": "getMatch",
    "summary": "A match",
    "description": "Score, lineups, team-news reads, final stats, player lines, both teams’ ratings, form and table lines, earlier meetings.",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
      },
      "description": "The match's address, as in its page's URL."
     }
    ],
    "responses": {
     "200": {
      "description": "The resource.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/MatchResponse"
        }
       }
      }
     },
     "301": {
      "description": "The name changed: Location gives the new address."
     },
     "404": {
      "description": "No such address.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "Busy: try again after Retry-After seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/competitions.json": {
   "get": {
    "operationId": "listCompetitions",
    "summary": "Every competition",
    "description": "Every competition covered, with country, level, league strength and how many matches and lineups we hold.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "The resource.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/CompetitionsResponse"
        }
       }
      }
     },
     "404": {
      "description": "No such address.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "Busy: try again after Retry-After seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/competitions/{slug}.json": {
   "get": {
    "operationId": "getCompetition",
    "summary": "A competition",
    "description": "Official table and ours from results, teams with ratings, results, fixtures, goals and the results grid.",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
      },
      "description": "The competition's address, as in its page's URL."
     }
    ],
    "responses": {
     "200": {
      "description": "The resource.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/CompetitionResponse"
        }
       }
      }
     },
     "301": {
      "description": "The name changed: Location gives the new address."
     },
     "404": {
      "description": "No such address.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "Busy: try again after Retry-After seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/teams/{slug}.json": {
   "get": {
    "operationId": "getTeam",
    "summary": "A team",
    "description": "Rating and rank, table line, form, results, fixtures, squad usage, latest lineup, team news and rating history.",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
      },
      "description": "The team's address, as in its page's URL."
     }
    ],
    "responses": {
     "200": {
      "description": "The resource.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/TeamResponse"
        }
       }
      }
     },
     "301": {
      "description": "The name changed: Location gives the new address."
     },
     "404": {
      "description": "No such address.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "Busy: try again after Retry-After seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/players/{slug}.json": {
   "get": {
    "operationId": "getPlayer",
    "summary": "A player",
    "description": "Season totals, match-by-match lines, lineups named in and squad usage.",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
      },
      "description": "The player's address, as in its page's URL."
     }
    ],
    "responses": {
     "200": {
      "description": "The resource.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PlayerResponse"
        }
       }
      }
     },
     "301": {
      "description": "The name changed: Location gives the new address."
     },
     "404": {
      "description": "No such address.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "Busy: try again after Retry-After seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/rankings/{scale}.json": {
   "get": {
    "operationId": "getRankings",
    "summary": "Power rankings",
    "description": "The top 100 teams on one rating scale, with movement over 7 days and the biggest movers.",
    "parameters": [
     {
      "name": "scale",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "men_club",
        "women_club",
        "men_national",
        "women_national"
       ]
      }
     },
     {
      "name": "age",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "pattern": "^(?:senior|u\\d{2})$",
       "default": "senior"
      },
      "description": "Youth sides rank only within their age group."
     }
    ],
    "responses": {
     "200": {
      "description": "The resource.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/RankingsResponse"
        }
       }
      }
     },
     "400": {
      "description": "Malformed input.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "No such address.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "503": {
      "description": "Busy: try again after Retry-After seconds.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Error": {
    "type": "object",
    "required": [
     "error"
    ],
    "properties": {
     "error": {
      "type": "object",
      "required": [
       "status",
       "message"
      ],
      "properties": {
       "status": {
        "type": "integer"
       },
       "message": {
        "type": "string"
       }
      }
     }
    }
   },
   "TeamRef": {
    "type": "object",
    "required": [
     "name",
     "slug",
     "short",
     "rating",
     "scale",
     "matches"
    ],
    "properties": {
     "name": {
      "type": "string"
     },
     "slug": {
      "type": [
       "string",
       "null"
      ],
      "description": "The address of its page and API resource; null while the site has not given it one yet."
     },
     "short": {
      "type": "string",
      "description": "Initials, for badges."
     },
     "rating": {
      "type": [
       "number",
       "null"
      ],
      "description": "Today's power rating: higher is better; comparable only within its scale."
     },
     "scale": {
      "type": [
       "string",
       "null"
      ],
      "description": "The rating scale: men_club, women_club, men_national or women_national."
     },
     "matches": {
      "type": [
       "integer",
       "null"
      ],
      "description": "Matches the rating rests on; under 10 is provisional."
     }
    }
   },
   "TeamLine": {
    "type": "object",
    "required": [
     "name",
     "slug",
     "short",
     "rating",
     "scale",
     "matches",
     "attack",
     "defence"
    ],
    "properties": {
     "name": {
      "type": "string"
     },
     "slug": {
      "type": [
       "string",
       "null"
      ],
      "description": "The address of its page and API resource; null while the site has not given it one yet."
     },
     "short": {
      "type": "string",
      "description": "Initials, for badges."
     },
     "rating": {
      "type": [
       "number",
       "null"
      ],
      "description": "Today's power rating: higher is better; comparable only within its scale."
     },
     "scale": {
      "type": [
       "string",
       "null"
      ],
      "description": "The rating scale: men_club, women_club, men_national or women_national."
     },
     "matches": {
      "type": [
       "integer",
       "null"
      ],
      "description": "Matches the rating rests on; under 10 is provisional."
     },
     "attack": {
      "type": [
       "number",
       "null"
      ]
     },
     "defence": {
      "type": [
       "number",
       "null"
      ]
     }
    }
   },
   "CompetitionRef": {
    "type": "object",
    "required": [
     "slug",
     "name",
     "country",
     "country_code",
     "gender",
     "age_group",
     "format",
     "level",
     "season",
     "strength",
     "scale",
     "rank",
     "of"
    ],
    "properties": {
     "slug": {
      "type": [
       "string",
       "null"
      ],
      "description": "The address of its page and API resource; null while the site has not given it one yet."
     },
     "name": {
      "type": "string"
     },
     "country": {
      "type": [
       "string",
       "null"
      ]
     },
     "country_code": {
      "type": [
       "string",
       "null"
      ]
     },
     "gender": {
      "type": "string"
     },
     "age_group": {
      "type": "string",
      "description": "senior, or u and an age."
     },
     "format": {
      "type": "string",
      "description": "league or cup."
     },
     "level": {
      "type": [
       "integer",
       "null"
      ],
      "description": "1 is the top tier."
     },
     "season": {
      "type": "string"
     },
     "strength": {
      "type": [
       "number",
       "null"
      ],
      "description": "League strength: what an average team in it is worth on its rating scale."
     },
     "scale": {
      "type": [
       "string",
       "null"
      ]
     },
     "rank": {
      "type": [
       "integer",
       "null"
      ],
      "description": "Place by strength among competitions on the same scale and in the same age group."
     },
     "of": {
      "type": [
       "integer",
       "null"
      ]
     }
    }
   },
   "MatchRow": {
    "type": "object",
    "required": [
     "slug",
     "kickoff_utc",
     "state",
     "home_goals",
     "away_goals",
     "home",
     "away",
     "competition",
     "competition_slug",
     "lineups",
     "had_utc",
     "lead_minutes",
     "changes",
     "missing",
     "pre"
    ],
    "properties": {
     "slug": {
      "type": [
       "string",
       "null"
      ],
      "description": "The address of its page and API resource; null while the site has not given it one yet."
     },
     "kickoff_utc": {
      "type": "string",
      "format": "date-time"
     },
     "state": {
      "type": "string",
      "enum": [
       "scheduled",
       "in_play",
       "finished",
       "postponed",
       "cancelled",
       "abandoned",
       "awarded",
       "unconfirmed"
      ]
     },
     "home_goals": {
      "type": [
       "integer",
       "null"
      ],
      "description": "Final score only: null unless finished or awarded. No live scores."
     },
     "away_goals": {
      "type": [
       "integer",
       "null"
      ]
     },
     "home": {
      "$ref": "#/components/schemas/TeamRef"
     },
     "away": {
      "$ref": "#/components/schemas/TeamRef"
     },
     "competition": {
      "type": "string"
     },
     "competition_slug": {
      "type": [
       "string",
       "null"
      ]
     },
     "lineups": {
      "type": "integer",
      "minimum": 0,
      "maximum": 2,
      "description": "Lineups shown so far (free visitors see each 5 minutes after we had it)."
     },
     "had_utc": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time",
      "description": "When we had the later lineup."
     },
     "lead_minutes": {
      "type": [
       "integer",
       "null"
      ],
      "description": "Minutes before kickoff we had it."
     },
     "changes": {
      "type": "array",
      "minItems": 2,
      "maxItems": 2,
      "items": {
       "type": [
        "integer",
        "null"
       ]
      },
      "description": "Starters changed from the previous match: home, away."
     },
     "missing": {
      "type": "array",
      "minItems": 2,
      "maxItems": 2,
      "items": {
       "type": [
        "integer",
        "null"
       ]
      },
      "description": "Regular starters missing: home, away."
     },
     "pre": {
      "type": "array",
      "minItems": 2,
      "maxItems": 2,
      "items": {
       "type": [
        "number",
        "null"
       ]
      },
      "description": "Each side's rating before the match: home, away."
     }
    }
   },
   "RatingCard": {
    "type": "object",
    "required": [
     "rating",
     "attack",
     "defence",
     "matches",
     "scale",
     "age_group",
     "as_of_utc",
     "rank",
     "of",
     "rating_7d_ago",
     "rating_30d_ago",
     "rank_7d_ago"
    ],
    "properties": {
     "rating": {
      "type": "number"
     },
     "attack": {
      "type": "number"
     },
     "defence": {
      "type": "number"
     },
     "matches": {
      "type": "integer"
     },
     "scale": {
      "type": "string"
     },
     "age_group": {
      "type": "string"
     },
     "as_of_utc": {
      "type": "string",
      "format": "date-time"
     },
     "rank": {
      "type": "integer",
      "description": "Among teams on the same scale and in the same age group."
     },
     "of": {
      "type": "integer"
     },
     "rating_7d_ago": {
      "type": [
       "number",
       "null"
      ]
     },
     "rating_30d_ago": {
      "type": [
       "number",
       "null"
      ]
     },
     "rank_7d_ago": {
      "type": [
       "integer",
       "null"
      ]
     }
    }
   },
   "Tally": {
    "type": "object",
    "required": [
     "played",
     "won",
     "drawn",
     "lost",
     "goals_for",
     "goals_against",
     "points"
    ],
    "properties": {
     "played": {
      "type": "integer"
     },
     "won": {
      "type": "integer"
     },
     "drawn": {
      "type": "integer"
     },
     "lost": {
      "type": "integer"
     },
     "goals_for": {
      "type": "integer"
     },
     "goals_against": {
      "type": "integer"
     },
     "points": {
      "type": "integer"
     }
    }
   },
   "FormItem": {
    "type": "object",
    "required": [
     "outcome",
     "slug",
     "kickoff_utc",
     "home",
     "goals_for",
     "goals_against"
    ],
    "properties": {
     "outcome": {
      "type": "string",
      "enum": [
       "W",
       "D",
       "L"
      ]
     },
     "slug": {
      "type": [
       "string",
       "null"
      ],
      "description": "The match."
     },
     "kickoff_utc": {
      "type": "string",
      "format": "date-time"
     },
     "home": {
      "type": "boolean"
     },
     "goals_for": {
      "type": "integer"
     },
     "goals_against": {
      "type": "integer"
     }
    }
   },
   "FormLine": {
    "type": "object",
    "required": [
     "outcome",
     "slug",
     "kickoff_utc",
     "home",
     "goals_for",
     "goals_against",
     "opponent",
     "competition",
     "competition_slug"
    ],
    "properties": {
     "outcome": {
      "type": "string",
      "enum": [
       "W",
       "D",
       "L"
      ]
     },
     "slug": {
      "type": [
       "string",
       "null"
      ],
      "description": "The match."
     },
     "kickoff_utc": {
      "type": "string",
      "format": "date-time"
     },
     "home": {
      "type": "boolean"
     },
     "goals_for": {
      "type": "integer"
     },
     "goals_against": {
      "type": "integer"
     },
     "opponent": {
      "$ref": "#/components/schemas/TeamRef"
     },
     "competition": {
      "type": "string"
     },
     "competition_slug": {
      "type": [
       "string",
       "null"
      ]
     }
    }
   },
   "TableRow": {
    "type": "object",
    "required": [
     "played",
     "won",
     "drawn",
     "lost",
     "goals_for",
     "goals_against",
     "points",
     "position",
     "goal_difference",
     "home",
     "away",
     "form",
     "team"
    ],
    "properties": {
     "played": {
      "type": "integer"
     },
     "won": {
      "type": "integer"
     },
     "drawn": {
      "type": "integer"
     },
     "lost": {
      "type": "integer"
     },
     "goals_for": {
      "type": "integer"
     },
     "goals_against": {
      "type": "integer"
     },
     "points": {
      "type": "integer"
     },
     "position": {
      "type": "integer"
     },
     "goal_difference": {
      "type": "integer"
     },
     "home": {
      "$ref": "#/components/schemas/Tally"
     },
     "away": {
      "$ref": "#/components/schemas/Tally"
     },
     "form": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/FormItem"
      }
     },
     "team": {
      "$ref": "#/components/schemas/TeamLine"
     }
    },
    "description": "A line of our table counted from the results we hold: 3 points a win, 1 a draw."
   },
   "OfficialLine": {
    "type": "object",
    "required": [
     "played",
     "won",
     "drawn",
     "lost",
     "goals_for",
     "goals_against",
     "points",
     "position",
     "goal_difference",
     "zone",
     "home",
     "away",
     "form",
     "team"
    ],
    "properties": {
     "played": {
      "type": "integer"
     },
     "won": {
      "type": "integer"
     },
     "drawn": {
      "type": "integer"
     },
     "lost": {
      "type": "integer"
     },
     "goals_for": {
      "type": "integer"
     },
     "goals_against": {
      "type": "integer"
     },
     "points": {
      "type": "integer"
     },
     "position": {
      "type": "integer"
     },
     "goal_difference": {
      "type": "integer"
     },
     "zone": {
      "type": [
       "string",
       "null"
      ]
     },
     "home": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/Tally"
       },
       {
        "type": "null"
       }
      ]
     },
     "away": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/Tally"
       },
       {
        "type": "null"
       }
      ]
     },
     "form": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/FormItem"
      }
     },
     "team": {
      "$ref": "#/components/schemas/TeamLine"
     }
    },
    "description": "A line of the league's own table, as published (points after deductions)."
   },
   "OfficialTable": {
    "type": "object",
    "required": [
     "name",
     "season",
     "round",
     "rounds",
     "as_of_utc",
     "splits",
     "rows"
    ],
    "properties": {
     "name": {
      "type": "string"
     },
     "season": {
      "type": "string"
     },
     "round": {
      "type": [
       "integer",
       "null"
      ]
     },
     "rounds": {
      "type": [
       "integer",
       "null"
      ]
     },
     "as_of_utc": {
      "type": "string",
      "format": "date-time"
     },
     "splits": {
      "type": "boolean"
     },
     "rows": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/OfficialLine"
      }
     }
    }
   },
   "SeasonLine": {
    "type": "object",
    "required": [
     "squads",
     "starts",
     "appearances",
     "minutes",
     "goals",
     "assists",
     "yellow_cards",
     "red_cards",
     "last_match_utc",
     "since_utc",
     "as_of_utc"
    ],
    "properties": {
     "squads": {
      "type": "integer",
      "description": "Matchday squads named in."
     },
     "starts": {
      "type": "integer"
     },
     "appearances": {
      "type": [
       "integer",
       "null"
      ]
     },
     "minutes": {
      "type": [
       "integer",
       "null"
      ]
     },
     "goals": {
      "type": [
       "integer",
       "null"
      ]
     },
     "assists": {
      "type": [
       "integer",
       "null"
      ]
     },
     "yellow_cards": {
      "type": [
       "integer",
       "null"
      ]
     },
     "red_cards": {
      "type": [
       "integer",
       "null"
      ]
     },
     "last_match_utc": {
      "type": "string",
      "format": "date-time"
     },
     "since_utc": {
      "type": "string",
      "format": "date-time",
      "description": "Counted from the first match we hold of this competition and season."
     },
     "as_of_utc": {
      "type": "string",
      "format": "date-time"
     }
    },
    "description": "A player's totals for one team in one competition and season."
   },
   "SheetPlayer": {
    "type": "object",
    "required": [
     "name",
     "slug",
     "role",
     "position",
     "shirt",
     "captain",
     "season"
    ],
    "properties": {
     "name": {
      "type": "string"
     },
     "slug": {
      "type": [
       "string",
       "null"
      ]
     },
     "role": {
      "type": "string",
      "enum": [
       "starter",
       "substitute"
      ]
     },
     "position": {
      "type": [
       "string",
       "null"
      ]
     },
     "shirt": {
      "type": [
       "integer",
       "null"
      ]
     },
     "captain": {
      "type": "boolean"
     },
     "season": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/SeasonLine"
       },
       {
        "type": "null"
       }
      ]
     }
    }
   },
   "Lineup": {
    "type": "object",
    "required": [
     "team",
     "team_slug",
     "players",
     "source_kind",
     "source_published_utc",
     "we_had_it_utc",
     "kickoff_utc",
     "fixture_slug"
    ],
    "properties": {
     "team": {
      "type": "string"
     },
     "team_slug": {
      "type": [
       "string",
       "null"
      ]
     },
     "players": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/SheetPlayer"
      }
     },
     "source_kind": {
      "type": "string",
      "description": "Who published it: federation, league, club or other."
     },
     "source_published_utc": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "we_had_it_utc": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time",
      "description": "When we had it; null when filled in later from the match record."
     },
     "kickoff_utc": {
      "type": "string",
      "format": "date-time"
     },
     "fixture_slug": {
      "type": [
       "string",
       "null"
      ]
     }
    },
    "description": "A lineup, shown to everyone 5 minutes after we had it."
   },
   "Read": {
    "type": "object",
    "required": [
     "team",
     "team_slug",
     "changes_vs_last",
     "missing",
     "facts"
    ],
    "properties": {
     "team": {
      "type": "string"
     },
     "team_slug": {
      "type": [
       "string",
       "null"
      ]
     },
     "changes_vs_last": {
      "type": [
       "integer",
       "null"
      ]
     },
     "missing": {
      "type": "array",
      "items": {
       "type": "object",
       "required": [
        "name",
        "slug"
       ],
       "properties": {
        "name": {
         "type": "string"
        },
        "slug": {
         "type": [
          "string",
          "null"
         ]
        }
       }
      }
     },
     "facts": {
      "type": "array",
      "items": {
       "type": "string"
      }
     }
    },
    "description": "A team-news read: what changed against the previous lineup."
   },
   "PlayerLine": {
    "type": "object",
    "required": [
     "name",
     "slug",
     "started",
     "came_on",
     "minute_on",
     "minute_off",
     "minutes",
     "goals",
     "assists",
     "shots",
     "shots_on_target",
     "yellow_cards",
     "red_cards",
     "position",
     "shirt",
     "season"
    ],
    "properties": {
     "name": {
      "type": "string"
     },
     "slug": {
      "type": [
       "string",
       "null"
      ]
     },
     "started": {
      "type": "boolean"
     },
     "came_on": {
      "type": [
       "boolean",
       "null"
      ]
     },
     "minute_on": {
      "type": [
       "integer",
       "null"
      ]
     },
     "minute_off": {
      "type": [
       "integer",
       "null"
      ]
     },
     "minutes": {
      "type": [
       "integer",
       "null"
      ]
     },
     "goals": {
      "type": [
       "integer",
       "null"
      ]
     },
     "assists": {
      "type": [
       "integer",
       "null"
      ]
     },
     "shots": {
      "type": [
       "integer",
       "null"
      ]
     },
     "shots_on_target": {
      "type": [
       "integer",
       "null"
      ]
     },
     "yellow_cards": {
      "type": [
       "integer",
       "null"
      ]
     },
     "red_cards": {
      "type": [
       "integer",
       "null"
      ]
     },
     "position": {
      "type": [
       "string",
       "null"
      ]
     },
     "shirt": {
      "type": [
       "integer",
       "null"
      ]
     },
     "season": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/SeasonLine"
       },
       {
        "type": "null"
       }
      ]
     }
    },
    "description": "One player's line in a finished match; null means the source doesn't say."
   },
   "SideProfile": {
    "type": "object",
    "required": [
     "team",
     "rating",
     "standing",
     "official",
     "form"
    ],
    "properties": {
     "team": {
      "$ref": "#/components/schemas/TeamRef"
     },
     "rating": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/RatingCard"
       },
       {
        "type": "null"
       }
      ]
     },
     "standing": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/TableRow"
       },
       {
        "type": "null"
       }
      ]
     },
     "official": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/OfficialLine"
       },
       {
        "type": "null"
       }
      ]
     },
     "form": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/FormLine"
      }
     }
    }
   },
   "ChangedRow": {
    "type": "object",
    "required": [
     "team",
     "opponent",
     "home",
     "match",
     "changes",
     "missing"
    ],
    "properties": {
     "team": {
      "$ref": "#/components/schemas/TeamRef"
     },
     "opponent": {
      "$ref": "#/components/schemas/TeamRef"
     },
     "home": {
      "type": "boolean"
     },
     "match": {
      "$ref": "#/components/schemas/MatchRow"
     },
     "changes": {
      "type": "integer"
     },
     "missing": {
      "type": "integer"
     }
    }
   },
   "Envelope": {
    "type": "object",
    "required": [
     "kind",
     "url",
     "api",
     "updated_utc",
     "attribution",
     "terms",
     "data"
    ],
    "properties": {
     "kind": {
      "type": "string"
     },
     "url": {
      "type": "string",
      "description": "The page that shows the same data: cite this."
     },
     "api": {
      "type": "string"
     },
     "updated_utc": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time",
      "description": "When the site last received data."
     },
     "attribution": {
      "type": "string",
      "description": "Credit \"Footy Ferret (footyferret.com)\" when quoting."
     },
     "terms": {
      "type": "string"
     },
     "data": {
      "type": "object"
     }
    }
   },
   "MatchData": {
    "type": "object",
    "required": [
     "match",
     "competition",
     "details",
     "stats",
     "reads",
     "sides",
     "table",
     "since_utc",
     "official",
     "meetings",
     "same_day",
     "sheets",
     "lines"
    ],
    "properties": {
     "match": {
      "$ref": "#/components/schemas/MatchRow"
     },
     "competition": {
      "$ref": "#/components/schemas/CompetitionRef"
     },
     "details": {
      "type": "object",
      "required": [
       "round",
       "venue",
       "venue_city",
       "referee",
       "home_manager",
       "away_manager",
       "home_rating_pre",
       "away_rating_pre"
      ],
      "properties": {
       "round": {
        "type": [
         "string",
         "null"
        ]
       },
       "venue": {
        "type": [
         "string",
         "null"
        ]
       },
       "venue_city": {
        "type": [
         "string",
         "null"
        ]
       },
       "referee": {
        "type": [
         "string",
         "null"
        ]
       },
       "home_manager": {
        "type": [
         "string",
         "null"
        ]
       },
       "away_manager": {
        "type": [
         "string",
         "null"
        ]
       },
       "home_rating_pre": {
        "type": [
         "number",
         "null"
        ]
       },
       "away_rating_pre": {
        "type": [
         "number",
         "null"
        ]
       }
      }
     },
     "stats": {
      "anyOf": [
       {
        "type": "object",
        "required": [
         "as_of_utc",
         "stats"
        ],
        "properties": {
         "as_of_utc": {
          "type": "string",
          "format": "date-time"
         },
         "stats": {
          "type": "object",
          "required": [
           "possession",
           "shots_on_target",
           "shots_off_target",
           "shots_blocked",
           "corners",
           "offsides",
           "fouls",
           "yellow_cards",
           "red_cards",
           "saves",
           "attacks",
           "dangerous_attacks"
          ],
          "properties": {
           "possession": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "items": {
             "type": [
              "integer",
              "null"
             ]
            },
            "description": "Home, away."
           },
           "shots_on_target": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "items": {
             "type": [
              "integer",
              "null"
             ]
            },
            "description": "Home, away."
           },
           "shots_off_target": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "items": {
             "type": [
              "integer",
              "null"
             ]
            },
            "description": "Home, away."
           },
           "shots_blocked": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "items": {
             "type": [
              "integer",
              "null"
             ]
            },
            "description": "Home, away."
           },
           "corners": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "items": {
             "type": [
              "integer",
              "null"
             ]
            },
            "description": "Home, away."
           },
           "offsides": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "items": {
             "type": [
              "integer",
              "null"
             ]
            },
            "description": "Home, away."
           },
           "fouls": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "items": {
             "type": [
              "integer",
              "null"
             ]
            },
            "description": "Home, away."
           },
           "yellow_cards": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "items": {
             "type": [
              "integer",
              "null"
             ]
            },
            "description": "Home, away."
           },
           "red_cards": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "items": {
             "type": [
              "integer",
              "null"
             ]
            },
            "description": "Home, away."
           },
           "saves": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "items": {
             "type": [
              "integer",
              "null"
             ]
            },
            "description": "Home, away."
           },
           "attacks": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "items": {
             "type": [
              "integer",
              "null"
             ]
            },
            "description": "Home, away."
           },
           "dangerous_attacks": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "items": {
             "type": [
              "integer",
              "null"
             ]
            },
            "description": "Home, away."
           }
          }
         }
        },
        "description": "Final match stats, once finished."
       },
       {
        "type": "null"
       }
      ]
     },
     "reads": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Read"
      }
     },
     "sides": {
      "type": "array",
      "minItems": 2,
      "maxItems": 2,
      "items": {
       "$ref": "#/components/schemas/SideProfile"
      },
      "description": "Home, then away."
     },
     "table": {
      "anyOf": [
       {
        "type": "array",
        "items": {
         "$ref": "#/components/schemas/TableRow"
        }
       },
       {
        "type": "null"
       }
      ]
     },
     "since_utc": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "official": {
      "anyOf": [
       {
        "type": "object",
        "required": [
         "table",
         "tables"
        ],
        "properties": {
         "table": {
          "$ref": "#/components/schemas/OfficialTable"
         },
         "tables": {
          "type": "integer"
         }
        }
       },
       {
        "type": "null"
       }
      ]
     },
     "meetings": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/MatchRow"
      },
      "description": "Earlier meetings, newest first."
     },
     "same_day": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/MatchRow"
      },
      "description": "The competition's other matches that day."
     },
     "sheets": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Lineup"
      }
     },
     "lines": {
      "type": "array",
      "minItems": 2,
      "maxItems": 2,
      "items": {
       "type": "array",
       "items": {
        "$ref": "#/components/schemas/PlayerLine"
       }
      },
      "description": "Home players, then away."
     }
    }
   },
   "MatchResponse": {
    "allOf": [
     {
      "$ref": "#/components/schemas/Envelope"
     },
     {
      "type": "object",
      "properties": {
       "data": {
        "$ref": "#/components/schemas/MatchData"
       }
      }
     }
    ]
   },
   "CompetitionData": {
    "type": "object",
    "required": [
     "competition",
     "teams",
     "table",
     "since_utc",
     "official",
     "results",
     "upcoming",
     "in_play",
     "goals",
     "cross",
     "coverage",
     "changed"
    ],
    "properties": {
     "competition": {
      "$ref": "#/components/schemas/CompetitionRef"
     },
     "teams": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/TeamLine"
      }
     },
     "table": {
      "anyOf": [
       {
        "type": "array",
        "items": {
         "$ref": "#/components/schemas/TableRow"
        }
       },
       {
        "type": "null"
       }
      ]
     },
     "since_utc": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "official": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/OfficialTable"
      }
     },
     "results": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/MatchRow"
      },
      "description": "Latest 60, newest first."
     },
     "upcoming": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/MatchRow"
      }
     },
     "in_play": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/MatchRow"
      }
     },
     "goals": {
      "type": "object",
      "required": [
       "matches",
       "goals",
       "home_wins",
       "draws",
       "away_wins",
       "home_goals",
       "away_goals",
       "both_scored",
       "over_2_5",
       "clean_sheets",
       "totals"
      ],
      "properties": {
       "matches": {
        "type": "integer"
       },
       "goals": {
        "type": "integer"
       },
       "home_wins": {
        "type": "integer"
       },
       "draws": {
        "type": "integer"
       },
       "away_wins": {
        "type": "integer"
       },
       "home_goals": {
        "type": "integer"
       },
       "away_goals": {
        "type": "integer"
       },
       "both_scored": {
        "type": "integer"
       },
       "over_2_5": {
        "type": "integer",
        "description": "Matches with three goals or more."
       },
       "clean_sheets": {
        "type": "integer"
       },
       "totals": {
        "type": "array",
        "items": {
         "type": "integer"
        },
        "description": "Matches ending with 0, 1, 2 … total goals; the last is 6 or more."
       }
      }
     },
     "cross": {
      "type": [
       "array",
       "null"
      ],
      "description": "Results grid: home teams down, away across, in table order."
     },
     "coverage": {
      "anyOf": [
       {
        "type": "object"
       },
       {
        "type": "null"
       }
      ]
     },
     "changed": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/ChangedRow"
      }
     }
    }
   },
   "CompetitionResponse": {
    "allOf": [
     {
      "$ref": "#/components/schemas/Envelope"
     },
     {
      "type": "object",
      "properties": {
       "data": {
        "$ref": "#/components/schemas/CompetitionData"
       }
      }
     }
    ]
   },
   "TeamData": {
    "type": "object",
    "required": [
     "team",
     "rating",
     "competition",
     "table",
     "standing",
     "since_utc",
     "official",
     "form",
     "results",
     "upcoming",
     "in_play",
     "squad",
     "usage",
     "sheet",
     "reads",
     "history"
    ],
    "properties": {
     "team": {
      "type": "object",
      "required": [
       "name",
       "slug",
       "short",
       "country_code",
       "gender",
       "age_group",
       "kind"
      ],
      "properties": {
       "name": {
        "type": "string"
       },
       "slug": {
        "type": "string"
       },
       "short": {
        "type": "string"
       },
       "country_code": {
        "type": [
         "string",
         "null"
        ]
       },
       "gender": {
        "type": "string"
       },
       "age_group": {
        "type": "string"
       },
       "kind": {
        "type": "string"
       }
      }
     },
     "rating": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/RatingCard"
       },
       {
        "type": "null"
       }
      ]
     },
     "competition": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/CompetitionRef"
       },
       {
        "type": "null"
       }
      ]
     },
     "table": {
      "anyOf": [
       {
        "type": "array",
        "items": {
         "$ref": "#/components/schemas/TableRow"
        }
       },
       {
        "type": "null"
       }
      ]
     },
     "standing": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/TableRow"
       },
       {
        "type": "null"
       }
      ]
     },
     "since_utc": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "official": {
      "anyOf": [
       {
        "type": "object",
        "required": [
         "table",
         "line",
         "tables"
        ],
        "properties": {
         "table": {
          "$ref": "#/components/schemas/OfficialTable"
         },
         "line": {
          "$ref": "#/components/schemas/OfficialLine"
         },
         "tables": {
          "type": "integer"
         }
        }
       },
       {
        "type": "null"
       }
      ]
     },
     "form": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/FormLine"
      },
      "description": "Every result we hold, oldest first."
     },
     "results": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/MatchRow"
      }
     },
     "upcoming": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/MatchRow"
      }
     },
     "in_play": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/MatchRow"
      }
     },
     "squad": {
      "type": "array",
      "items": {
       "type": "object"
      }
     },
     "usage": {
      "type": "object",
      "required": [
       "matches",
       "players"
      ],
      "properties": {
       "matches": {
        "type": "array",
        "items": {
         "type": "object"
        }
       },
       "players": {
        "type": "array",
        "items": {
         "type": "object"
        }
       }
      }
     },
     "sheet": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/Lineup"
       },
       {
        "type": "null"
       }
      ]
     },
     "reads": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Read"
      }
     },
     "history": {
      "type": "array",
      "items": {
       "type": "object",
       "required": [
        "date",
        "rating",
        "attack",
        "defence"
       ],
       "properties": {
        "date": {
         "type": "string"
        },
        "rating": {
         "type": "number"
        },
        "attack": {
         "type": "number"
        },
        "defence": {
         "type": "number"
        }
       }
      },
      "description": "The rating over time; each value holds until the next."
     }
    }
   },
   "TeamResponse": {
    "allOf": [
     {
      "$ref": "#/components/schemas/Envelope"
     },
     {
      "type": "object",
      "properties": {
       "data": {
        "$ref": "#/components/schemas/TeamData"
       }
      }
     }
    ]
   },
   "PlayerData": {
    "type": "object",
    "required": [
     "player",
     "appearances",
     "missed",
     "usage",
     "seasons",
     "lines"
    ],
    "properties": {
     "player": {
      "type": "object",
      "required": [
       "name",
       "current_team",
       "current_team_slug"
      ],
      "properties": {
       "name": {
        "type": "string"
       },
       "current_team": {
        "type": [
         "string",
         "null"
        ]
       },
       "current_team_slug": {
        "type": [
         "string",
         "null"
        ]
       }
      }
     },
     "appearances": {
      "type": "array",
      "items": {
       "type": "object"
      },
      "description": "Lineups named in, newest first (up to 100)."
     },
     "missed": {
      "type": "array",
      "items": {
       "type": "object"
      },
      "description": "Matches missed as a regular starter."
     },
     "usage": {
      "type": "array",
      "items": {
       "type": "object"
      }
     },
     "seasons": {
      "type": "array",
      "items": {
       "type": "object"
      },
      "description": "Season totals per team, competition and season."
     },
     "lines": {
      "type": "array",
      "items": {
       "type": "object"
      },
      "description": "Finished matches from the match record, newest first (up to 60)."
     }
    }
   },
   "PlayerResponse": {
    "allOf": [
     {
      "$ref": "#/components/schemas/Envelope"
     },
     {
      "type": "object",
      "properties": {
       "data": {
        "$ref": "#/components/schemas/PlayerData"
       }
      }
     }
    ]
   },
   "DayData": {
    "type": "object",
    "required": [
     "date",
     "previous",
     "next",
     "totals",
     "groups",
     "days"
    ],
    "properties": {
     "date": {
      "type": "string"
     },
     "previous": {
      "type": "string"
     },
     "next": {
      "type": "string"
     },
     "totals": {
      "type": "object",
      "required": [
       "matches",
       "competitions",
       "countries",
       "finished",
       "in_play",
       "scheduled",
       "awaited",
       "unconfirmed",
       "off",
       "lineups",
       "with_both"
      ],
      "properties": {
       "matches": {
        "type": "integer"
       },
       "competitions": {
        "type": "integer"
       },
       "countries": {
        "type": "integer"
       },
       "finished": {
        "type": "integer"
       },
       "in_play": {
        "type": "integer"
       },
       "scheduled": {
        "type": "integer"
       },
       "awaited": {
        "type": "integer"
       },
       "unconfirmed": {
        "type": "integer"
       },
       "off": {
        "type": "integer"
       },
       "lineups": {
        "type": "integer"
       },
       "with_both": {
        "type": "integer"
       }
      }
     },
     "groups": {
      "type": "array",
      "items": {
       "type": "object",
       "required": [
        "competition",
        "matches",
        "lineups",
        "latest_had_utc"
       ],
       "properties": {
        "competition": {
         "$ref": "#/components/schemas/CompetitionRef"
        },
        "matches": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/MatchRow"
         }
        },
        "lineups": {
         "type": "integer"
        },
        "latest_had_utc": {
         "type": [
          "string",
          "null"
         ],
         "format": "date-time"
        }
       }
      },
      "description": "Strongest competitions first."
     },
     "days": {
      "type": "array",
      "items": {
       "type": "object",
       "required": [
        "date",
        "matches"
       ],
       "properties": {
        "date": {
         "type": "string"
        },
        "matches": {
         "type": "integer"
        }
       }
      }
     }
    }
   },
   "DayResponse": {
    "allOf": [
     {
      "$ref": "#/components/schemas/Envelope"
     },
     {
      "type": "object",
      "properties": {
       "data": {
        "$ref": "#/components/schemas/DayData"
       }
      }
     }
    ]
   },
   "RankingsData": {
    "type": "object",
    "required": [
     "scale",
     "scale_name",
     "age_group",
     "teams",
     "as_of_utc",
     "rows",
     "movers",
     "scales"
    ],
    "properties": {
     "scale": {
      "type": "string"
     },
     "scale_name": {
      "type": "string"
     },
     "age_group": {
      "type": "string"
     },
     "teams": {
      "type": "integer"
     },
     "as_of_utc": {
      "type": [
       "string",
       "null"
      ]
     },
     "rows": {
      "type": "array",
      "items": {
       "type": "object",
       "required": [
        "rank",
        "team",
        "slug",
        "rating",
        "attack",
        "defence",
        "matches",
        "scale",
        "as_of_utc",
        "country_code",
        "rating_7d_ago",
        "competition",
        "competition_slug",
        "rank_7d_ago",
        "places_7d"
       ],
       "properties": {
        "rank": {
         "type": "integer"
        },
        "team": {
         "type": "string"
        },
        "slug": {
         "type": [
          "string",
          "null"
         ]
        },
        "rating": {
         "type": "number"
        },
        "attack": {
         "type": "number"
        },
        "defence": {
         "type": "number"
        },
        "matches": {
         "type": "integer"
        },
        "scale": {
         "type": "string"
        },
        "as_of_utc": {
         "type": "string",
         "format": "date-time"
        },
        "country_code": {
         "type": [
          "string",
          "null"
         ]
        },
        "rating_7d_ago": {
         "type": [
          "number",
          "null"
         ]
        },
        "competition": {
         "type": [
          "string",
          "null"
         ]
        },
        "competition_slug": {
         "type": [
          "string",
          "null"
         ]
        },
        "rank_7d_ago": {
         "type": [
          "integer",
          "null"
         ]
        },
        "places_7d": {
         "type": [
          "integer",
          "null"
         ],
         "description": "Places moved in 7 days; up is positive."
        }
       }
      },
      "description": "The top 100."
     },
     "movers": {
      "type": "object",
      "required": [
       "up",
       "down"
      ],
      "properties": {
       "up": {
        "type": "array",
        "items": {
         "type": "object"
        }
       },
       "down": {
        "type": "array",
        "items": {
         "type": "object"
        }
       }
      }
     },
     "scales": {
      "type": "array",
      "items": {
       "type": "object",
       "required": [
        "scale",
        "age_group",
        "teams",
        "updated"
       ],
       "properties": {
        "scale": {
         "type": "string"
        },
        "age_group": {
         "type": "string"
        },
        "teams": {
         "type": "integer"
        },
        "updated": {
         "type": "string"
        }
       }
      }
     }
    }
   },
   "RankingsResponse": {
    "allOf": [
     {
      "$ref": "#/components/schemas/Envelope"
     },
     {
      "type": "object",
      "properties": {
       "data": {
        "$ref": "#/components/schemas/RankingsData"
       }
      }
     }
    ]
   },
   "CompetitionsData": {
    "type": "object",
    "required": [
     "competitions"
    ],
    "properties": {
     "competitions": {
      "type": "array",
      "items": {
       "allOf": [
        {
         "$ref": "#/components/schemas/CompetitionRef"
        }
       ],
       "type": "object",
       "properties": {
        "fixtures": {
         "type": "integer"
        },
        "lineups": {
         "type": "integer"
        }
       }
      }
     }
    }
   },
   "CompetitionsResponse": {
    "allOf": [
     {
      "$ref": "#/components/schemas/Envelope"
     },
     {
      "type": "object",
      "properties": {
       "data": {
        "$ref": "#/components/schemas/CompetitionsData"
       }
      }
     }
    ]
   }
  }
 }
}