{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://opengolfapi.org/schemas/openshot/v0.json",
  "title": "OpenShot",
  "description": "Open, normalized golf shot/sensor event. Superset of GSPro OpenConnect — any OpenConnect (port 921) payload is valid OpenShot. Raw launch-monitor data — the open standard, free to send & read back. CC0 — published as an open standard. Personal data: player_id is pseudonymous.",
  "type": "object",
  "required": ["api_version", "ball"],
  "properties": {
    "api_version": { "const": "0", "description": "OpenShot schema version" },
    "shot_id": { "type": "string", "description": "server-assigned UUID (response only)" },
    "device": {
      "type": "object",
      "description": "source launch monitor",
      "properties": {
        "id": { "type": "string", "description": "device id / serial (pseudonymous)" },
        "model": { "type": "string", "description": "e.g. 'garmin_r10', 'mlm2pro', 'uneekor_eyexo', 'gspro_921'" },
        "shot_number": { "type": "integer" }
      }
    },
    "ball": {
      "type": "object",
      "description": "ball flight (units: speed mph, angles deg, spin rpm, distance yds)",
      "properties": {
        "speed": { "type": "number" },
        "launch_angle": { "type": "number", "description": "vertical launch (VLA)" },
        "azimuth": { "type": "number", "description": "horizontal launch (HLA), + = right" },
        "back_spin": { "type": "number" },
        "side_spin": { "type": "number", "description": "+ = right/slice spin" },
        "total_spin": { "type": "number" },
        "spin_axis": { "type": "number" },
        "carry": { "type": ["number", "null"] },
        "total": { "type": ["number", "null"] }
      }
    },
    "club": {
      "type": "object",
      "description": "club delivery (optional; many LMs omit)",
      "properties": {
        "selected": { "type": ["string", "null"], "description": "e.g. '7i', 'driver'" },
        "speed": { "type": ["number", "null"] },
        "angle_of_attack": { "type": ["number", "null"] },
        "path": { "type": ["number", "null"] },
        "face_to_target": { "type": ["number", "null"] },
        "face_angle": { "type": ["number", "null"] },
        "loft": { "type": ["number", "null"] },
        "lie": { "type": ["number", "null"] },
        "impact_h": { "type": ["number", "null"] },
        "impact_v": { "type": ["number", "null"] },
        "closure_rate": { "type": ["number", "null"] },
        "smash_factor": { "type": ["number", "null"], "description": "ball.speed / club.speed (server-derivable)" }
      }
    },
    "context": {
      "type": "object",
      "description": "your own linkage — tag a shot to a player, session, round, course/hole",
      "properties": {
        "player_id": { "type": ["string", "null"], "description": "pseudonymous; anonymous-by-default, claimable" },
        "session_id": { "type": ["string", "null"] },
        "round_id": { "type": ["string", "null"] },
        "course_id": { "type": ["string", "null"] },
        "hole": { "type": ["integer", "null"] },
        "lie": { "type": ["string", "null"], "enum": ["tee", "fairway", "rough", "sand", "green", "recovery", "range", null] },
        "distance_to_pin": { "type": ["number", "null"], "description": "yards" },
        "captured_at": { "type": ["string", "null"], "format": "date-time" }
      }
    }
  }
}
