{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/spotwatts-com/json-schema/spotwatts-com-day-schema.json",
  "title": "Day",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/spotwatts-com-openapi.json#/components/schemas/Day",
  "type": "object",
  "properties": {
    "zone": {
      "type": "string"
    },
    "country": {
      "type": "string"
    },
    "timezone": {
      "type": "string"
    },
    "currency": {
      "type": "string",
      "enum": [
        "NOK",
        "SEK",
        "DKK",
        "EUR"
      ]
    },
    "unit": {
      "type": "string"
    },
    "date": {
      "type": "string",
      "format": "date"
    },
    "vat_rate": {
      "type": "number",
      "description": "Percent; 0 in NO4."
    },
    "exchange_rate": {
      "type": "object",
      "description": "ECB rate per 1 EUR known at the day's auction (date null for EUR).",
      "properties": {
        "eur": {
          "type": "number"
        },
        "date": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        }
      }
    },
    "resolution": {
      "type": "integer",
      "enum": [
        15,
        60
      ],
      "description": "Interval minutes: 15 since 1.10.2025, 60 before."
    },
    "average": {
      "type": "object",
      "properties": {
        "price": {
          "type": "number"
        },
        "price_vat": {
          "type": "number"
        },
        "eur_mwh": {
          "type": "number"
        }
      }
    },
    "min": {
      "$ref": "#/$defs/Interval"
    },
    "max": {
      "$ref": "#/$defs/Interval"
    },
    "cheapest_windows": {
      "type": "array",
      "description": "Cheapest continuous 1–4 hours starting within the day.",
      "items": {
        "allOf": [
          {
            "$ref": "#/$defs/Interval"
          },
          {
            "type": "object",
            "properties": {
              "hours": {
                "type": "integer"
              }
            }
          }
        ]
      }
    },
    "intervals": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Interval"
      }
    },
    "hours": {
      "type": "array",
      "description": "Hourly averages.",
      "items": {
        "$ref": "#/$defs/Interval"
      }
    },
    "page": {
      "type": "string",
      "format": "uri"
    },
    "source": {
      "type": "string"
    },
    "attribution": {
      "$ref": "#/$defs/Attribution"
    }
  },
  "$defs": {
    "Attribution": {
      "type": "object",
      "description": "The link the terms of use ask for. A one-zone response links the zone's page, others the home.",
      "properties": {
        "text": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "html": {
          "type": "string"
        }
      }
    },
    "Interval": {
      "type": "object",
      "properties": {
        "start": {
          "type": "string",
          "format": "date-time",
          "description": "Local time with offset."
        },
        "end": {
          "type": "string",
          "format": "date-time"
        },
        "price": {
          "type": "number",
          "description": "Currency per kWh, excl. VAT."
        },
        "price_vat": {
          "type": "number",
          "description": "Currency per kWh, inc. VAT."
        },
        "eur_mwh": {
          "type": "number",
          "description": "Day-ahead price in EUR/MWh, as published."
        }
      }
    }
  }
}