{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/stat-api-com/json-schema/stat-api-com-mlbat-bats-schema.json",
  "title": "MLBAtBats",
  "description": "Every plate appearance in every MLB game — the batter, the pitcher, the count, the pitch sequence, and the outcome (single, double, home run, strikeout, walk, hit-by-pitch, etc.).",
  "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/MLBAtBats",
  "properties": {
    "at_bat_number": {
      "type": "integer"
    },
    "balls": {
      "type": "integer"
    },
    "bat_side": {
      "description": "Batter side for this matchup (L/R) — per-PA truth, resolves switch hitters",
      "type": [
        "string",
        "null"
      ]
    },
    "batter_id": {
      "format": "int64",
      "type": "integer"
    },
    "end_outs": {
      "type": "integer"
    },
    "end_runners": {
      "type": "integer"
    },
    "end_time": {
      "description": "Wall-clock end of the plate appearance, as the league records it",
      "format": "date-time",
      "type": [
        "string",
        "null"
      ]
    },
    "expected_batting_avg": {
      "format": "double",
      "type": [
        "number",
        "null"
      ]
    },
    "expected_woba": {
      "format": "double",
      "type": [
        "number",
        "null"
      ]
    },
    "game_id": {
      "format": "int64",
      "type": "integer"
    },
    "hit_coord_x": {
      "format": "float",
      "type": [
        "number",
        "null"
      ]
    },
    "hit_coord_y": {
      "format": "float",
      "type": [
        "number",
        "null"
      ]
    },
    "hit_distance": {
      "type": [
        "integer",
        "null"
      ]
    },
    "hit_exit_velocity": {
      "format": "float",
      "type": [
        "number",
        "null"
      ]
    },
    "hit_launch_angle": {
      "format": "float",
      "type": [
        "number",
        "null"
      ]
    },
    "hit_location": {
      "type": [
        "string",
        "null"
      ]
    },
    "hit_type": {
      "type": [
        "string",
        "null"
      ]
    },
    "id": {
      "description": "Primary Key",
      "format": "int64",
      "type": "integer"
    },
    "inning_id": {
      "format": "int64",
      "type": "integer"
    },
    "is_barrel": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "is_flare_burner": {
      "description": "Launch angle 10-25 AND exit velocity < 95",
      "type": [
        "boolean",
        "null"
      ]
    },
    "is_hard_hit": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "is_solid_contact": {
      "description": "Launch angle 20-25 AND exit velocity 95-100",
      "type": [
        "boolean",
        "null"
      ]
    },
    "is_sweet_spot": {
      "description": "Launch angle between 8-32 degrees",
      "type": [
        "boolean",
        "null"
      ]
    },
    "is_topped": {
      "description": "Launch angle < 10 AND exit velocity < 90",
      "type": [
        "boolean",
        "null"
      ]
    },
    "is_under": {
      "description": "Launch angle less than 10 degrees",
      "type": [
        "boolean",
        "null"
      ]
    },
    "launch_speed_angle_zone": {
      "type": [
        "integer",
        "null"
      ]
    },
    "pitch_count": {
      "type": "integer"
    },
    "pitch_hand": {
      "description": "Pitcher hand for this matchup (L/R)",
      "type": [
        "string",
        "null"
      ]
    },
    "pitcher_id": {
      "format": "int64",
      "type": "integer"
    },
    "result": {
      "type": "string"
    },
    "runs_scored": {
      "type": "integer"
    },
    "spray_angle": {
      "description": "Horizontal angle from center field (degrees)",
      "format": "float",
      "type": [
        "number",
        "null"
      ]
    },
    "start_outs": {
      "type": "integer"
    },
    "start_runners": {
      "type": "integer"
    },
    "start_time": {
      "description": "Wall-clock start of the plate appearance, as the league records it",
      "format": "date-time",
      "type": [
        "string",
        "null"
      ]
    },
    "statcast_quality_score": {
      "description": "Statcast data quality score (0.0-1.0)",
      "format": "double",
      "type": [
        "number",
        "null"
      ]
    },
    "strikes": {
      "type": "integer"
    },
    "tracking_confidence": {
      "description": "Confidence in tracking data accuracy",
      "format": "double",
      "type": [
        "number",
        "null"
      ]
    }
  },
  "required": [
    "id",
    "batter_id",
    "game_id",
    "inning_id",
    "pitcher_id",
    "at_bat_number",
    "balls",
    "end_outs",
    "end_runners",
    "pitch_count",
    "result",
    "runs_scored",
    "start_outs",
    "start_runners",
    "strikes"
  ],
  "type": "object"
}