{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/api-ninjas-com/json-schema/api-ninjas-com-basketball-game-schema.json",
  "title": "BasketballGame",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/api-ninjas-com-basketball-api-openapi.yml#/components/schemas/BasketballGame",
  "type": "object",
  "properties": {
    "game_id": {
      "type": "string",
      "description": "Unique, permanent id of the game."
    },
    "league": {
      "type": "string",
      "enum": [
        "nba",
        "wnba"
      ]
    },
    "sport": {
      "type": "string",
      "enum": [
        "basketball"
      ]
    },
    "season": {
      "type": "integer",
      "description": "Year the season starts."
    },
    "season_label": {
      "type": "string"
    },
    "season_type": {
      "type": "string",
      "enum": [
        "preseason",
        "regular",
        "cup_final",
        "play_in",
        "conference_tournament",
        "postseason"
      ]
    },
    "date": {
      "type": "string",
      "format": "date",
      "description": "Game day in US Eastern time."
    },
    "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. 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 quarter played; overtime periods continue the count. 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 quarter while in progress. While a game is in progress, the free plan receives the string \"This field is for premium subscribers only.\" instead."
    },
    "home_team": {
      "$ref": "#/$defs/BasketballTeamRef"
    },
    "away_team": {
      "$ref": "#/$defs/BasketballTeamRef"
    },
    "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 per quarter, with each overtime period. 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"
          }
        }
      }
    },
    "decided_in": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "regulation",
        "overtime",
        null
      ]
    },
    "winner": {
      "type": [
        "string",
        "null"
      ],
      "description": "team_id of the winner of a final game; null before then."
    },
    "venue": {
      "$ref": "#/$defs/BasketballVenue"
    },
    "event": {
      "type": [
        "string",
        "null"
      ],
      "description": "College only: tournament, bowl or round, e.g. Big East Tournament - Quarterfinal or NCAA Men's Basketball Championship - West Region - 1st Round."
    },
    "conference_game": {
      "type": "boolean",
      "description": "College only: true when the game counts in the conference standings."
    },
    "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": {
    "BasketballTeamRef": {
      "type": "object",
      "properties": {
        "team_id": {
          "type": "string",
          "description": "Team id, e.g. nba-bos."
        },
        "name": {
          "type": "string"
        },
        "abbreviation": {
          "type": "string"
        },
        "rank": {
          "type": [
            "integer",
            "null"
          ],
          "description": "College games only: Top 25 rank at game time (AP poll), null when unranked."
        },
        "seed": {
          "type": [
            "integer",
            "null"
          ],
          "description": "College games only: seed in NCAA tournament games."
        }
      }
    },
    "BasketballVenue": {
      "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"
        }
      }
    }
  }
}