{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/snowsure-ai/json-schema/snowsure-ai-resorts-response-schema.json",
  "title": "ResortsResponse",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/snowsure-ai-openapi.json#/components/schemas/ResortsResponse",
  "type": "object",
  "properties": {
    "meta": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time"
        },
        "total": {
          "type": "integer",
          "description": "Resorts matching the query across every page, not the rows in this response (see count). With no filters this is the size of the fleet."
        },
        "count": {
          "type": "integer",
          "description": "Rows in this response."
        },
        "region": {
          "type": "string",
          "description": "Region filter applied"
        }
      }
    },
    "data": {
      "type": "array",
      "items": {
        "allOf": [
          {
            "$ref": "#/$defs/Resort"
          },
          {
            "type": "object",
            "properties": {
              "operations": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "Live lift and run counts. Counts are null when the resort is closed for the season.",
                "properties": {
                  "liftsOpen": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "liftsTotal": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "runsOpen": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "runsTotal": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "liftPercentOpen": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "description": "Percentage of lifts open (0-100), rounded, the same value as operations.liftPercentOpen on /api/v1/resorts/{slug}. null when the resort is not in season, is on a closed hold, or reports no lift counts. Render it; do not derive it from liftsOpen / liftsTotal."
                  }
                }
              },
              "conditions": {
                "type": "object",
                "properties": {
                  "seasonTotalCm": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Season-to-date snowfall (cm): the operator-reported season total when present, otherwise the modelled season sum, floored at the base depth for an open resort. The same arithmetic as snow.seasonTotalCm on /api/v1/resorts/{slug}. null when unknown."
                  },
                  "lastUpdated": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "When the data behind this row was captured: the later of the weather snapshot's capture time and its lift-data update time. Never the request time and never a time in the future. Equal to currentConditions.lastUpdated on /api/v1/resorts/{slug} for the same resort. null when the resort has no snapshot or the snapshot carries neither time."
                  }
                }
              },
              "dailyForecast": {
                "type": [
                  "object",
                  "null"
                ],
                "description": "Only present with include=dailyForecast. null when SnowSure has no forecast snapshot for the resort; never an estimated series.",
                "properties": {
                  "daily": {
                    "type": "array",
                    "maxItems": 14,
                    "items": {
                      "type": "object",
                      "properties": {
                        "date": {
                          "type": "string",
                          "format": "date",
                          "description": "Resort-local calendar date."
                        },
                        "snowfall": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Blended snowfall for the day (cm): the mean over the models covering it, else the stored day's value. Equal to forecast.daily[].snowfall on /api/v1/resorts/{slug}."
                        }
                      }
                    }
                  },
                  "next48hCm": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "description": "Snowfall forecast for resort-local today plus tomorrow (cm, 1 dp): the sum of the first two `daily` rows. null when neither day has a value."
                  }
                }
              }
            }
          }
        ]
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Opaque cursor for the next page; null when no further pages. Only present when the request used the cursor or limit query parameter."
    }
  },
  "$defs": {
    "ForecastBandWeek": {
      "type": [
        "object",
        "null"
      ],
      "description": "One reporting height's free seven days on a list row (SS-W-2343). null when the band has no run (fewer than two models, or no height for it) — never 0.",
      "properties": {
        "band": {
          "type": "string",
          "enum": [
            "base",
            "mid",
            "summit"
          ]
        },
        "elevationM": {
          "type": [
            "number",
            "null"
          ],
          "description": "Metres above sea level the band's run was made at."
        },
        "elevationFt": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The same height in feet, rounded."
        },
        "total7dCm": {
          "type": "number",
          "description": "Forward seven-day total (cm, 1 dp) of this band's per-height run, from the resort's local today with Today starting at 6am — the same figure `/api/v1/resorts/{slug}` serves as `forecast.bands.bands.<band>.total7dCm`. 0 is a forecast of no snow."
        }
      },
      "required": [
        "band",
        "elevationM",
        "elevationFt",
        "total7dCm"
      ]
    },
    "Resort": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Resort name"
        },
        "slug": {
          "type": "string",
          "description": "URL-friendly identifier"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Alternate slugs that resolve to this resort on /api/v1/resorts/{slug}. The list emits only canonical slugs, so match against slug AND aliases before concluding a resort is absent."
        },
        "country": {
          "type": "string",
          "description": "Country where the resort is located"
        },
        "region": {
          "type": "string",
          "description": "Geographic region"
        },
        "coordinates": {
          "type": "object",
          "properties": {
            "lat": {
              "type": "number",
              "description": "Latitude"
            },
            "lng": {
              "type": "number",
              "description": "Longitude"
            }
          }
        },
        "elevation": {
          "type": "object",
          "properties": {
            "summit": {
              "type": "integer",
              "description": "Summit elevation in meters"
            },
            "base": {
              "type": "integer",
              "description": "Base elevation in meters"
            },
            "vertical": {
              "type": "integer",
              "description": "Vertical drop in meters"
            }
          }
        },
        "stats": {
          "type": "object",
          "properties": {
            "runs": {
              "type": "integer",
              "description": "Number of ski runs"
            },
            "lifts": {
              "type": "integer",
              "description": "Number of lifts"
            },
            "skiableAcres": {
              "type": "integer",
              "description": "Skiable terrain in acres"
            },
            "pisteKm": {
              "type": [
                "number",
                "null"
              ],
              "description": "Total marked piste length in km, as the resort publishes it. A length, never an area. Null when unknown. Detail response only."
            },
            "annualSnowfall": {
              "type": "string",
              "description": "Average annual snowfall"
            }
          }
        },
        "conditions": {
          "type": "object",
          "properties": {
            "snowDepthCm": {
              "type": "number",
              "description": "Current BASE-band snow depth in centimeters — the value sort=depth ranks on. A measured mid/summit headline is on /resorts/{slug} only, so the board stays like-for-like."
            },
            "snowDepthElevationBand": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "base",
                null
              ],
              "description": "Always base when snowDepthCm is set (SS-W-201 ranking rule)."
            },
            "snowfall24hCm": {
              "type": [
                "number",
                "null"
              ],
              "description": "Snowfall in last 24 hours (cm). null when it is not yet known; snowfall24hUnknownReason says why. A missing reading is never published as 0 (SS-W-2134)."
            },
            "snowfall24hUnknownReason": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "no_snow_data",
                "pending_after_forecast_snow",
                null
              ],
              "description": "Why snowfall24hCm is null: no_snow_data (the row carries no 24h reading at all) or pending_after_forecast_snow (the lane read 0 cm while 20 cm or more of forecast snow was due in the window, so the day has not filled in yet). null whenever snowfall24hCm carries a figure (SS-W-2134)."
            },
            "snowfall7dCm": {
              "type": "number",
              "description": "Snowfall in the PAST 7 days (cm). Not to be confused with forecast7dCm, which is the week ahead."
            },
            "forecastPoint": {
              "type": [
                "object",
                "null"
              ],
              "description": "The one elevation every forecast figure here was made at (SS-W-2268): metres, feet and the band — the same object on the detail, the lists, the mobile app and every MCP forecast tool. Print this height beside a total; never derive one from the resort's base and summit. null when the snapshot carries no height.",
              "properties": {
                "elevationM": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "Metres above sea level."
                },
                "elevationFt": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "The same height in feet, rounded."
                },
                "band": {
                  "type": "string",
                  "enum": [
                    "base",
                    "mid",
                    "summit",
                    "mid-upper"
                  ],
                  "description": "Which reporting height the point is; `mid-upper` only on snapshots written between 2026-10-13 and 2026-10-18."
                }
              },
              "required": [
                "elevationM",
                "elevationFt",
                "band"
              ]
            },
            "forecast7dBands": {
              "type": [
                "object",
                "null"
              ],
              "description": "The free seven days at each reporting height (SS-W-2343), with the elevation each run was made at. Rain at the base can be snow at the summit on the same day, so a single forward-week number hides the difference that matters; print the height beside each figure. Each band is the per-height run's own week (not the headline blend), so under an ML-promoted headline the summit can differ from `forecast7dCm`. Not gated: seven days is the free window. null when the row carries no band (a resort with no runs, or a snapshot written before the columns).",
              "properties": {
                "base": {
                  "$ref": "#/$defs/ForecastBandWeek"
                },
                "mid": {
                  "$ref": "#/$defs/ForecastBandWeek"
                },
                "summit": {
                  "$ref": "#/$defs/ForecastBandWeek"
                }
              },
              "required": [
                "base",
                "mid",
                "summit"
              ]
            },
            "forecast7dCm": {
              "type": [
                "number",
                "null"
              ],
              "description": "FORWARD 7-day blended snowfall forecast (cm) — the industry comparison window, and the field sort=forecast7d ranks on. Equals the sum of the first 7 daily rows from the forecast endpoint, to 0.1cm. null (never 0) when the blend has no data for this resort; 0 means a forecast of no snow."
            },
            "forecastPeak": {
              "type": [
                "object",
                "null"
              ],
              "description": "The single biggest snowfall day inside the forward 7-day window — forecast7dCm's window, NOT forecast14dCm's. null when no snow is forecast. Since SS-W-207 the object carries windowDays so the pair can never be read against the wrong total.",
              "properties": {
                "date": {
                  "type": "string",
                  "format": "date"
                },
                "cm": {
                  "type": "number"
                },
                "windowDays": {
                  "type": "integer",
                  "description": "How many forward days this peak was the biggest of. Always 7 on this object. For the biggest day of a 14-day total, read forecast.peak on /api/v1/resorts/{slug}, which is chosen from the daily rows that endpoint serves and carries its own windowDays."
                }
              }
            },
            "forecastHorizonDays": {
              "type": "integer",
              "enum": [
                7,
                14
              ],
              "description": "How many forward days `forecast14dCm` covers for THIS caller (SS-W-318, SS-W-378). 14 for an entitled caller — SnowSure Pro, or a resort in a signed-in reader's My Mountains; 7 otherwise, and then `forecast14dCm` holds the seven-day total, the same figure as `forecast7dCm`. Read this before naming the number: a seven-day total must never be labelled as a fortnight."
            },
            "forecast14dCm": {
              "type": [
                "number",
                "null"
              ],
              "description": "Sum over the forecast horizon the caller is entitled to; equals `forecast7dCm` when `forecastHorizonDays` is 7 (anonymous and free callers). Read `forecastHorizonDays` before calling this a 14-day total (SS-W-1460). The blended forecast total (cm, 1 dp) over the window `forecastHorizonDays` states: the forward 14 days for an entitled caller, or the free seven days — equal to `forecast7dCm` — for one without the fortnight. The key keeps its name so existing consumers keep reading a number. For an entitled caller it is the same value as forecast.total14dCm on /api/v1/resorts/{slug}. A per-day blend over the models covering each day, so it can sit outside the per-model totals, which each cover only their own model's horizon. null (never 0) when the blend has no data."
            },
            "temperature": {
              "type": "number",
              "description": "Current temperature in Celsius"
            },
            "weatherConditions": {
              "type": "string",
              "description": "Current weather description"
            }
          }
        },
        "snowSure": {
          "type": "object",
          "properties": {
            "score": {
              "type": "integer",
              "description": "SnowSure Score (0-100)",
              "minimum": 0,
              "maximum": 100
            },
            "rating": {
              "type": [
                "string",
                "null"
              ],
              "description": "Rating label for `score`, from SnowSure's score bands. null when the resort is unscored, or when the rating is withheld because the resort is not operating today.",
              "enum": [
                "Outstanding",
                "Superb",
                "Excellent",
                "Good",
                "Solid",
                "Fair",
                "Limited",
                null
              ]
            },
            "ratingColor": {
              "type": [
                "string",
                "null"
              ],
              "description": "Hex colour of `rating`'s band, from the same SnowSure score bands as the label. Every band has its own colour: Outstanding #0ea5e9 · Superb #22c55e · Excellent #10b981 · Good #14b8a6 · Solid #0d9488 · Fair #f59e0b · Limited #94a3b8 (each is at least 4.5:1 against a slate-900 #0f172a background). Render this colour rather than mapping labels to colours yourself, so a change to the bands reaches every partner at once. null exactly when `rating` is null.",
              "enum": [
                "#0ea5e9",
                "#22c55e",
                "#10b981",
                "#14b8a6",
                "#0d9488",
                "#f59e0b",
                "#94a3b8",
                null
              ]
            },
            "tagline": {
              "type": [
                "string",
                "null"
              ],
              "description": "SnowSure's published condition summary. On /api/v1/resorts it is the same value as snowSure.tagline on /api/v1/resorts/{slug}, and null when the detail publishes no snowSure block (closed, pre-season or post-season)."
            },
            "trend": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "improving",
                "stable",
                "declining",
                null
              ],
              "description": "SnowSure's published trend. On /api/v1/resorts it is the same value as snowSure.trend on /api/v1/resorts/{slug}; null when that detail block is null."
            }
          }
        },
        "links": {
          "type": "object",
          "description": "Official resort links. Every field except `snowsure` is nullable: a value is only returned when it validates as a real URL, so absence means \"not known\" rather than \"not applicable\". Coverage of 445 resorts as of 2026-07-28 — website 429, instagram 364, trailMap 429, webcamPage 413, trailMapPdf 10.",
          "properties": {
            "website": {
              "type": [
                "string",
                "null"
              ],
              "format": "uri",
              "description": "Resort official website"
            },
            "instagram": {
              "type": [
                "string",
                "null"
              ],
              "format": "uri",
              "description": "Canonical profile URL, always in the form https://instagram.com/<handle> regardless of how it is stored"
            },
            "trailMap": {
              "type": [
                "string",
                "null"
              ],
              "format": "uri",
              "description": "Trail map image or page URL"
            },
            "trailMapPdf": {
              "type": [
                "string",
                "null"
              ],
              "format": "uri",
              "description": "Trail map PDF, when one is published separately from trailMap"
            },
            "trailMaps": {
              "type": [
                "array",
                "null"
              ],
              "description": "Additional named trail maps, when the resort publishes more than one",
              "items": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string",
                    "format": "uri"
                  }
                }
              }
            },
            "webcamPage": {
              "type": [
                "string",
                "null"
              ],
              "format": "uri",
              "description": "Resort webcam landing page"
            },
            "snowsure": {
              "type": "string",
              "format": "uri",
              "description": "SnowSure resort page URL"
            }
          }
        },
        "apresSki": {
          "type": "object",
          "description": "Après-ski editorial. Generated prose, not a measured fact — deliberately separate from `links` and from `stats`.",
          "properties": {
            "top": {
              "type": [
                "string",
                "null"
              ],
              "description": "Leading après-ski venue and a short description of it"
            }
          }
        },
        "heroImage": {
          "type": "string",
          "format": "uri",
          "description": "Resort hero image URL"
        },
        "isOpen": {
          "type": "boolean",
          "description": "True if the resort is currently open for skiing today. Year-round glacier resorts (Matterhorn Ski Paradise, Saas-Fee, Hintertux, Cervinia) always return true regardless of seasonClosingDate."
        },
        "status": {
          "type": [
            "string",
            "null"
          ],
          "description": "Editorial status from CMS: typically 'Live', 'Active', 'Data Collection', or 'Archived'. Anything other than the first three is treated as closed."
        },
        "seasonClosingDate": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "description": "Scheduled or operator-confirmed end-of-season date (YYYY-MM-DD). Resorts past this date are treated as closed unless flagged as year-round."
        },
        "closure": {
          "type": [
            "object",
            "null"
          ],
          "description": "Closure metadata, null when the resort is open. /api/v1/resorts serves the same object as /api/v1/resorts/{slug}: isClosed true for a closed season, false (with a reason and label) for a resort that is not open but not season-ended.",
          "properties": {
            "isClosed": {
              "type": "boolean"
            },
            "reason": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "editorial",
                "season-end",
                "pre-season",
                "out-of-season",
                "not-operating",
                "unknown",
                null
              ],
              "description": "Why the resort is not open. 'season-end' = past seasonClosingDate; 'pre-season' = before its opening; 'editorial' = status not operational; 'out-of-season' = hemisphere off-season; 'not-operating' = in its window but not operating; 'unknown' = no season dates and no operating signal."
            },
            "label": {
              "type": [
                "string",
                "null"
              ],
              "description": "Human-readable close label, e.g. 'Closed for the season since May 3'."
            }
          }
        }
      }
    }
  }
}