{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/api-ninjas-com/json-schema/api-ninjas-com-sports-game-schema.json",
  "title": "SportsGame",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/api-ninjas-com-openapi.json#/components/schemas/SportsGame",
  "type": "object",
  "properties": {
    "game_id": {
      "type": "string",
      "description": "Unique, permanent id of the game."
    },
    "league": {
      "type": "string",
      "enum": [
        "nfl",
        "nba",
        "wnba",
        "nhl",
        "mlb",
        "epl",
        "laliga",
        "bundesliga",
        "seriea",
        "ligue1",
        "ucl",
        "uel",
        "mls"
      ]
    },
    "sport": {
      "type": "string",
      "enum": [
        "american_football",
        "basketball",
        "ice_hockey",
        "baseball",
        "soccer"
      ]
    },
    "season": {
      "type": "integer",
      "description": "Year the season starts."
    },
    "season_label": {
      "type": "string"
    },
    "season_type": {
      "type": "string",
      "enum": [
        "preseason",
        "regular",
        "cup_final",
        "play_in",
        "postseason",
        "group_stage",
        "league_phase",
        "knockout"
      ]
    },
    "week": {
      "type": [
        "integer",
        "null"
      ],
      "description": "NFL only."
    },
    "round": {
      "type": [
        "string",
        "null"
      ],
      "description": "Soccer only: the cup or playoff round, e.g. Round of 16, Quarterfinals, Final; null for league matches."
    },
    "leg": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Soccer only: 1 or 2 for a two-legged knockout tie, otherwise null."
    },
    "date": {
      "type": "string",
      "format": "date",
      "description": "Game day in the league's home time zone."
    },
    "start_time": {
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "type": "string",
      "enum": [
        "scheduled",
        "in_progress",
        "final",
        "postponed",
        "canceled",
        "suspended",
        "delayed"
      ]
    },
    "status_detail": {
      "type": [
        "string",
        "null"
      ],
      "description": "While a game is in progress: halftime or end_of_period (NFL, NBA, WNBA), intermission (NHL), halftime, extra_time_break or penalties (soccer), top, middle, bottom or end (MLB). While a game is in progress, the free plan receives the string \"This field is for premium subscribers only.\" instead."
    },
    "period": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Current or last period played: quarter, period, inning, or soccer half (3 and 4 = extra time). While a game is in progress, the free plan receives the string \"This field is for premium subscribers only.\" instead."
    },
    "clock": {
      "type": [
        "string",
        "null"
      ],
      "description": "Time left in the period while in progress, or the match minute in soccer (e.g. 67' or 90'+3'); always null in MLB. While a game is in progress, the free plan receives the string \"This field is for premium subscribers only.\" instead."
    },
    "home_team": {
      "$ref": "#/$defs/SportsTeamRef"
    },
    "away_team": {
      "$ref": "#/$defs/SportsTeamRef"
    },
    "home_score": {
      "type": [
        "integer",
        "null"
      ],
      "description": "While a game is in progress, the free plan receives the string \"This field is for premium subscribers only.\" instead."
    },
    "away_score": {
      "type": [
        "integer",
        "null"
      ],
      "description": "While a game is in progress, the free plan receives the string \"This field is for premium subscribers only.\" instead."
    },
    "period_scores": {
      "type": [
        "object",
        "null"
      ],
      "description": "Points, goals or runs per period, half or inning, including overtime periods, extra-time halves and extra innings. While a game is in progress, the free plan receives the string \"This field is for premium subscribers only.\" instead.",
      "properties": {
        "home": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        },
        "away": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        }
      }
    },
    "penalty_scores": {
      "type": [
        "object",
        "null"
      ],
      "description": "Soccer only: penalty shootout score when a match is decided on penalties. While a game is in progress, the free plan receives the string \"This field is for premium subscribers only.\" instead.",
      "properties": {
        "home": {
          "type": "integer"
        },
        "away": {
          "type": "integer"
        }
      }
    },
    "aggregate_scores": {
      "type": [
        "object",
        "null"
      ],
      "description": "Soccer only: aggregate score of a two-legged tie after this match. While a game is in progress, the free plan receives the string \"This field is for premium subscribers only.\" instead.",
      "properties": {
        "home": {
          "type": "integer"
        },
        "away": {
          "type": "integer"
        }
      }
    },
    "hits": {
      "type": [
        "object",
        "null"
      ],
      "description": "MLB only: hits per team. While a game is in progress, the free plan receives the string \"This field is for premium subscribers only.\" instead.",
      "properties": {
        "home": {
          "type": "integer"
        },
        "away": {
          "type": "integer"
        }
      }
    },
    "errors": {
      "type": [
        "object",
        "null"
      ],
      "description": "MLB only: errors per team. While a game is in progress, the free plan receives the string \"This field is for premium subscribers only.\" instead.",
      "properties": {
        "home": {
          "type": "integer"
        },
        "away": {
          "type": "integer"
        }
      }
    },
    "decided_in": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "regulation",
        "overtime",
        "shootout",
        "extra_innings",
        "extra_time",
        "penalties"
      ]
    },
    "winner": {
      "type": [
        "string",
        "null"
      ],
      "description": "team_id of the winner of a final game (the shootout winner for a soccer match decided on penalties); null before then and for ties and draws."
    },
    "venue": {
      "$ref": "#/$defs/SportsVenue"
    },
    "neutral_site": {
      "type": "boolean"
    },
    "original_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date",
      "description": "First scheduled date of a moved game."
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "SportsTeamRef": {
      "type": "object",
      "properties": {
        "team_id": {
          "type": "string",
          "description": "League team id (nba-phi) or soccer club id (soccer-arsenal), which is the same in every competition."
        },
        "name": {
          "type": "string"
        },
        "abbreviation": {
          "type": "string"
        }
      }
    },
    "SportsVenue": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "city": {
          "type": [
            "string",
            "null"
          ]
        },
        "state": {
          "type": [
            "string",
            "null"
          ]
        },
        "country": {
          "type": [
            "string",
            "null"
          ],
          "description": "ISO 3166-1 alpha-2"
        }
      }
    }
  }
}