{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/realtimesportsapi-com/json-schema/realtimesportsapi-com-event-schema.json",
  "title": "Event",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/realtimesportsapi-com-openapi.json#/components/schemas/Event",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "uid": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "shortName": {
      "type": "string"
    },
    "date": {
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "$ref": "#/$defs/EventStatus"
    },
    "homeTeam": {
      "$ref": "#/$defs/EventTeam"
    },
    "awayTeam": {
      "$ref": "#/$defs/EventTeam"
    },
    "competition": {
      "type": "object",
      "properties": {
        "attendance": {
          "type": "integer"
        },
        "neutralSite": {
          "type": "boolean"
        },
        "conferenceCompetition": {
          "type": "boolean"
        },
        "divisionCompetition": {
          "type": "boolean"
        },
        "playByPlayAvailable": {
          "type": "boolean"
        },
        "highlightsAvailable": {
          "type": "boolean"
        }
      }
    },
    "venue": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "state": {
          "type": "string"
        },
        "indoor": {
          "type": "boolean"
        },
        "grass": {
          "type": "boolean"
        }
      }
    },
    "notes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "season": {
      "type": "object",
      "properties": {
        "year": {
          "type": "integer"
        },
        "displayName": {
          "type": "string"
        },
        "type": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "abbreviation": {
              "type": "string"
            }
          }
        },
        "week": {
          "type": "object",
          "properties": {
            "number": {
              "type": "integer"
            },
            "startDate": {
              "type": "string"
            },
            "endDate": {
              "type": "string"
            },
            "text": {
              "type": "string"
            }
          }
        }
      }
    },
    "broadcasts": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "network": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      }
    },
    "officials": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "fullName": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "order": {
            "type": "integer"
          },
          "position": {
            "type": "string"
          }
        }
      }
    },
    "odds": {
      "allOf": [
        {
          "$ref": "#/$defs/Odds"
        }
      ],
      "description": "Present only when includeOdds=true and odds are available."
    }
  },
  "$defs": {
    "EventStatus": {
      "type": "object",
      "properties": {
        "state": {
          "type": "string",
          "enum": [
            "pre",
            "in",
            "post"
          ]
        },
        "completed": {
          "type": "boolean"
        },
        "period": {
          "type": "integer"
        },
        "clock": {
          "type": "string"
        },
        "detail": {
          "type": "string"
        },
        "halftime": {
          "type": "boolean"
        },
        "firstHalfEnded": {
          "type": "boolean"
        },
        "inning": {
          "$ref": "#/$defs/InningState"
        }
      }
    },
    "EventTeam": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "abbreviation": {
          "type": "string"
        },
        "logo": {
          "type": [
            "string",
            "null"
          ],
          "description": "Team logo URL when available."
        },
        "color": {
          "type": "string"
        },
        "alternateColor": {
          "type": "string"
        },
        "winner": {
          "type": "boolean"
        },
        "record": {
          "type": "string"
        },
        "score": {
          "type": "integer"
        }
      }
    },
    "InningState": {
      "type": "object",
      "properties": {
        "number": {
          "type": "integer"
        },
        "half": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "top",
            "bottom",
            "middle",
            "end"
          ]
        },
        "outs": {
          "type": "integer"
        },
        "balls": {
          "type": "integer"
        },
        "strikes": {
          "type": "integer"
        },
        "onFirst": {
          "type": "boolean"
        },
        "onSecond": {
          "type": "boolean"
        },
        "onThird": {
          "type": "boolean"
        }
      },
      "description": "MLB only; absent for other leagues and before first pitch. half, the count and the runner flags are set while the game is live and null otherwise."
    },
    "Odds": {
      "type": "object",
      "properties": {
        "provider": {
          "type": "string",
          "description": "Name of the single source book."
        },
        "spread": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "line": {
              "type": "number"
            },
            "home": {
              "type": "number"
            },
            "away": {
              "type": "number"
            }
          }
        },
        "moneyline": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "home": {
              "type": "number"
            },
            "away": {
              "type": "number"
            }
          }
        },
        "overUnder": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "total": {
              "type": "number"
            },
            "over": {
              "type": "number"
            },
            "under": {
              "type": "number"
            }
          }
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}