{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/smarterweather-com/json-schema/smarterweather-com-lightning-schema.json",
  "title": "Lightning",
  "description": "Recent lightning near a point (`GET /v1/lightning`).\n**Experimental**; see the operation description.\n",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/smarterweather-com-observations-api-openapi.yml#/components/schemas/Lightning",
  "type": "object",
  "x-stability": "experimental",
  "required": [
    "lat",
    "lon",
    "glm",
    "summary"
  ],
  "properties": {
    "lat": {
      "type": "number",
      "format": "double",
      "description": "The point the values describe, the request's `lat` snapped to the 0.01° (~1 km) grid."
    },
    "lon": {
      "type": "number",
      "format": "double",
      "description": "The point the values describe, the request's `lon` snapped to the 0.01° (~1 km) grid."
    },
    "glm": {
      "description": "GOES GLM satellite flash count near the point. `null` when\nthe count is unavailable.\n",
      "oneOf": [
        {
          "$ref": "#/$defs/LightningGLM"
        },
        {
          "type": "null"
        }
      ]
    },
    "mrms": {
      "$ref": "#/$defs/LightningMRMS"
    },
    "summary": {
      "type": "string",
      "description": "One-line plain-language summary of the activity."
    }
  },
  "$defs": {
    "LightningGLM": {
      "type": "object",
      "x-stability": "experimental",
      "description": "GLM flash count within `radius_km` of the point over the last `window_minutes`.",
      "required": [
        "flash_count",
        "radius_km",
        "window_minutes"
      ],
      "properties": {
        "flash_count": {
          "type": "integer",
          "minimum": 0
        },
        "radius_km": {
          "type": "integer"
        },
        "window_minutes": {
          "type": "integer"
        }
      }
    },
    "LightningMRMS": {
      "type": "object",
      "x-stability": "experimental",
      "description": "MRMS lightning at the point. Present only when the grid has a\nvalue there; each field is omitted when it has none.\n",
      "properties": {
        "lightning_density": {
          "type": "number",
          "format": "double",
          "description": "MRMS lightning flash density at the point."
        },
        "lightning_prob": {
          "type": "integer",
          "description": "MRMS probability of lightning in the next 30 minutes, percent."
        }
      }
    }
  }
}