{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/weatherai-io/json-schema/weatherai-io-decision-schema.json",
  "title": "Decision",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/weatherai-io-api-openapi.json#/components/schemas/Decision",
  "type": "object",
  "properties": {
    "location": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "region": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "lat": {
          "type": "number"
        },
        "lon": {
          "type": "number"
        },
        "tz_id": {
          "type": "string"
        },
        "localtime": {
          "type": "string"
        }
      }
    },
    "activity": {
      "type": "string",
      "enum": [
        "running",
        "cycling",
        "outdoor-event",
        "beach",
        "laundry-drying",
        "stargazing",
        "hiking",
        "golf",
        "tennis",
        "dog-walking",
        "gardening",
        "fishing",
        "sailing",
        "drone-flying",
        "exterior-painting",
        "concrete-pour",
        "roofing",
        "crop-spraying",
        "outdoor-work",
        "driving",
        "solar-pv"
      ]
    },
    "date": {
      "type": "string",
      "format": "date"
    },
    "verdict": {
      "type": "string",
      "enum": [
        "great",
        "good",
        "fair",
        "poor",
        "avoid"
      ]
    },
    "score": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "description": "Quality of the best opportunity on that date (best window)."
    },
    "best_windows": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Window"
      }
    },
    "risks": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Risk"
      }
    },
    "summary": {
      "type": "string"
    },
    "data": {
      "type": "object",
      "additionalProperties": true,
      "description": "Key figures for the hours considered (temperatures, rain, wind, UV, sunrise/sunset; moon for stargazing). When available: air quality (air_quality, air_quality_us_epa_max, pm2_5_max, pm10_max), pollen levels (pollen_tree, pollen_grass, pollen_weed, pollen_max: none/low/moderate/high/very high), sunshine_pct_avg, sunshine_hours, solar_ghi_max_wm2, solar_dni_max_wm2, solar_gti_max_wm2, solar_energy_kwh_m2, solar_panel_energy_kwh_m2, wetbulb_max, snow_total_cm (snow_total_in), pressure_mb (pressure_in), pressure_trend and wind_dir."
    },
    "hourly": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "time": {
            "type": "string"
          },
          "score": {
            "type": "integer"
          },
          "main_issue": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "description": "Only with detail=hourly."
    },
    "billing": {
      "type": "object",
      "properties": {
        "charged": {
          "type": "string",
          "enum": [
            "free",
            "credit"
          ]
        },
        "cost_gbp": {
          "type": "string"
        },
        "free_remaining": {
          "type": "integer"
        },
        "balance_gbp": {
          "type": "string"
        }
      }
    }
  },
  "$defs": {
    "Risk": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "severity": {
          "type": "string",
          "enum": [
            "low",
            "moderate",
            "high",
            "severe",
            "extreme"
          ]
        },
        "from": {
          "type": "string"
        },
        "to": {
          "type": "string"
        },
        "detail": {
          "type": "string"
        }
      }
    },
    "Window": {
      "type": "object",
      "properties": {
        "start": {
          "type": "string"
        },
        "end": {
          "type": "string"
        },
        "score": {
          "type": "integer"
        }
      }
    }
  }
}