{
  "components": {
    "parameters": {
      "Date": {
        "description": "Calendar day in `YYYY-MM-DD`.",
        "in": "path",
        "name": "date",
        "required": true,
        "schema": {
          "example": "2026-08-27",
          "format": "date",
          "type": "string"
        }
      },
      "LeagueId": {
        "in": "path",
        "name": "id",
        "required": true,
        "schema": {
          "example": "l_0bfbkO",
          "type": "string"
        }
      },
      "MatchId": {
        "in": "path",
        "name": "id",
        "required": true,
        "schema": {
          "example": "m_4DP2fy",
          "type": "string"
        }
      },
      "MatchStatus": {
        "description": "Which fixtures to return. `played` covers matches that have kicked off, `upcoming` future fixtures (a kickoff `time_utc` and a `status`, but no score yet), and `all` both. Omitting the parameter is the same as `played`; sending it empty is rejected.\n",
        "in": "query",
        "name": "status",
        "required": false,
        "schema": {
          "default": "played",
          "enum": [
            "played",
            "upcoming",
            "all"
          ],
          "type": "string"
        }
      },
      "PlayerId": {
        "in": "path",
        "name": "pid",
        "required": true,
        "schema": {
          "example": "p_7Yb1",
          "type": "string"
        }
      },
      "PlayerProfileId": {
        "in": "path",
        "name": "id",
        "required": true,
        "schema": {
          "example": "p_7Yb1",
          "type": "string"
        }
      },
      "ShotId": {
        "in": "path",
        "name": "sid",
        "required": true,
        "schema": {
          "example": "s_9Xk2",
          "type": "string"
        }
      },
      "TeamId": {
        "in": "path",
        "name": "id",
        "required": true,
        "schema": {
          "example": "t_9aB2xQ",
          "type": "string"
        }
      }
    },
    "responses": {
      "InvalidParameter": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        },
        "description": "A malformed ID, date, or season (`INVALID_PARAMETER`)."
      },
      "NotFound": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        },
        "description": "Resource does not exist (`RESOURCE_NOT_FOUND`), analytics not yet computed (`ANALYTICS_UNAVAILABLE`), or no per-half player stats for the match (`HALVES_UNAVAILABLE`)."
      },
      "PlanUpgradeRequired": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        },
        "description": "The resource is not on the caller's plan (`PLAN_UPGRADE_REQUIRED`).\n\nThe free plan reads the current season and the one before it, per\ncompetition, plus anything newer (published fixtures). Asking for an\nolder season answers 403 here, and the message names the season that\nwas refused and the oldest one that is free. Webhooks need Pro, bulk\nexports need Data, and the live push stream needs Pro.\n"
      },
      "RateLimited": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        },
        "description": "A rate or allowance guard was hit (`RATE_LIMIT_EXCEEDED` or, on the free plan, `DAILY_QUOTA_EXCEEDED`).",
        "headers": {
          "Retry-After": {
            "description": "Seconds to wait before retrying. For a daily quota this is the seconds until 00:00 UTC.",
            "schema": {
              "type": "integer"
            }
          },
          "X-Quota-Limit": {
            "description": "Daily request allowance for the key's plan. Omitted on unlimited plans.",
            "schema": {
              "type": "integer"
            }
          },
          "X-Quota-Remaining": {
            "description": "Requests left in the current UTC day.",
            "schema": {
              "type": "integer"
            }
          },
          "X-Quota-Reset": {
            "description": "Seconds until the daily allowance resets.",
            "schema": {
              "type": "integer"
            }
          }
        }
      },
      "Unauthorized": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        },
        "description": "Missing, malformed, or revoked key (`UNAUTHORIZED`), or a suspended subscription (`SUBSCRIPTION_SUSPENDED`)."
      }
    },
    "schemas": {
      "AdvancedNetworks": {
        "properties": {
          "match_id": {
            "type": "string"
          },
          "networks": {
            "items": {
              "$ref": "#/components/schemas/PassNetwork"
            },
            "type": "array"
          }
        },
        "required": [
          "match_id",
          "networks"
        ],
        "type": "object"
      },
      "AdvancedPlayerRef": {
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "shirt_number": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "AdvancedPlayerStat": {
        "properties": {
          "actions": {
            "type": "integer"
          },
          "carrying": {
            "$ref": "#/components/schemas/CarryingStats"
          },
          "creation": {
            "$ref": "#/components/schemas/PlayerCreation"
          },
          "defending": {
            "$ref": "#/components/schemas/PlayerDefending"
          },
          "goalkeeping": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Goalkeeping"
              },
              {
                "type": "null"
              }
            ]
          },
          "minutes_played": {
            "type": [
              "integer",
              "null"
            ]
          },
          "passing": {
            "$ref": "#/components/schemas/PassingStats"
          },
          "player": {
            "$ref": "#/components/schemas/AdvancedPlayerRef"
          },
          "possession_value": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/PossessionValue"
              },
              {
                "type": "null"
              }
            ]
          },
          "team_id": {
            "type": "string"
          }
        },
        "required": [
          "player",
          "team_id",
          "actions"
        ],
        "type": "object"
      },
      "AdvancedPlayers": {
        "properties": {
          "match_id": {
            "type": "string"
          },
          "players": {
            "items": {
              "$ref": "#/components/schemas/AdvancedPlayerStat"
            },
            "type": "array"
          },
          "sorted_by": {
            "description": "Ordering used; falls back to \"actions\" when VAEP did not run.",
            "type": "string"
          }
        },
        "required": [
          "match_id",
          "sorted_by",
          "players"
        ],
        "type": "object"
      },
      "AdvancedTeamStat": {
        "properties": {
          "actions": {
            "type": "integer"
          },
          "carrying": {
            "$ref": "#/components/schemas/CarryingStats"
          },
          "creation": {
            "$ref": "#/components/schemas/TeamCreation"
          },
          "defending": {
            "$ref": "#/components/schemas/TeamDefending"
          },
          "passing": {
            "$ref": "#/components/schemas/PassingStats"
          },
          "possession_value": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/PossessionValue"
              },
              {
                "type": "null"
              }
            ]
          },
          "team": {
            "$ref": "#/components/schemas/TeamNameRef"
          },
          "tempo": {
            "$ref": "#/components/schemas/TempoStats"
          },
          "territory": {
            "$ref": "#/components/schemas/TerritoryStats"
          }
        },
        "required": [
          "team",
          "actions"
        ],
        "type": "object"
      },
      "AdvancedTeams": {
        "properties": {
          "match_id": {
            "type": "string"
          },
          "teams": {
            "items": {
              "$ref": "#/components/schemas/AdvancedTeamStat"
            },
            "type": "array"
          }
        },
        "required": [
          "match_id",
          "teams"
        ],
        "type": "object"
      },
      "CarryingStats": {
        "properties": {
          "carries": {
            "type": "integer"
          },
          "carries_into_box": {
            "type": "integer"
          },
          "carries_into_final_third": {
            "type": "integer"
          },
          "carry_distance": {
            "type": "number"
          },
          "dispossessed": {
            "type": "integer"
          },
          "miscontrols": {
            "type": "integer"
          },
          "progressive_carries": {
            "type": "integer"
          },
          "progressive_carry_distance": {
            "type": "number"
          },
          "take_ons": {
            "type": "integer"
          },
          "take_ons_won": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "CoachRef": {
        "properties": {
          "name": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "DateMatches": {
        "properties": {
          "date": {
            "format": "date",
            "type": "string"
          },
          "matches": {
            "items": {
              "$ref": "#/components/schemas/MatchSummary"
            },
            "type": "array"
          }
        },
        "required": [
          "date",
          "matches"
        ],
        "type": "object"
      },
      "ErrorEnvelope": {
        "properties": {
          "error": {
            "properties": {
              "code": {
                "enum": [
                  "INVALID_PARAMETER",
                  "UNAUTHORIZED",
                  "SUBSCRIPTION_SUSPENDED",
                  "PLAN_UPGRADE_REQUIRED",
                  "RESOURCE_NOT_FOUND",
                  "ANALYTICS_UNAVAILABLE",
                  "HALVES_UNAVAILABLE",
                  "RATE_LIMIT_EXCEEDED",
                  "DAILY_QUOTA_EXCEEDED",
                  "INTERNAL_SERVER_ERROR"
                ],
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "type": "object"
          }
        },
        "required": [
          "error"
        ],
        "type": "object"
      },
      "Event": {
        "properties": {
          "event_type": {
            "type": "string"
          },
          "is_own_goal": {
            "type": "boolean"
          },
          "is_penalty": {
            "type": "boolean"
          },
          "minute": {
            "type": "integer"
          },
          "minute_added": {
            "type": "integer"
          },
          "period": {
            "type": "string"
          },
          "player": {
            "$ref": "#/components/schemas/PlayerRef"
          },
          "score_away": {
            "type": [
              "integer",
              "null"
            ]
          },
          "score_home": {
            "type": [
              "integer",
              "null"
            ]
          },
          "sub_in_player": {
            "$ref": "#/components/schemas/PlayerRef"
          },
          "team_id": {
            "type": "string"
          }
        },
        "required": [
          "event_type",
          "minute",
          "minute_added",
          "period",
          "is_own_goal",
          "is_penalty"
        ],
        "type": "object"
      },
      "Events": {
        "properties": {
          "events": {
            "items": {
              "$ref": "#/components/schemas/Event"
            },
            "type": "array"
          },
          "match_id": {
            "type": "string"
          }
        },
        "required": [
          "match_id",
          "events"
        ],
        "type": "object"
      },
      "ExportJob": {
        "properties": {
          "bytes": {
            "nullable": true,
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "dataset": {
            "type": "string"
          },
          "download_url": {
            "description": "Signed link, present only while the file exists. Valid for fifteen minutes.",
            "type": "string"
          },
          "error": {
            "nullable": true,
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "finished_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "format": {
            "enum": [
              "ndjson",
              "parquet"
            ],
            "type": "string"
          },
          "id": {
            "example": "ex_T4nV8s",
            "type": "string"
          },
          "row_count": {
            "nullable": true,
            "type": "integer"
          },
          "sha256": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "enum": [
              "queued",
              "running",
              "ready",
              "failed",
              "expired"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "dataset",
          "format",
          "status",
          "row_count",
          "bytes",
          "sha256",
          "error",
          "created_at",
          "finished_at",
          "expires_at"
        ],
        "type": "object"
      },
      "Goalkeeping": {
        "description": "Present only for the two starting keepers.",
        "properties": {
          "avg_pass_length": {
            "type": [
              "number",
              "null"
            ]
          },
          "claim_rate": {
            "type": [
              "number",
              "null"
            ]
          },
          "claims": {
            "type": "integer"
          },
          "claims_won": {
            "type": "integer"
          },
          "distribution_accuracy": {
            "type": [
              "number",
              "null"
            ]
          },
          "distributions": {
            "type": "integer"
          },
          "launch_pct": {
            "type": [
              "number",
              "null"
            ]
          },
          "launches": {
            "type": "integer"
          },
          "sweeper_actions": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "H2H": {
        "properties": {
          "away_team": {
            "$ref": "#/components/schemas/TeamRef"
          },
          "away_wins": {
            "type": "integer"
          },
          "draws": {
            "type": "integer"
          },
          "home_team": {
            "$ref": "#/components/schemas/TeamRef"
          },
          "home_wins": {
            "type": "integer"
          },
          "match_id": {
            "type": "string"
          },
          "recent_matches": {
            "items": {
              "$ref": "#/components/schemas/H2HMatch"
            },
            "type": "array"
          },
          "total_matches": {
            "type": "integer"
          }
        },
        "required": [
          "match_id",
          "home_team",
          "away_team",
          "home_wins",
          "draws",
          "away_wins",
          "total_matches",
          "recent_matches"
        ],
        "type": "object"
      },
      "H2HMatch": {
        "properties": {
          "away": {
            "$ref": "#/components/schemas/TeamRef"
          },
          "finished": {
            "type": "boolean"
          },
          "home": {
            "$ref": "#/components/schemas/TeamRef"
          },
          "score_away": {
            "type": [
              "integer",
              "null"
            ]
          },
          "score_home": {
            "type": [
              "integer",
              "null"
            ]
          },
          "time_utc": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "home",
          "away",
          "finished"
        ],
        "type": "object"
      },
      "HeatmapCells": {
        "description": "Sparse [cell_x, cell_y, actions] triples. A cell with no activity is absent rather than zero, which is most of the 192 — expand to a dense grid client-side if you need one. Empty array, never null.",
        "items": {
          "items": {
            "type": "integer"
          },
          "maxItems": 3,
          "minItems": 3,
          "type": "array"
        },
        "type": "array"
      },
      "HeatmapGrid": {
        "description": "The frame the cells are counted in. Without it the cells are unreadable: cell_x 0 is not \"the left end of the pitch\", it is the acting team's own goal line, in both halves.",
        "properties": {
          "cell_length_m": {
            "description": "Cell length in metres on the 105 x 68 pitch.",
            "type": "number"
          },
          "cell_width_m": {
            "description": "Cell width in metres.",
            "type": "number"
          },
          "frame": {
            "description": "The orientation actually served, echoed so a response is self-describing whether or not the request named one. In `acting_ltr`, cell_x 0 is the acting team's own goal line and 15 the opponent's, for both teams and in both halves — the same direction normalisation the shot coordinates use. In `home_ltr` the away side's cells are already turned onto the shared pitch.",
            "enum": [
              "acting_ltr",
              "home_ltr"
            ],
            "type": "string"
          },
          "length": {
            "description": "Cells from goal line to goal line. Always 16.",
            "type": "integer"
          },
          "width": {
            "description": "Cells from touchline to touchline. Always 12.",
            "type": "integer"
          }
        },
        "required": [
          "length",
          "width",
          "frame",
          "cell_length_m",
          "cell_width_m"
        ],
        "type": "object"
      },
      "League": {
        "properties": {
          "country_code": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "image_url": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "season": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "country_code",
          "season"
        ],
        "type": "object"
      },
      "LeagueMatchSummary": {
        "properties": {
          "away_team": {
            "$ref": "#/components/schemas/TeamRef"
          },
          "date": {
            "type": [
              "string",
              "null"
            ]
          },
          "home_team": {
            "$ref": "#/components/schemas/TeamRef"
          },
          "id": {
            "type": "string"
          },
          "score_away": {
            "type": [
              "integer",
              "null"
            ]
          },
          "score_home": {
            "type": [
              "integer",
              "null"
            ]
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          },
          "time_utc": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "home_team",
          "away_team"
        ],
        "type": "object"
      },
      "LeagueMatches": {
        "properties": {
          "league": {
            "$ref": "#/components/schemas/LeagueSeasonRef"
          },
          "matches": {
            "items": {
              "$ref": "#/components/schemas/LeagueMatchSummary"
            },
            "type": "array"
          }
        },
        "required": [
          "league",
          "matches"
        ],
        "type": "object"
      },
      "LeagueRef": {
        "properties": {
          "id": {
            "type": "string"
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "LeagueSeasonRef": {
        "properties": {
          "id": {
            "type": "string"
          },
          "image_url": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "season": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "season"
        ],
        "type": "object"
      },
      "LeagueSummary": {
        "properties": {
          "country_code": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_free": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "seasons": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "name",
          "country_code",
          "is_free",
          "seasons"
        ],
        "type": "object"
      },
      "LineupPlayer": {
        "properties": {
          "is_captain": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "pitch_x": {
            "type": "number"
          },
          "pitch_y": {
            "type": "number"
          },
          "player_id": {
            "type": "string"
          },
          "position_id": {
            "type": "integer"
          },
          "shirt_number": {
            "type": "string"
          }
        },
        "required": [
          "player_id",
          "name",
          "shirt_number",
          "position_id",
          "is_captain",
          "pitch_x",
          "pitch_y"
        ],
        "type": "object"
      },
      "LineupSide": {
        "properties": {
          "coach": {
            "$ref": "#/components/schemas/CoachRef"
          },
          "confirmed": {
            "description": "False while this is the pre-match predicted lineup, true once the real one is published. Branch on this before trusting an upcoming fixture's XI.\n",
            "type": "boolean"
          },
          "formation": {
            "type": "string"
          },
          "lineup_type": {
            "description": "The source's own label for a prediction, e.g. `lastStarting11`. Omitted entirely for a confirmed lineup.\n",
            "example": "lastStarting11",
            "type": "string"
          },
          "starters": {
            "items": {
              "$ref": "#/components/schemas/LineupPlayer"
            },
            "type": "array"
          },
          "subs": {
            "items": {
              "$ref": "#/components/schemas/LineupPlayer"
            },
            "type": "array"
          }
        },
        "required": [
          "formation",
          "confirmed",
          "starters",
          "subs"
        ],
        "type": "object"
      },
      "Lineups": {
        "properties": {
          "away": {
            "$ref": "#/components/schemas/LineupSide"
          },
          "away_team": {
            "$ref": "#/components/schemas/TeamRef"
          },
          "home": {
            "$ref": "#/components/schemas/LineupSide"
          },
          "home_team": {
            "$ref": "#/components/schemas/TeamRef"
          },
          "match_id": {
            "type": "string"
          }
        },
        "required": [
          "match_id",
          "home_team",
          "away_team",
          "home",
          "away"
        ],
        "type": "object"
      },
      "LiveClock": {
        "properties": {
          "added": {
            "description": "Stoppage minutes added to the current one.",
            "type": "integer"
          },
          "display": {
            "description": "The minute as a caller should print it, such as 67' or 90+3'.",
            "type": "string"
          },
          "elapsed_seconds": {
            "type": "integer"
          },
          "minute": {
            "type": "integer"
          },
          "period": {
            "description": "First-half, second-half or extra-time marker, such as 1H, 2H or HT.",
            "type": "string"
          }
        },
        "required": [
          "period",
          "minute",
          "added",
          "display",
          "elapsed_seconds"
        ],
        "type": "object"
      },
      "LiveEvent": {
        "properties": {
          "added": {
            "type": "integer"
          },
          "assist": {
            "$ref": "#/components/schemas/LivePlayerRef"
          },
          "detail": {
            "type": [
              "string",
              "null"
            ]
          },
          "minute": {
            "type": "integer"
          },
          "player": {
            "$ref": "#/components/schemas/LivePlayerRef"
          },
          "player_in": {
            "$ref": "#/components/schemas/LivePlayerRef"
          },
          "player_out": {
            "$ref": "#/components/schemas/LivePlayerRef"
          },
          "score_away": {
            "type": [
              "integer",
              "null"
            ]
          },
          "score_home": {
            "type": [
              "integer",
              "null"
            ]
          },
          "team_id": {
            "type": "string"
          },
          "type": {
            "description": "goal, own_goal, penalty, yellow_card, red_card, second_yellow or substitution.",
            "type": "string"
          }
        },
        "required": [
          "type",
          "minute",
          "added"
        ],
        "type": "object"
      },
      "LiveLineupSide": {
        "properties": {
          "coach": {
            "$ref": "#/components/schemas/LivePlayerRef"
          },
          "confirmed": {
            "type": "boolean"
          },
          "formation": {
            "type": [
              "string",
              "null"
            ]
          },
          "lineup_type": {
            "description": "The source's own label for a predicted lineup; absent on a confirmed one.",
            "type": "string"
          },
          "starters": {
            "items": {
              "$ref": "#/components/schemas/LivePlayer"
            },
            "type": "array"
          },
          "subs": {
            "items": {
              "$ref": "#/components/schemas/LivePlayer"
            },
            "type": "array"
          }
        },
        "required": [
          "confirmed",
          "starters",
          "subs"
        ],
        "type": "object"
      },
      "LiveLineups": {
        "properties": {
          "away": {
            "$ref": "#/components/schemas/LiveLineupSide"
          },
          "home": {
            "$ref": "#/components/schemas/LiveLineupSide"
          }
        },
        "required": [
          "home",
          "away"
        ],
        "type": "object"
      },
      "LiveOnPitch": {
        "properties": {
          "away": {
            "items": {
              "$ref": "#/components/schemas/LivePlayer"
            },
            "type": "array"
          },
          "home": {
            "items": {
              "$ref": "#/components/schemas/LivePlayer"
            },
            "type": "array"
          }
        },
        "required": [
          "home",
          "away"
        ],
        "type": "object"
      },
      "LivePlayer": {
        "properties": {
          "is_captain": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "player_id": {
            "type": "string"
          },
          "position_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "red_card_minute": {
            "type": [
              "integer",
              "null"
            ]
          },
          "shirt_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "stats": {
            "description": "The player's stat line so far, on lineup entries only.",
            "items": {
              "$ref": "#/components/schemas/LivePlayerStat"
            },
            "type": "array"
          },
          "status": {
            "description": "One of on_pitch, bench, subbed_off or sent_off.",
            "type": "string"
          },
          "subbed_off_minute": {
            "type": [
              "integer",
              "null"
            ]
          },
          "subbed_on_minute": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "shirt_number",
          "position_id",
          "is_captain",
          "status",
          "subbed_off_minute",
          "subbed_on_minute",
          "red_card_minute"
        ],
        "type": "object"
      },
      "LivePlayerRef": {
        "properties": {
          "name": {
            "type": "string"
          },
          "player_id": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "LivePlayerStat": {
        "properties": {
          "key": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "total": {
            "type": "integer"
          },
          "type": {
            "type": "string"
          },
          "value": {
            "type": "number"
          }
        },
        "required": [
          "key",
          "title",
          "type",
          "value"
        ],
        "type": "object"
      },
      "LiveSnapshot": {
        "properties": {
          "age_seconds": {
            "type": [
              "integer",
              "null"
            ]
          },
          "away_team": {
            "$ref": "#/components/schemas/LiveTeam"
          },
          "clock": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LiveClock"
              },
              {
                "type": "null"
              }
            ]
          },
          "events": {
            "items": {
              "$ref": "#/components/schemas/LiveEvent"
            },
            "type": "array"
          },
          "fetched_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "home_team": {
            "$ref": "#/components/schemas/LiveTeam"
          },
          "lineups": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LiveLineups"
              },
              {
                "type": "null"
              }
            ]
          },
          "live": {
            "description": "True only while the match is inside its live window.",
            "type": "boolean"
          },
          "match_id": {
            "type": "string"
          },
          "on_pitch": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LiveOnPitch"
              },
              {
                "type": "null"
              }
            ]
          },
          "score_away": {
            "type": [
              "integer",
              "null"
            ]
          },
          "score_home": {
            "type": [
              "integer",
              "null"
            ]
          },
          "stale": {
            "description": "True when the snapshot is being served while a fresher one is fetched.",
            "type": "boolean"
          },
          "stats": {
            "items": {
              "$ref": "#/components/schemas/LiveStat"
            },
            "type": "array"
          },
          "stats_halves": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LiveStatsHalves"
              },
              {
                "type": "null"
              }
            ],
            "description": "Team stats of each half, where they are split; the second half appears once it has begun."
          },
          "status": {
            "enum": [
              "not_started",
              "started",
              "finished"
            ],
            "type": "string"
          }
        },
        "required": [
          "match_id",
          "status",
          "live",
          "score_home",
          "score_away",
          "home_team",
          "away_team",
          "events",
          "stats",
          "fetched_at",
          "age_seconds",
          "stale"
        ],
        "type": "object"
      },
      "LiveStat": {
        "properties": {
          "away": {
            "type": "string"
          },
          "format_type": {
            "type": "string"
          },
          "group": {
            "type": "string"
          },
          "home": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "group",
          "key",
          "title",
          "home",
          "away",
          "format_type"
        ],
        "type": "object"
      },
      "LiveStatsHalves": {
        "properties": {
          "first": {
            "items": {
              "$ref": "#/components/schemas/LiveStat"
            },
            "type": "array"
          },
          "second": {
            "items": {
              "$ref": "#/components/schemas/LiveStat"
            },
            "type": "array"
          }
        },
        "required": [
          "first"
        ],
        "type": "object"
      },
      "LiveTeam": {
        "properties": {
          "id": {
            "type": "string"
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "image_url"
        ],
        "type": "object"
      },
      "Match": {
        "properties": {
          "away_team": {
            "$ref": "#/components/schemas/TeamRef"
          },
          "date": {
            "type": [
              "string",
              "null"
            ]
          },
          "has_playoff": {
            "type": "boolean"
          },
          "home_team": {
            "$ref": "#/components/schemas/TeamRef"
          },
          "id": {
            "type": "string"
          },
          "league": {
            "$ref": "#/components/schemas/LeagueRef"
          },
          "referee": {
            "type": [
              "string",
              "null"
            ]
          },
          "round_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "score_away": {
            "type": [
              "integer",
              "null"
            ]
          },
          "score_home": {
            "type": [
              "integer",
              "null"
            ]
          },
          "season": {
            "description": "Season of this match",
            "distinct from the league's current season.": null,
            "type": [
              "string",
              "null"
            ]
          },
          "stadium": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          },
          "time_utc": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "league",
          "home_team",
          "away_team",
          "has_playoff"
        ],
        "type": "object"
      },
      "MatchHeatmaps": {
        "description": "Binned activity for one match: each team's own grid plus one grid per player who touched the ball. Match level only — there is no season or cross-match aggregate behind this.",
        "properties": {
          "grid": {
            "$ref": "#/components/schemas/HeatmapGrid"
          },
          "match_id": {
            "type": "string"
          },
          "players": {
            "description": "Ordered by involvement, busiest first.",
            "items": {
              "$ref": "#/components/schemas/PlayerHeatmap"
            },
            "type": "array"
          },
          "teams": {
            "description": "Both teams, home first.",
            "items": {
              "$ref": "#/components/schemas/TeamHeatmap"
            },
            "type": "array"
          }
        },
        "required": [
          "match_id",
          "grid",
          "teams",
          "players"
        ],
        "type": "object"
      },
      "MatchPlayerHalves": {
        "properties": {
          "match_id": {
            "type": "string"
          },
          "players": {
            "items": {
              "$ref": "#/components/schemas/PlayerHalves"
            },
            "type": "array"
          }
        },
        "required": [
          "match_id",
          "players"
        ],
        "type": "object"
      },
      "MatchStatGroup": {
        "properties": {
          "group_name": {
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/MatchStatItem"
            },
            "type": "array"
          }
        },
        "required": [
          "group_name",
          "items"
        ],
        "type": "object"
      },
      "MatchStatItem": {
        "properties": {
          "away": {
            "type": "string"
          },
          "format_type": {
            "type": "string"
          },
          "home": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "title",
          "key",
          "home",
          "away",
          "format_type"
        ],
        "type": "object"
      },
      "MatchStatPeriod": {
        "properties": {
          "groups": {
            "items": {
              "$ref": "#/components/schemas/MatchStatGroup"
            },
            "type": "array"
          },
          "period": {
            "type": "string"
          }
        },
        "required": [
          "period",
          "groups"
        ],
        "type": "object"
      },
      "MatchStats": {
        "properties": {
          "away_team": {
            "$ref": "#/components/schemas/TeamRef"
          },
          "home_team": {
            "$ref": "#/components/schemas/TeamRef"
          },
          "match_id": {
            "type": "string"
          },
          "periods": {
            "items": {
              "$ref": "#/components/schemas/MatchStatPeriod"
            },
            "type": "array"
          }
        },
        "required": [
          "match_id",
          "home_team",
          "away_team",
          "periods"
        ],
        "type": "object"
      },
      "MatchSummary": {
        "properties": {
          "away_team": {
            "$ref": "#/components/schemas/TeamRef"
          },
          "home_team": {
            "$ref": "#/components/schemas/TeamRef"
          },
          "id": {
            "type": "string"
          },
          "league": {
            "$ref": "#/components/schemas/LeagueRef"
          },
          "score_away": {
            "type": [
              "integer",
              "null"
            ]
          },
          "score_home": {
            "type": [
              "integer",
              "null"
            ]
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          },
          "time_utc": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "league",
          "home_team",
          "away_team"
        ],
        "type": "object"
      },
      "Momentum": {
        "description": "The momentum timeline. Matches from the 33 leagues served without one have none: points is an empty array.\n",
        "properties": {
          "match_id": {
            "type": "string"
          },
          "points": {
            "items": {
              "$ref": "#/components/schemas/MomentumPoint"
            },
            "type": "array"
          }
        },
        "required": [
          "match_id",
          "points"
        ],
        "type": "object"
      },
      "MomentumPoint": {
        "properties": {
          "minute": {
            "type": "number"
          },
          "value": {
            "type": "number"
          }
        },
        "required": [
          "minute",
          "value"
        ],
        "type": "object"
      },
      "NetworkWindow": {
        "properties": {
          "kind": {
            "type": "string"
          },
          "until_seconds": {
            "description": "Null when the network covers the full match.",
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "kind"
        ],
        "type": "object"
      },
      "PassNetwork": {
        "properties": {
          "centralization": {
            "description": "Null when the graph had no edges.",
            "type": [
              "number",
              "null"
            ]
          },
          "edges": {
            "items": {
              "$ref": "#/components/schemas/PassNetworkEdge"
            },
            "type": "array"
          },
          "nodes": {
            "items": {
              "$ref": "#/components/schemas/PassNetworkNode"
            },
            "type": "array"
          },
          "team": {
            "$ref": "#/components/schemas/TeamNameRef"
          },
          "window": {
            "$ref": "#/components/schemas/NetworkWindow"
          }
        },
        "required": [
          "team",
          "window",
          "nodes",
          "edges"
        ],
        "type": "object"
      },
      "PassNetworkEdge": {
        "properties": {
          "from": {
            "$ref": "#/components/schemas/AdvancedPlayerRef"
          },
          "passes": {
            "type": "integer"
          },
          "to": {
            "$ref": "#/components/schemas/AdvancedPlayerRef"
          }
        },
        "required": [
          "from",
          "to",
          "passes"
        ],
        "type": "object"
      },
      "PassNetworkNode": {
        "properties": {
          "avg_x": {
            "description": "Mean location the player passed FROM.",
            "type": [
              "number",
              "null"
            ]
          },
          "avg_y": {
            "type": [
              "number",
              "null"
            ]
          },
          "betweenness": {
            "type": [
              "number",
              "null"
            ]
          },
          "clustering": {
            "type": [
              "number",
              "null"
            ]
          },
          "degree": {
            "type": [
              "integer",
              "null"
            ]
          },
          "passes": {
            "type": "integer"
          },
          "passes_received": {
            "type": "integer"
          },
          "player": {
            "$ref": "#/components/schemas/AdvancedPlayerRef"
          },
          "strength": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "player",
          "passes",
          "passes_received"
        ],
        "type": "object"
      },
      "PassingStats": {
        "description": "`passes` already includes `crosses`; never sum the two.",
        "properties": {
          "assists": {
            "type": "integer"
          },
          "crosses": {
            "type": "integer"
          },
          "key_passes": {
            "type": "integer"
          },
          "pass_accuracy": {
            "type": [
              "number",
              "null"
            ]
          },
          "passes": {
            "type": "integer"
          },
          "passes_into_box": {
            "type": "integer"
          },
          "progressive_pass_distance": {
            "type": "number"
          },
          "progressive_passes": {
            "type": "integer"
          },
          "switches": {
            "type": "integer"
          },
          "through_balls": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PlayerCreation": {
        "properties": {
          "chances_created": {
            "type": "integer"
          },
          "gca": {
            "type": "integer"
          },
          "sca": {
            "type": "integer"
          },
          "sca_breakdown": {
            "$ref": "#/components/schemas/PlayerSCABreakdown"
          },
          "second_assists": {
            "type": "integer"
          },
          "xag": {
            "description": "xG of shots this player's passes created (not xA).",
            "type": [
              "number",
              "null"
            ]
          },
          "xg_buildup": {
            "description": "Always <= xg_chain.",
            "type": [
              "number",
              "null"
            ]
          },
          "xg_chain": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "PlayerDefending": {
        "properties": {
          "aerials": {
            "type": "integer"
          },
          "aerials_won": {
            "type": "integer"
          },
          "blocks": {
            "type": "integer"
          },
          "clearances": {
            "type": "integer"
          },
          "duels_won": {
            "type": "integer"
          },
          "interceptions": {
            "type": "integer"
          },
          "tackles": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PlayerDetail": {
        "properties": {
          "player": {
            "$ref": "#/components/schemas/PlayerRef"
          },
          "position_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "stats": {
            "additionalProperties": true,
            "type": "object"
          },
          "team_id": {
            "type": "string"
          }
        },
        "required": [
          "player",
          "team_id",
          "stats"
        ],
        "type": "object"
      },
      "PlayerHalfDetail": {
        "properties": {
          "match_id": {
            "type": "string"
          },
          "periods": {
            "items": {
              "$ref": "#/components/schemas/PlayerHalfStats"
            },
            "type": "array"
          },
          "player": {
            "$ref": "#/components/schemas/PlayerRef"
          },
          "team_id": {
            "type": "string"
          }
        },
        "required": [
          "match_id",
          "player",
          "team_id",
          "periods"
        ],
        "type": "object"
      },
      "PlayerHalfStats": {
        "properties": {
          "period": {
            "enum": [
              "FirstHalf",
              "SecondHalf"
            ],
            "type": "string"
          },
          "stats": {
            "description": "The half's stat line, grouped as in PlayerMatchStats.",
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "period",
          "stats"
        ],
        "type": "object"
      },
      "PlayerHalves": {
        "properties": {
          "periods": {
            "description": "Only the halves the player took part in, first half first.",
            "items": {
              "$ref": "#/components/schemas/PlayerHalfStats"
            },
            "type": "array"
          },
          "player": {
            "$ref": "#/components/schemas/PlayerRef"
          },
          "team_id": {
            "type": "string"
          }
        },
        "required": [
          "player",
          "team_id",
          "periods"
        ],
        "type": "object"
      },
      "PlayerHeatmap": {
        "properties": {
          "actions": {
            "description": "A raw count for the match, not per-90. A substitute's grid is thinner than a starter's for reasons that are about minutes rather than involvement.",
            "type": "integer"
          },
          "cells": {
            "$ref": "#/components/schemas/HeatmapCells"
          },
          "player": {
            "$ref": "#/components/schemas/AdvancedPlayerRef"
          },
          "side": {
            "description": "The player's team's side, repeated so a caller iterating players alone can orient them.",
            "enum": [
              "home",
              "away"
            ],
            "type": "string"
          },
          "team": {
            "$ref": "#/components/schemas/TeamNameRef"
          }
        },
        "required": [
          "player",
          "team",
          "side",
          "actions",
          "cells"
        ],
        "type": "object"
      },
      "PlayerMatchStats": {
        "properties": {
          "player": {
            "$ref": "#/components/schemas/PlayerRef"
          },
          "stats": {
            "additionalProperties": true,
            "description": "Raw stat line; shape varies by position.",
            "type": "object"
          },
          "team_id": {
            "type": "string"
          }
        },
        "required": [
          "player",
          "team_id",
          "stats"
        ],
        "type": "object"
      },
      "PlayerProfile": {
        "properties": {
          "country_code": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "image_url": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "position_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "shirt_number": {
            "type": "string"
          },
          "short_name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "PlayerRef": {
        "properties": {
          "id": {
            "type": "string"
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "position_id": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "PlayerSCABreakdown": {
        "properties": {
          "defensive": {
            "type": "integer"
          },
          "pass_dead": {
            "type": "integer"
          },
          "pass_live": {
            "type": "integer"
          },
          "shot": {
            "type": "integer"
          },
          "take_on": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PlayerShots": {
        "properties": {
          "player": {
            "$ref": "#/components/schemas/PlayerRef"
          },
          "shots": {
            "items": {
              "$ref": "#/components/schemas/Shot"
            },
            "type": "array"
          }
        },
        "required": [
          "player",
          "shots"
        ],
        "type": "object"
      },
      "PossessionValue": {
        "description": "Null as a whole object when no model ran; members omitted when their model did not run.",
        "properties": {
          "pv_defensive": {
            "type": [
              "number",
              "null"
            ]
          },
          "pv_offensive": {
            "type": [
              "number",
              "null"
            ]
          },
          "pv_total": {
            "type": [
              "number",
              "null"
            ]
          },
          "vaep_defensive": {
            "type": [
              "number",
              "null"
            ]
          },
          "vaep_offensive": {
            "type": [
              "number",
              "null"
            ]
          },
          "vaep_total": {
            "type": [
              "number",
              "null"
            ]
          },
          "xt_total": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "Shot": {
        "properties": {
          "blocked_x": {
            "type": [
              "number",
              "null"
            ]
          },
          "blocked_y": {
            "type": [
              "number",
              "null"
            ]
          },
          "event_type": {
            "type": "string"
          },
          "expected_goals": {
            "type": "number"
          },
          "expected_goals_on_target": {
            "type": [
              "number",
              "null"
            ]
          },
          "goal_crossed_y": {
            "type": [
              "number",
              "null"
            ]
          },
          "goal_crossed_z": {
            "type": [
              "number",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "is_blocked": {
            "type": "boolean"
          },
          "is_inside_box": {
            "type": "boolean"
          },
          "is_on_target": {
            "type": "boolean"
          },
          "is_own_goal": {
            "type": "boolean"
          },
          "is_saved_off_line": {
            "type": "boolean"
          },
          "keeper": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/PlayerRef"
              },
              {
                "type": "null"
              }
            ]
          },
          "minute": {
            "type": "integer"
          },
          "minute_added": {
            "type": [
              "integer",
              "null"
            ]
          },
          "player": {
            "$ref": "#/components/schemas/PlayerRef"
          },
          "shot_type": {
            "type": "string"
          },
          "situation": {
            "type": "string"
          },
          "team_id": {
            "type": "string"
          },
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "player",
          "team_id",
          "x",
          "y",
          "expected_goals",
          "is_on_target",
          "is_inside_box",
          "shot_type",
          "situation",
          "minute",
          "event_type"
        ],
        "type": "object"
      },
      "ShotPeriod": {
        "properties": {
          "period": {
            "type": "string"
          },
          "shots": {
            "items": {
              "$ref": "#/components/schemas/Shot"
            },
            "type": "array"
          }
        },
        "required": [
          "period",
          "shots"
        ],
        "type": "object"
      },
      "Shots": {
        "properties": {
          "match_id": {
            "type": "string"
          },
          "periods": {
            "items": {
              "$ref": "#/components/schemas/ShotPeriod"
            },
            "type": "array"
          }
        },
        "required": [
          "match_id",
          "periods"
        ],
        "type": "object"
      },
      "Team": {
        "properties": {
          "id": {
            "type": "string"
          },
          "image_url": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "TeamCreation": {
        "description": "`chances_created` equals `passing.key_passes`; never sum them.",
        "properties": {
          "chances_created": {
            "type": "integer"
          },
          "gca": {
            "type": "integer"
          },
          "sca": {
            "type": "integer"
          },
          "sca_breakdown": {
            "$ref": "#/components/schemas/TeamSCABreakdown"
          },
          "second_assists": {
            "type": "integer"
          },
          "xag": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "TeamDefending": {
        "description": "Flattens PlayerDefending plus team-only pressing/transition measures.",
        "properties": {
          "aerials": {
            "type": "integer"
          },
          "aerials_won": {
            "type": "integer"
          },
          "avg_defensive_action_x": {
            "type": [
              "number",
              "null"
            ]
          },
          "ball_recovery_time": {
            "type": [
              "number",
              "null"
            ]
          },
          "blocks": {
            "type": "integer"
          },
          "challenges": {
            "type": "integer"
          },
          "clearances": {
            "type": "integer"
          },
          "counterpress_regains_5s": {
            "type": "integer"
          },
          "defensive_actions": {
            "type": "integer"
          },
          "duels_won": {
            "type": "integer"
          },
          "high_turnovers": {
            "type": "integer"
          },
          "interceptions": {
            "type": "integer"
          },
          "opponent_passes": {
            "type": "integer"
          },
          "ppda": {
            "type": [
              "number",
              "null"
            ]
          },
          "tackles": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "TeamHeatmap": {
        "properties": {
          "actions": {
            "type": "integer"
          },
          "cells": {
            "$ref": "#/components/schemas/HeatmapCells"
          },
          "side": {
            "description": "Cells are in this team's own attacking frame either way; the side is what lets you mirror one of them to draw both on a single pitch.",
            "enum": [
              "home",
              "away"
            ],
            "type": "string"
          },
          "team": {
            "$ref": "#/components/schemas/TeamNameRef"
          }
        },
        "required": [
          "team",
          "side",
          "actions",
          "cells"
        ],
        "type": "object"
      },
      "TeamNameRef": {
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "TeamRef": {
        "properties": {
          "id": {
            "type": "string"
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "TeamSCABreakdown": {
        "properties": {
          "defensive": {
            "type": "integer"
          },
          "foul_drawn": {
            "type": "integer"
          },
          "pass_dead": {
            "type": "integer"
          },
          "pass_live": {
            "type": "integer"
          },
          "shot": {
            "type": "integer"
          },
          "take_on": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "TempoStats": {
        "properties": {
          "buildup_attacks": {
            "type": "integer"
          },
          "direct_attacks": {
            "type": "integer"
          },
          "direct_speed": {
            "type": [
              "number",
              "null"
            ]
          },
          "passes_per_sequence": {
            "type": [
              "number",
              "null"
            ]
          },
          "sequence_time": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "TerritoryStats": {
        "properties": {
          "avg_action_x": {
            "type": [
              "number",
              "null"
            ]
          },
          "box_entries": {
            "type": "integer"
          },
          "field_tilt": {
            "type": [
              "number",
              "null"
            ]
          },
          "final_third_entries": {
            "type": "integer"
          },
          "possession_pct": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "WebhookDelivery": {
        "properties": {
          "attempts": {
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "delivered_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "event_type": {
            "type": "string"
          },
          "id": {
            "example": "whd_8Kq2Lp",
            "type": "string"
          },
          "last_error": {
            "nullable": true,
            "type": "string"
          },
          "last_status_code": {
            "nullable": true,
            "type": "integer"
          },
          "status": {
            "enum": [
              "pending",
              "succeeded",
              "dead"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "WebhookEndpoint": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "consecutive_failures": {
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "nullable": true,
            "type": "string"
          },
          "disabled_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "events": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "example": "wh_R2mQ7d",
            "type": "string"
          },
          "secret": {
            "description": "Present only in the response that creates or rotates it.",
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "url",
          "description",
          "events",
          "active",
          "disabled_at",
          "consecutive_failures",
          "created_at"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "description": "A `pk_live_...` or `pk_test_...` key.",
        "in": "header",
        "name": "X-API-KEY",
        "type": "apiKey"
      }
    }
  },
  "info": {
    "contact": {
      "name": "PitchAPI",
      "url": "https://pitchapi.dev"
    },
    "description": "Football data API. Match results, shots, xG, lineups, momentum, events, player stats, head-to-head, and advanced analytics derived from the event feed.\n\nEvery response is wrapped in an envelope: successful responses carry a `data` object, errors carry an `error` object with a stable `code`. All IDs are opaque Feistel-encrypted strings (e.g. `m_4DP2fy`); no internal database IDs are exposed.\n",
    "license": {
      "name": "Proprietary"
    },
    "title": "PitchAPI",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/date/{date}": {
      "get": {
        "operationId": "getMatchesByDate",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/MatchStatus"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DateMatches"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Matches for the day"
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameter"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "All matches on a given day",
        "tags": [
          "Date"
        ]
      }
    },
    "/exports": {
      "get": {
        "operationId": "listExports",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "jobs": {
                          "items": {
                            "$ref": "#/components/schemas/ExportJob"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "jobs"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The twenty most recent jobs"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          }
        },
        "summary": "List export jobs",
        "tags": [
          "Exports"
        ]
      },
      "post": {
        "description": "Answers 202 with the queued job. The file is built in the background;\npoll the job until `status` is `ready`, then read `download_url`.\nTwenty-five jobs a day. A single file is capped at 2 GiB: a job that\nwould exceed it fails with `export exceeds the size limit`, so narrow\nthe filters rather than retrying.\n",
        "operationId": "createExport",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "dataset": {
                    "enum": [
                      "matches",
                      "shots",
                      "events",
                      "lineups",
                      "player_stats",
                      "match_stats",
                      "teams",
                      "players"
                    ],
                    "type": "string"
                  },
                  "format": {
                    "default": "ndjson",
                    "enum": [
                      "ndjson",
                      "parquet"
                    ],
                    "type": "string"
                  },
                  "from": {
                    "format": "date",
                    "type": "string"
                  },
                  "league": {
                    "example": "l_4Kd0Wq",
                    "type": "string"
                  },
                  "season": {
                    "example": "2025/2026",
                    "type": "string"
                  },
                  "to": {
                    "format": "date",
                    "type": "string"
                  }
                },
                "required": [
                  "dataset"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "job": {
                          "$ref": "#/components/schemas/ExportJob"
                        },
                        "queue_note": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "job",
                        "queue_note"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Queued"
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameter"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Queue a bulk export",
        "tags": [
          "Exports"
        ]
      }
    },
    "/exports/datasets": {
      "get": {
        "description": "The eight datasets available for bulk download. Exports are part of the\nData plan. Files carry the internal integer ids so the datasets join to\neach other; `matches`, `teams` and `players` also carry `id_token`, the\nopaque ID the API serves.\n",
        "operationId": "listExportDatasets",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "datasets": {
                          "items": {
                            "properties": {
                              "columns": {
                                "items": {
                                  "type": "string"
                                },
                                "type": "array"
                              },
                              "description": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "formats": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "datasets",
                        "formats"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Datasets and formats"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          }
        },
        "summary": "Export dataset catalogue",
        "tags": [
          "Exports"
        ]
      }
    },
    "/exports/{id}": {
      "delete": {
        "operationId": "deleteExport",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^ex_[0-9A-Za-z]{6}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Delete an export job and its file",
        "tags": [
          "Exports"
        ]
      },
      "get": {
        "description": "The job's status. When it is `ready`, `download_url` is a signed link\nvalid for fifteen minutes; request this endpoint again for a fresh one.\n",
        "operationId": "getExport",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^ex_[0-9A-Za-z]{6}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ExportJob"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The job"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Retrieve an export job",
        "tags": [
          "Exports"
        ]
      }
    },
    "/leagues": {
      "get": {
        "operationId": "listLeagues",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "leagues": {
                          "items": {
                            "$ref": "#/components/schemas/LeagueSummary"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "leagues"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "League list"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "All leagues",
        "tags": [
          "Leagues"
        ]
      }
    },
    "/leagues/{id}": {
      "get": {
        "operationId": "getLeague",
        "parameters": [
          {
            "$ref": "#/components/parameters/LeagueId"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/League"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "League detail"
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameter"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "League detail",
        "tags": [
          "Leagues"
        ]
      }
    },
    "/leagues/{id}/matches": {
      "get": {
        "operationId": "getLeagueMatches",
        "parameters": [
          {
            "$ref": "#/components/parameters/LeagueId"
          },
          {
            "description": "Season selector — `2025/2026` for a fall-spring league, `2026` for a calendar-year one. Omitted, the latest season with data is used. The free plan reads the current season and the one before it; an older season answers 403 `PLAN_UPGRADE_REQUIRED` for a free key and is served on Pro and Data.\n",
            "in": "query",
            "name": "season",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/MatchStatus"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LeagueMatches"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "League matches"
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameter"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Matches in a league season",
        "tags": [
          "Leagues"
        ]
      }
    },
    "/matches/{id}": {
      "get": {
        "operationId": "getMatch",
        "parameters": [
          {
            "$ref": "#/components/parameters/MatchId"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Match"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Match summary"
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameter"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Match summary",
        "tags": [
          "Matches"
        ]
      }
    },
    "/matches/{id}/advanced": {
      "get": {
        "description": "Returns `404 ANALYTICS_UNAVAILABLE` for a match whose analytics have not been computed.\n",
        "operationId": "getMatchAdvanced",
        "parameters": [
          {
            "$ref": "#/components/parameters/MatchId"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedTeams"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Advanced team rollups"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Advanced team analytics (PPDA, field tilt, xG timeline)",
        "tags": [
          "Matches"
        ]
      }
    },
    "/matches/{id}/advanced/network": {
      "get": {
        "operationId": "getMatchAdvancedNetwork",
        "parameters": [
          {
            "$ref": "#/components/parameters/MatchId"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedNetworks"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Pass networks"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Pass networks",
        "tags": [
          "Matches"
        ]
      }
    },
    "/matches/{id}/advanced/players": {
      "get": {
        "operationId": "getMatchAdvancedPlayers",
        "parameters": [
          {
            "$ref": "#/components/parameters/MatchId"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedPlayers"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Advanced player rollups"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Player-level advanced rollups",
        "tags": [
          "Matches"
        ]
      }
    },
    "/matches/{id}/advanced/players/{pid}": {
      "get": {
        "operationId": "getMatchAdvancedPlayer",
        "parameters": [
          {
            "$ref": "#/components/parameters/MatchId"
          },
          {
            "$ref": "#/components/parameters/PlayerId"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdvancedPlayerStat"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Advanced player rollup"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "One player's advanced rollup",
        "tags": [
          "Matches"
        ]
      }
    },
    "/matches/{id}/events": {
      "get": {
        "operationId": "getMatchEvents",
        "parameters": [
          {
            "$ref": "#/components/parameters/MatchId"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Events"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Events"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Match events (goals, cards, subs, ...)",
        "tags": [
          "Matches"
        ]
      }
    },
    "/matches/{id}/h2h": {
      "get": {
        "operationId": "getMatchH2H",
        "parameters": [
          {
            "$ref": "#/components/parameters/MatchId"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/H2H"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Head-to-head"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Head-to-head history",
        "tags": [
          "Matches"
        ]
      }
    },
    "/matches/{id}/heatmaps": {
      "get": {
        "operationId": "getMatchHeatmaps",
        "parameters": [
          {
            "$ref": "#/components/parameters/MatchId"
          },
          {
            "description": "Orientation to serve the cells in. `acting_ltr` (the default) gives every team its own attacking frame, which is what makes a player comparable across home and away fixtures. `home_ltr` puts both teams on one pitch — the home side attacking cell_x 15, the away side 0 — which is what a match view needs. The server applies the turn, so there is nothing to mirror client-side.",
            "in": "query",
            "name": "frame",
            "required": false,
            "schema": {
              "default": "acting_ltr",
              "enum": [
                "acting_ltr",
                "home_ltr"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MatchHeatmaps"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Heatmaps"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Binned activity grids per team and player",
        "tags": [
          "Matches"
        ]
      }
    },
    "/matches/{id}/lineups": {
      "get": {
        "operationId": "getMatchLineups",
        "parameters": [
          {
            "$ref": "#/components/parameters/MatchId"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Lineups"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Lineups"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Starting lineups and substitutes",
        "tags": [
          "Matches"
        ]
      }
    },
    "/matches/{id}/live": {
      "get": {
        "description": "The clock, running score, both team sheets, the current XI after\nsubstitutions and red cards, events, team stats, each half's team stats\nand each player's stat line so far.\n\nOutside the live window the stored match is returned with `live: false`.\nWhen fresh data cannot be fetched the last snapshot is served with\n`stale: true` rather than an error. `fetched_at` and `age_seconds` date\nthe snapshot; nothing is written to the database.\n\nPoll one match no faster than every 10 seconds. This route has its own\nallowance of 60 requests a minute per key, separate from the shared\nceiling; when it is used up the answer is `429` with `Retry-After`.\n",
        "operationId": "getMatchLive",
        "parameters": [
          {
            "$ref": "#/components/parameters/MatchId"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LiveSnapshot"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Live snapshot",
            "headers": {
              "Cache-Control": {
                "description": "Always `no-store`; the snapshot is cached server-side.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameter"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Live snapshot of a match in progress",
        "tags": [
          "Matches"
        ]
      }
    },
    "/matches/{id}/live/stream": {
      "get": {
        "description": "Pro plan. The same document as `GET /v1/matches/{id}/live`, pushed as\n`text/event-stream` whenever it changes instead of polled.\n\nThe first frame is the current snapshot; every later `snapshot` event\ncarries the complete document again rather than a delta, so a client\nthat misses one frame loses nothing. An `end` event is sent when the\nmatch reaches a final state (`finished`, `postponed`, `canceled`,\n`awarded`) and the server then closes the response. A comment line\n(`: keepalive`) every fifteen seconds keeps proxies from timing out an\nidle connection.\n\nThe API key travels in `X-API-KEY` like every other route. A browser's\nEventSource cannot set headers, so this endpoint is for server-side\nclients and `curl -N`; the key is not accepted in the query string,\nbecause the access log records the full request URI.\n\nOpening a stream counts as one request against the live allowance, so\nthe same 60-a-minute budget (600 on Pro) applies to opens; frames are\nfree. An account may hold eight streams open at once and a ninth is\nrefused with `429`. One poll per match with a subscriber serves every\nwatcher, so the provider cost does not grow with the audience.\n",
        "operationId": "streamMatchLive",
        "parameters": [
          {
            "$ref": "#/components/parameters/MatchId"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/event-stream": {
                "example": "id: 1\nevent: snapshot\ndata: {\"data\":{\"match_id\":\"m_4DP2fy\",\"status\":\"started\",\"live\":true}}\n\n: keepalive\n",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "A Server-Sent Events stream of LiveSnapshot documents.",
            "headers": {
              "Cache-Control": {
                "description": "Always `no-store`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameter"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Live snapshots of a match, pushed as Server-Sent Events",
        "tags": [
          "Matches"
        ]
      }
    },
    "/matches/{id}/momentum": {
      "get": {
        "operationId": "getMatchMomentum",
        "parameters": [
          {
            "$ref": "#/components/parameters/MatchId"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Momentum"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Momentum"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Possession-momentum timeline",
        "tags": [
          "Matches"
        ]
      }
    },
    "/matches/{id}/players": {
      "get": {
        "description": "Stat groups share one shape across leagues. Leagues served without a player rating carry none; for the few competitions where match statistics are unavailable (Latvia's Virsliga, Venezuela's Primera División) the lines are derived from the match events and stats the events cannot reproduce (chances created, final-third passes) are omitted rather than zero.\n",
        "operationId": "getMatchPlayers",
        "parameters": [
          {
            "$ref": "#/components/parameters/MatchId"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/PlayerMatchStats"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Player stat lines"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Per-player match stats",
        "tags": [
          "Matches"
        ]
      }
    },
    "/matches/{id}/players/halves": {
      "get": {
        "description": "Every player's stat line for the first and the second half. Each half's `stats` has the shape of `/matches/{id}/players`, though not every stat is available per half (the rating is match-level only). A player lists only the halves they took part in. Extra time belongs to neither half, and the halves need not add up exactly to `/matches/{id}/players`. Returns `404 HALVES_UNAVAILABLE` for a match we hold without per-half player stats.\n",
        "operationId": "getMatchPlayerHalves",
        "parameters": [
          {
            "$ref": "#/components/parameters/MatchId"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MatchPlayerHalves"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Player halves"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Per-player stats for each half",
        "tags": [
          "Matches"
        ]
      }
    },
    "/matches/{id}/players/{pid}": {
      "get": {
        "operationId": "getMatchPlayer",
        "parameters": [
          {
            "$ref": "#/components/parameters/MatchId"
          },
          {
            "$ref": "#/components/parameters/PlayerId"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PlayerDetail"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Player detail"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Individual player detail",
        "tags": [
          "Matches"
        ]
      }
    },
    "/matches/{id}/players/{pid}/halves": {
      "get": {
        "description": "The halves of one player, in the shape of an entry of `/matches/{id}/players/halves`. `RESOURCE_NOT_FOUND` for a player who took no part in a match that has halves; `HALVES_UNAVAILABLE` for a match that has none.\n",
        "operationId": "getMatchPlayerHalf",
        "parameters": [
          {
            "$ref": "#/components/parameters/MatchId"
          },
          {
            "$ref": "#/components/parameters/PlayerId"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PlayerHalfDetail"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Player halves"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "One player's stats for each half",
        "tags": [
          "Matches"
        ]
      }
    },
    "/matches/{id}/players/{pid}/shots": {
      "get": {
        "operationId": "getMatchPlayerShots",
        "parameters": [
          {
            "$ref": "#/components/parameters/MatchId"
          },
          {
            "$ref": "#/components/parameters/PlayerId"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PlayerShots"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Player shots"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "A single player's shots",
        "tags": [
          "Matches"
        ]
      }
    },
    "/matches/{id}/shots": {
      "get": {
        "operationId": "getMatchShots",
        "parameters": [
          {
            "$ref": "#/components/parameters/MatchId"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Shots"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Shots grouped by period"
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameter"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Every shot with pitch coordinates and xG",
        "tags": [
          "Matches"
        ]
      }
    },
    "/matches/{id}/shots/{sid}": {
      "get": {
        "operationId": "getShot",
        "parameters": [
          {
            "$ref": "#/components/parameters/MatchId"
          },
          {
            "$ref": "#/components/parameters/ShotId"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Shot"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Shot detail"
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameter"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "A single shot",
        "tags": [
          "Matches"
        ]
      }
    },
    "/matches/{id}/stats": {
      "get": {
        "operationId": "getMatchStats",
        "parameters": [
          {
            "$ref": "#/components/parameters/MatchId"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MatchStats"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Team stats"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Team-level match statistics",
        "tags": [
          "Matches"
        ]
      }
    },
    "/players/{id}": {
      "get": {
        "operationId": "getPlayer",
        "parameters": [
          {
            "$ref": "#/components/parameters/PlayerProfileId"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PlayerProfile"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Player profile"
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameter"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Player profile",
        "tags": [
          "Players"
        ]
      }
    },
    "/teams/{id}": {
      "get": {
        "operationId": "getTeam",
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Team"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Team profile"
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameter"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Team profile",
        "tags": [
          "Teams"
        ]
      }
    },
    "/webhook-endpoints": {
      "get": {
        "operationId": "listWebhookEndpoints",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "endpoints": {
                          "items": {
                            "$ref": "#/components/schemas/WebhookEndpoint"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "endpoints"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Endpoints on the account"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          }
        },
        "summary": "List webhook endpoints",
        "tags": [
          "Webhooks"
        ]
      },
      "post": {
        "description": "Registers a URL for one or more events. The signing secret is returned\nonce, in this response only. The URL must be HTTPS and publicly\nroutable; loopback, private ranges and link-local addresses are\nrejected, and redirects are never followed.\n",
        "operationId": "createWebhookEndpoint",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "description": {
                    "maxLength": 255,
                    "type": "string"
                  },
                  "events": {
                    "items": {
                      "enum": [
                        "match.finished",
                        "match.lineups",
                        "match.status"
                      ],
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "url": {
                    "example": "https://example.com/hooks/pitchapi",
                    "type": "string"
                  }
                },
                "required": [
                  "url",
                  "events"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookEndpoint"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Created; `secret` is present in this response only"
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameter"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Create a webhook endpoint",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/webhook-endpoints/event-types": {
      "get": {
        "description": "The events the API emits. Webhooks are included in Pro and Data.",
        "operationId": "listWebhookEventTypes",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "event_types": {
                          "items": {
                            "properties": {
                              "description": {
                                "type": "string"
                              },
                              "type": {
                                "example": "match.finished",
                                "type": "string"
                              }
                            },
                            "type": "object"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Available event types"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          }
        },
        "summary": "Webhook event catalogue",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/webhook-endpoints/{id}": {
      "delete": {
        "operationId": "deleteWebhookEndpoint",
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Delete a webhook endpoint",
        "tags": [
          "Webhooks"
        ]
      },
      "get": {
        "operationId": "getWebhookEndpoint",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookEndpoint"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The endpoint"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Retrieve a webhook endpoint",
        "tags": [
          "Webhooks"
        ]
      },
      "parameters": [
        {
          "in": "path",
          "name": "id",
          "required": true,
          "schema": {
            "pattern": "^wh_[0-9A-Za-z]{6}$",
            "type": "string"
          }
        }
      ],
      "patch": {
        "operationId": "updateWebhookEndpoint",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "active": {
                    "type": "boolean"
                  },
                  "description": {
                    "type": "string"
                  },
                  "events": {
                    "items": {
                      "enum": [
                        "match.finished",
                        "match.lineups",
                        "match.status"
                      ],
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "url": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookEndpoint"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The updated endpoint"
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameter"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Update a webhook endpoint",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/webhook-endpoints/{id}/deliveries": {
      "get": {
        "operationId": "listWebhookDeliveries",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^wh_[0-9A-Za-z]{6}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "deliveries": {
                          "items": {
                            "$ref": "#/components/schemas/WebhookDelivery"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "deliveries"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The last 50 attempts"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Recent deliveries for an endpoint",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/webhook-endpoints/{id}/deliveries/{deliveryID}/redeliver": {
      "post": {
        "operationId": "redeliverWebhook",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^wh_[0-9A-Za-z]{6}$",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "deliveryID",
            "required": true,
            "schema": {
              "pattern": "^whd_[0-9A-Za-z]{6}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "queued": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "queued"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Queued"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Queue one delivery for another attempt",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/webhook-endpoints/{id}/secret": {
      "post": {
        "operationId": "rotateWebhookSecret",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^wh_[0-9A-Za-z]{6}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "properties": {
                        "secret": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The new secret"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanUpgradeRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "summary": "Rotate the signing secret",
        "tags": [
          "Webhooks"
        ]
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "servers": [
    {
      "description": "Production",
      "url": "https://api.pitchapi.dev/v1"
    }
  ],
  "tags": [
    {
      "name": "Date"
    },
    {
      "name": "Matches"
    },
    {
      "name": "Leagues"
    },
    {
      "name": "Teams"
    },
    {
      "name": "Players"
    },
    {
      "name": "Webhooks"
    },
    {
      "name": "Exports"
    }
  ]
}