{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/openvan-camp/json-schema/openvan-camp-van-sky-climate-response-schema.json",
  "title": "VanSkyClimateResponse",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/openvan-camp-openapi.json#/components/schemas/VanSkyClimateResponse",
  "type": "object",
  "properties": {
    "location": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "number"
        },
        "lng": {
          "type": "number"
        },
        "grid_lat": {
          "type": "number",
          "description": "Centre of the 0.25° grid cell used."
        },
        "grid_lng": {
          "type": "number"
        }
      }
    },
    "city": {
      "type": "object",
      "description": "Only for the city endpoint.",
      "properties": {
        "name": {
          "type": "string"
        },
        "slug": {
          "type": "string"
        },
        "country_code": {
          "type": "string"
        },
        "country_name": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "period": {
      "type": "string"
    },
    "archive_days_per_date": {
      "type": "integer"
    },
    "method": {
      "type": "object",
      "additionalProperties": true
    },
    "day": {
      "type": "object",
      "description": "Present when `date` is given.",
      "properties": {
        "date": {
          "type": "string"
        },
        "temp_day_c": {
          "type": [
            "integer",
            "null"
          ]
        },
        "temp_night_c": {
          "type": [
            "integer",
            "null"
          ]
        },
        "precipitation_days_pct": {
          "type": [
            "integer",
            "null"
          ]
        },
        "precipitation_days_of_35": {
          "type": [
            "integer",
            "null"
          ]
        },
        "sky": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "sun",
            "cloud",
            "overcast",
            "rain",
            "snow",
            null
          ],
          "description": "Most frequent sky of the 35 days; precipitation days count first."
        },
        "water_c": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Sea surface (nearest sea within ~50 km) or large lake; null inland."
        },
        "solar_kwh_m2": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "p25": {
              "type": "number"
            },
            "median": {
              "type": "number"
            },
            "p75": {
              "type": "number"
            }
          }
        },
        "vansky_index": {
          "type": [
            "integer",
            "null"
          ],
          "description": "VanSky climate index 0–100 (same formula as the forecast score, without sea and air quality)."
        }
      }
    },
    "days": {
      "type": "object",
      "description": "Present when `date` is omitted: 366 values per array.",
      "properties": {
        "temp_day_c": {
          "type": "array",
          "items": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "temp_night_c": {
          "type": "array",
          "items": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "precipitation_days_pct": {
          "type": "array",
          "items": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "sky": {
          "type": "array",
          "items": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "water_c": {
          "type": "array",
          "items": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "solar_kwh_m2_median": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "vansky_index": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      }
    },
    "months": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "month": {
            "type": "integer"
          },
          "temp_day_c": {
            "type": [
              "integer",
              "null"
            ]
          },
          "temp_night_c": {
            "type": [
              "integer",
              "null"
            ]
          },
          "water_c": {
            "type": [
              "integer",
              "null"
            ]
          },
          "vansky_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "avg_days": {
            "type": [
              "object",
              "null"
            ],
            "description": "Average days per year of the month: dry clear / dry cloudy / dry overcast / with precipitation.",
            "properties": {
              "clear": {
                "type": "number"
              },
              "cloudy": {
                "type": "number"
              },
              "overcast": {
                "type": "number"
              },
              "precipitation": {
                "type": "number"
              }
            }
          }
        }
      }
    },
    "best_month": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "month": {
          "type": "integer"
        },
        "vansky_index": {
          "type": "integer"
        }
      }
    },
    "good_months": {
      "type": "array",
      "items": {
        "type": "integer"
      },
      "description": "Months with a VanSky climate index of 60 or more."
    },
    "source": {
      "type": "string"
    },
    "data_license": {
      "type": "string"
    },
    "_attribution": {
      "$ref": "#/$defs/Attribution"
    }
  },
  "$defs": {
    "Attribution": {
      "type": "object",
      "properties": {
        "data_source": {
          "type": "string"
        },
        "license": {
          "type": "string"
        },
        "required": {
          "type": "boolean",
          "description": "Attribution is required by the CC BY 4.0 license."
        },
        "attribution_url": {
          "type": "string",
          "format": "uri"
        },
        "attribution_html": {
          "type": "string",
          "description": "Show this HTML visibly next to the data."
        },
        "instructions": {
          "type": "string",
          "description": "Plain-language attribution requirement for developers and AI coding agents."
        },
        "your_source": {
          "type": "string"
        }
      }
    }
  }
}