{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/stat-api-com/json-schema/stat-api-com-mlbgames-schema.json",
  "title": "MLBGames",
  "description": "Every scheduled and played MLB game — spring training exhibitions, the 162-game regular season, the Wild Card Series, the Division and Championship Series, and the World Series.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/stat-api-com-mlb-api-openapi.yml#/components/schemas/MLBGames",
  "properties": {
    "attendance": {
      "type": [
        "integer",
        "null"
      ]
    },
    "away_team_id": {
      "format": "int64",
      "type": "integer"
    },
    "away_team_score": {
      "type": "integer"
    },
    "channel": {
      "type": [
        "string",
        "null"
      ]
    },
    "day": {
      "type": "integer"
    },
    "day_night": {
      "description": "D=Day, N=Night",
      "type": [
        "string",
        "null"
      ]
    },
    "doubleheader": {
      "type": "boolean"
    },
    "duration_minutes": {
      "description": "Total game duration in minutes",
      "type": [
        "integer",
        "null"
      ]
    },
    "end_time": {
      "format": "date-time",
      "type": [
        "string",
        "null"
      ]
    },
    "game_label": {
      "type": [
        "string",
        "null"
      ]
    },
    "game_number": {
      "description": "For doubleheaders: 1 or 2",
      "type": "integer"
    },
    "game_time": {
      "description": "Canonical game start time. The ONLY one on any games table — nba and nfl carried a duplicate `start_time` until 2026-08-27 and nhl carried `date_time` and `date_time_utc`; all four sports now expose `game_time` alone.",
      "format": "date-time",
      "type": "string"
    },
    "game_type": {
      "description": "R=Regular, S=Spring, F=Wild Card, D=Division, L=League, W=World Series, E=Exhibition, A=All-Star",
      "type": "string"
    },
    "home_team_id": {
      "format": "int64",
      "type": "integer"
    },
    "home_team_score": {
      "type": "integer"
    },
    "id": {
      "description": "Primary Key",
      "format": "int64",
      "type": "integer"
    },
    "if_necessary": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "league_game_id": {
      "description": "Official MLB gamePk (issued by the league)",
      "type": [
        "integer",
        "null"
      ]
    },
    "league_id": {
      "description": "Official MLB game identifier",
      "type": [
        "string",
        "null"
      ]
    },
    "losing_pitcher_id": {
      "description": "Losing pitcher of record",
      "format": "int64",
      "type": [
        "integer",
        "null"
      ]
    },
    "neutral_venue": {
      "type": "boolean"
    },
    "postponed_status": {
      "type": [
        "string",
        "null"
      ]
    },
    "save_pitcher_id": {
      "description": "Save pitcher (if any)",
      "format": "int64",
      "type": [
        "integer",
        "null"
      ]
    },
    "season_id": {
      "format": "int64",
      "type": "integer"
    },
    "season_type": {
      "description": "Canonical season phase. Postseason round detail (Wild Card/Division/LCS/World Series) is in the league-native `game_type` code.",
      "type": "string"
    },
    "series_game_number": {
      "type": [
        "string",
        "null"
      ]
    },
    "series_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "series_text": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "description": "Final, Live, Scheduled, Postponed, Suspended, Cancelled",
      "type": "string"
    },
    "venue_id": {
      "format": "int64",
      "type": [
        "integer",
        "null"
      ]
    },
    "winning_pitcher_id": {
      "description": "Winning pitcher of record",
      "format": "int64",
      "type": [
        "integer",
        "null"
      ]
    }
  },
  "required": [
    "id",
    "away_team_id",
    "home_team_id",
    "season_id",
    "away_team_score",
    "day",
    "doubleheader",
    "game_number",
    "game_time",
    "game_type",
    "home_team_score",
    "neutral_venue",
    "season_type",
    "status"
  ],
  "type": "object"
}