{
  "openapi": "3.1.0",
  "info": {
    "title": "polyweather OpenAPI — airport temperature & METAR API",
    "version": "2026-11-09",
    "description": "Live, minute-by-minute observed airport temperatures (runway sensors that lead the official METAR), today's running daily high on each airport's local calendar day, recent METARs and a next-METAR nowcast, across 49 airports. JSON over HTTPS; rolling window only, no bulk history.\n\nCoverage: 27 airports carry the minute-level runway feed (runway_temp_c, /window, /nowcast). The other 22 are METAR + daily-high only: 10 mainland-China airports (ZBAA, ZGGG, ZSPD, ZHHH, ZSQD, ZUUU, ZUCK, ZGSZ, ZSJN, ZHCC) and 12 METAR-only airports (EGLC, LEMD, LIMC, UUWW, OEJN, FACT, OPKC, WMKK, CYYZ, MMMX, SBGR, SAEZ). Branch on the per-city `runway` / `nowcast` booleans from GET /cities. A null means \"not available right now\", never 0.\n\nPlans: API Basic $49/mo — 60 req/min, 100,000 req/month, 1 IP per key, data endpoints. API Pro $99/mo — 300 req/min, 1,000,000 req/month, 3 IPs per key, adds /nowcast and multi-city /weather/latest. Keys are created and IP-bound at https://www.polyweather.today/developers.\n\nTemperatures are °C; timestamps are UTC ISO-8601. View-only data — not betting or financial advice.",
    "contact": {
      "name": "polyweather.today",
      "url": "https://www.polyweather.today/docs"
    }
  },
  "externalDocs": {
    "description": "Human-readable docs with examples",
    "url": "https://www.polyweather.today/docs"
  },
  "servers": [
    {
      "url": "https://www.polyweather.today/api/open/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "API Basic",
      "description": "Available on every API plan."
    },
    {
      "name": "API Pro",
      "description": "Requires API Pro."
    }
  ],
  "paths": {
    "/cities": {
      "get": {
        "operationId": "listCities",
        "summary": "List supported cities and their codes.",
        "description": "List supported cities and their codes.\n\nRequires API Basic (or higher).",
        "tags": [
          "API Basic"
        ],
        "x-plan": "basic",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Limit-Month": {
                "$ref": "#/components/headers/X-RateLimit-Limit-Month"
              },
              "X-RateLimit-Remaining-Month": {
                "$ref": "#/components/headers/X-RateLimit-Remaining-Month"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "cities": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "slug": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "airport": {
                            "type": "string"
                          },
                          "beta": {
                            "type": "boolean"
                          },
                          "runway": {
                            "type": "boolean"
                          },
                          "nowcast": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "code",
                          "slug",
                          "name",
                          "airport",
                          "beta",
                          "runway",
                          "nowcast"
                        ]
                      }
                    }
                  },
                  "required": [
                    "count",
                    "cities"
                  ]
                },
                "example": {
                  "count": 49,
                  "cities": [
                    {
                      "code": "RKSI",
                      "slug": "rksi",
                      "name": "Incheon",
                      "airport": "Incheon International Airport (RKSI)",
                      "beta": false,
                      "runway": true,
                      "nowcast": true
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "`missing_api_key / invalid_api_key / key_revoked`: Bad or missing Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "missing_api_key"
                }
              }
            }
          },
          "402": {
            "description": "`no_active_api_plan`: Plan lapsed — renew at /developers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "no_active_api_plan"
                }
              }
            }
          },
          "403": {
            "description": "`ip_not_allowed`: Request IP isn't allowlisted. The detected IP is in `detail` — bind that IP. `key_has_no_bound_ip`: The key has no IP bound yet — bind one in the developer console.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "ip_not_allowed"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Per-minute or monthly cap hit (`scope`: per-minute | monthly) — see Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "rate_limited"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/weather/{city}/latest": {
      "get": {
        "operationId": "getCityLatest",
        "summary": "Newest observation for one city.",
        "description": "Newest observation for one city.\n\nRequires API Basic (or higher).",
        "tags": [
          "API Basic"
        ],
        "x-plan": "basic",
        "parameters": [
          {
            "name": "city",
            "in": "path",
            "required": true,
            "description": "ICAO code (`RKSI`) or slug (`rksi`) — the `code` / `slug` from GET /cities.",
            "schema": {
              "type": "string"
            },
            "example": "RKSI"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Limit-Month": {
                "$ref": "#/components/headers/X-RateLimit-Limit-Month"
              },
              "X-RateLimit-Remaining-Month": {
                "$ref": "#/components/headers/X-RateLimit-Remaining-Month"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "city": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "runway_temp_c": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "latest minute-level runway-sensor mean (°C) — leads the METAR; null where cities.runway is false"
                    },
                    "runway_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time",
                      "description": "time of that runway reading (UTC)"
                    },
                    "metar_temp_c": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "latest official METAR temperature (whole °C)"
                    },
                    "metar_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time",
                      "description": "METAR observation time (UTC)"
                    },
                    "daily_high_c": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "today's running daily high — the number markets settle on. \"Today\" = the airport's local calendar day in its own time zone, DST included; routine METARs only — SPECI reports don't count (the aviationweather.gov rule for markets dated 2026-10-23 or later)"
                    },
                    "daily_high_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time",
                      "description": "when today's high was reached (UTC)"
                    },
                    "yesterday_high_c": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "yesterday's daily high (context)"
                    },
                    "conditions": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "wind_dir": {
                          "type": "number"
                        },
                        "wind_kt": {
                          "type": "number"
                        },
                        "sky": {
                          "type": "string"
                        },
                        "sky_cover": {
                          "type": "number"
                        },
                        "visibility_km": {
                          "type": "number"
                        },
                        "pressure_hpa": {
                          "type": "number"
                        },
                        "dewpoint_c": {
                          "type": "number"
                        }
                      },
                      "description": "observed wind/sky/visibility/pressure/dewpoint — each field present only when reported"
                    },
                    "source": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "METAR source: noaa | amsc"
                    },
                    "generated_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time",
                      "description": "snapshot build time (UTC)"
                    }
                  },
                  "required": [
                    "city",
                    "name",
                    "runway_temp_c",
                    "runway_at",
                    "metar_temp_c",
                    "metar_at",
                    "daily_high_c",
                    "daily_high_at",
                    "yesterday_high_c",
                    "conditions",
                    "source",
                    "generated_at"
                  ]
                },
                "example": {
                  "city": "RKSI",
                  "name": "Incheon",
                  "runway_temp_c": 23.5,
                  "runway_at": "2026-09-14T02:26:00Z",
                  "metar_temp_c": 23,
                  "metar_at": "2026-09-14T02:00:00Z",
                  "daily_high_c": 24,
                  "daily_high_at": "2026-09-14T01:30:00Z",
                  "yesterday_high_c": 24,
                  "conditions": {
                    "wind_dir": 320,
                    "wind_kt": 10,
                    "sky": "BKN",
                    "sky_cover": 3,
                    "visibility_km": 10,
                    "pressure_hpa": 1019,
                    "dewpoint_c": 19
                  },
                  "source": "noaa",
                  "generated_at": "2026-09-14T02:27:12Z"
                }
              }
            }
          },
          "401": {
            "description": "`missing_api_key / invalid_api_key / key_revoked`: Bad or missing Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "missing_api_key"
                }
              }
            }
          },
          "402": {
            "description": "`no_active_api_plan`: Plan lapsed — renew at /developers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "no_active_api_plan"
                }
              }
            }
          },
          "403": {
            "description": "`ip_not_allowed`: Request IP isn't allowlisted. The detected IP is in `detail` — bind that IP. `key_has_no_bound_ip`: The key has no IP bound yet — bind one in the developer console.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "ip_not_allowed"
                }
              }
            }
          },
          "404": {
            "description": "`unknown_city / unknown_resource`: Check the path.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "unknown_city"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Per-minute or monthly cap hit (`scope`: per-minute | monthly) — see Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "rate_limited"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "`no_snapshot / city_unavailable`: Live data momentarily unavailable for that city — retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "no_snapshot"
                }
              }
            }
          }
        }
      }
    },
    "/weather/{city}/window": {
      "get": {
        "operationId": "getCityWindow",
        "summary": "Rolling minute-by-minute series. Window only — no history beyond it.",
        "description": "Rolling minute-by-minute series. Window only — no history beyond it.\n\nRequires API Basic (or higher).",
        "tags": [
          "API Basic"
        ],
        "x-plan": "basic",
        "parameters": [
          {
            "name": "city",
            "in": "path",
            "required": true,
            "description": "ICAO code (`RKSI`) or slug (`rksi`) — the `code` / `slug` from GET /cities.",
            "schema": {
              "type": "string"
            },
            "example": "RKSI"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "points to return, default 90, max 120",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 120,
              "default": 90
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Limit-Month": {
                "$ref": "#/components/headers/X-RateLimit-Limit-Month"
              },
              "X-RateLimit-Remaining-Month": {
                "$ref": "#/components/headers/X-RateLimit-Remaining-Month"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "city": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "window_minutes": {
                      "type": "integer",
                      "description": "rolling window length — only the last ~90 min is exposed"
                    },
                    "runway_ends": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "this airport's runway-end labels"
                    },
                    "count": {
                      "type": "integer",
                      "description": "number of points returned — 0 where cities.runway is false (see Coverage)"
                    },
                    "points": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "at": {
                            "type": "string",
                            "format": "date-time",
                            "description": "minute timestamp (UTC), newest first"
                          },
                          "ends": {
                            "type": "object",
                            "additionalProperties": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "description": "per-runway-end temperature (°C)"
                          },
                          "mean": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "average across ends"
                          }
                        },
                        "required": [
                          "at",
                          "ends",
                          "mean"
                        ]
                      }
                    },
                    "generated_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "city",
                    "name",
                    "window_minutes",
                    "runway_ends",
                    "count",
                    "points",
                    "generated_at"
                  ]
                },
                "example": {
                  "city": "RKSI",
                  "name": "Incheon",
                  "window_minutes": 90,
                  "runway_ends": [
                    "15R",
                    "16L"
                  ],
                  "count": 90,
                  "points": [
                    {
                      "at": "2026-09-14T02:26:00Z",
                      "ends": {
                        "15R": 23.5,
                        "16L": 23.5
                      },
                      "mean": 23.5
                    }
                  ],
                  "generated_at": "2026-09-14T02:27:12Z"
                }
              }
            }
          },
          "401": {
            "description": "`missing_api_key / invalid_api_key / key_revoked`: Bad or missing Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "missing_api_key"
                }
              }
            }
          },
          "402": {
            "description": "`no_active_api_plan`: Plan lapsed — renew at /developers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "no_active_api_plan"
                }
              }
            }
          },
          "403": {
            "description": "`ip_not_allowed`: Request IP isn't allowlisted. The detected IP is in `detail` — bind that IP. `key_has_no_bound_ip`: The key has no IP bound yet — bind one in the developer console.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "ip_not_allowed"
                }
              }
            }
          },
          "404": {
            "description": "`unknown_city / unknown_resource`: Check the path.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "unknown_city"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Per-minute or monthly cap hit (`scope`: per-minute | monthly) — see Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "rate_limited"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "`no_snapshot / city_unavailable`: Live data momentarily unavailable for that city — retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "no_snapshot"
                }
              }
            }
          }
        }
      }
    },
    "/weather/{city}/daily-high": {
      "get": {
        "operationId": "getCityDailyHigh",
        "summary": "Today's running high so far.",
        "description": "Today's running high so far.\n\nRequires API Basic (or higher).",
        "tags": [
          "API Basic"
        ],
        "x-plan": "basic",
        "parameters": [
          {
            "name": "city",
            "in": "path",
            "required": true,
            "description": "ICAO code (`RKSI`) or slug (`rksi`) — the `code` / `slug` from GET /cities.",
            "schema": {
              "type": "string"
            },
            "example": "RKSI"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Limit-Month": {
                "$ref": "#/components/headers/X-RateLimit-Limit-Month"
              },
              "X-RateLimit-Remaining-Month": {
                "$ref": "#/components/headers/X-RateLimit-Remaining-Month"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "city": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "daily_high_c": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "today's running max (°C) — the settlement number. \"Today\" = the airport's local calendar day (its IANA zone, DST included); routine METARs only, SPECI reports don't count, and a corrected report (COR) replaces the original — the aviationweather.gov rule for markets dated 2026-10-23 or later. Exception: Hong Kong settles on the Hong Kong Observatory HQ maximum."
                    },
                    "peaked_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time",
                      "description": "time of that high (UTC)"
                    },
                    "hourly_settlement": {
                      "type": "boolean",
                      "description": "true = only on-the-hour readings count toward the high; readings between the hours are ignored. True for every China city except Beijing/Shanghai/Guangzhou."
                    },
                    "generated_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "city",
                    "name",
                    "daily_high_c",
                    "peaked_at",
                    "hourly_settlement",
                    "generated_at"
                  ]
                },
                "example": {
                  "city": "RKSI",
                  "name": "Incheon",
                  "daily_high_c": 24,
                  "peaked_at": "2026-09-14T01:30:00Z",
                  "hourly_settlement": false,
                  "generated_at": "2026-09-14T02:27:12Z"
                }
              }
            }
          },
          "401": {
            "description": "`missing_api_key / invalid_api_key / key_revoked`: Bad or missing Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "missing_api_key"
                }
              }
            }
          },
          "402": {
            "description": "`no_active_api_plan`: Plan lapsed — renew at /developers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "no_active_api_plan"
                }
              }
            }
          },
          "403": {
            "description": "`ip_not_allowed`: Request IP isn't allowlisted. The detected IP is in `detail` — bind that IP. `key_has_no_bound_ip`: The key has no IP bound yet — bind one in the developer console.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "ip_not_allowed"
                }
              }
            }
          },
          "404": {
            "description": "`unknown_city / unknown_resource`: Check the path.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "unknown_city"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Per-minute or monthly cap hit (`scope`: per-minute | monthly) — see Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "rate_limited"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "`no_snapshot / city_unavailable`: Live data momentarily unavailable for that city — retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "no_snapshot"
                }
              }
            }
          }
        }
      }
    },
    "/weather/{city}/metar": {
      "get": {
        "operationId": "getCityMetars",
        "summary": "Recent METARs (parsed temp + raw text).",
        "description": "Recent METARs (parsed temp + raw text).\n\nRequires API Basic (or higher).\n\neach station reports on its own schedule — typically half-hourly or hourly, and some issue off-schedule SPECIs (listed here, but they never count toward the daily high). Poll on the interval you see in metars[].at rather than assuming 30 min; /daily-high's hourly_settlement tells you which stations settle on the hour.",
        "tags": [
          "API Basic"
        ],
        "x-plan": "basic",
        "parameters": [
          {
            "name": "city",
            "in": "path",
            "required": true,
            "description": "ICAO code (`RKSI`) or slug (`rksi`) — the `code` / `slug` from GET /cities.",
            "schema": {
              "type": "string"
            },
            "example": "RKSI"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "count, default 8, max 24",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 24,
              "default": 8
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Limit-Month": {
                "$ref": "#/components/headers/X-RateLimit-Limit-Month"
              },
              "X-RateLimit-Remaining-Month": {
                "$ref": "#/components/headers/X-RateLimit-Remaining-Month"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "city": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "metars": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "at": {
                            "type": "string",
                            "format": "date-time",
                            "description": "observation time (UTC)"
                          },
                          "temp_c": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "METAR temperature (°C)"
                          },
                          "raw": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "raw METAR text"
                          },
                          "source": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "data source"
                          }
                        },
                        "required": [
                          "at",
                          "temp_c",
                          "raw",
                          "source"
                        ]
                      }
                    },
                    "generated_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "city",
                    "name",
                    "metars",
                    "generated_at"
                  ]
                },
                "example": {
                  "city": "RKSI",
                  "name": "Incheon",
                  "metars": [
                    {
                      "at": "2026-09-14T02:00:00Z",
                      "temp_c": 23,
                      "raw": "METAR RKSI 140200Z 32010KT 9999 FEW025 BKN200 23/19 Q1019 NOSIG",
                      "source": "noaa"
                    }
                  ],
                  "generated_at": "2026-09-14T02:27:12Z"
                }
              }
            }
          },
          "401": {
            "description": "`missing_api_key / invalid_api_key / key_revoked`: Bad or missing Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "missing_api_key"
                }
              }
            }
          },
          "402": {
            "description": "`no_active_api_plan`: Plan lapsed — renew at /developers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "no_active_api_plan"
                }
              }
            }
          },
          "403": {
            "description": "`ip_not_allowed`: Request IP isn't allowlisted. The detected IP is in `detail` — bind that IP. `key_has_no_bound_ip`: The key has no IP bound yet — bind one in the developer console.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "ip_not_allowed"
                }
              }
            }
          },
          "404": {
            "description": "`unknown_city / unknown_resource`: Check the path.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "unknown_city"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Per-minute or monthly cap hit (`scope`: per-minute | monthly) — see Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "rate_limited"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "`no_snapshot / city_unavailable`: Live data momentarily unavailable for that city — retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "no_snapshot"
                }
              }
            }
          }
        }
      }
    },
    "/weather/{city}/nowcast": {
      "get": {
        "operationId": "getCityNowcast",
        "summary": "Next-METAR forecast: prediction, probability distribution, decision light.",
        "description": "Next-METAR forecast: prediction, probability distribution, decision light.\n\nRequires API Pro (or higher).",
        "tags": [
          "API Pro"
        ],
        "x-plan": "pro",
        "parameters": [
          {
            "name": "city",
            "in": "path",
            "required": true,
            "description": "ICAO code (`RKSI`) or slug (`rksi`) — the `code` / `slug` from GET /cities.",
            "schema": {
              "type": "string"
            },
            "example": "RKSI"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Limit-Month": {
                "$ref": "#/components/headers/X-RateLimit-Limit-Month"
              },
              "X-RateLimit-Remaining-Month": {
                "$ref": "#/components/headers/X-RateLimit-Remaining-Month"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "city": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "nowcast": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "model": {
                          "type": "string"
                        },
                        "pred_int": {
                          "type": "number",
                          "description": "predicted NEXT METAR, rounded (°C)"
                        },
                        "pred_float": {
                          "type": "number",
                          "description": "predicted, unrounded"
                        },
                        "h_min": {
                          "type": "integer",
                          "description": "horizon: minutes until the next METAR"
                        },
                        "next_metar_at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "expected next METAR time (UTC)"
                        },
                        "p_hit": {
                          "type": "number",
                          "description": "calibrated probability pred_int is exactly right"
                        },
                        "p_hit_raw": {
                          "type": "number",
                          "description": "same, before the daily monotone calibration"
                        },
                        "gamma": {
                          "type": "number",
                          "description": "slope-damping factor applied at this hour"
                        },
                        "ladder": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "t": {
                                "type": "number"
                              },
                              "p": {
                                "type": "number"
                              }
                            }
                          },
                          "description": "full probability distribution: { t: temp, p: probability }"
                        },
                        "light": {
                          "type": "string",
                          "enum": [
                            "green",
                            "yellow",
                            "red"
                          ],
                          "description": "decision light green / yellow / red (signal reliability)"
                        }
                      },
                      "description": "null when the city has no runway feed (cities.nowcast false), the feed is stale, or the next METAR is outside the model's horizon"
                    },
                    "slope_30": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "runway-temp slope, °C per 30 min (signed)"
                    },
                    "regime": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "flat",
                        "mid",
                        "fast"
                      ],
                      "description": "flat | mid | fast"
                    },
                    "forecast": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "high_c": {
                          "type": "number"
                        },
                        "peak_hour_local": {
                          "type": "string"
                        },
                        "cloud_pct_peak": {
                          "type": "number"
                        },
                        "models": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "high": {
                                "type": "number"
                              }
                            }
                          }
                        },
                        "tomorrow_high_c": {
                          "type": "number"
                        }
                      },
                      "description": "Open-Meteo model guidance: high_c, peak_hour_local, cloud_pct_peak, models[], tomorrow_high_c"
                    },
                    "generated_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "city",
                    "name",
                    "nowcast",
                    "slope_30",
                    "regime",
                    "forecast",
                    "generated_at"
                  ]
                },
                "example": {
                  "city": "RKSI",
                  "name": "Incheon",
                  "nowcast": {
                    "model": "anchor-v3",
                    "pred_int": 24,
                    "pred_float": 23.51,
                    "h_min": 4,
                    "next_metar_at": "2026-09-14T02:30:00Z",
                    "p_hit": 0.514,
                    "p_hit_raw": 0.482,
                    "gamma": 0.73,
                    "ladder": [
                      {
                        "t": 23,
                        "p": 0.518
                      },
                      {
                        "t": 24,
                        "p": 0.482
                      }
                    ],
                    "light": "red"
                  },
                  "slope_30": 0,
                  "regime": "flat",
                  "forecast": {
                    "high_c": 25,
                    "peak_hour_local": "15:00",
                    "cloud_pct_peak": 57,
                    "models": [
                      {
                        "name": "ECMWF",
                        "high": 25.5
                      },
                      {
                        "name": "GFS",
                        "high": 23.6
                      }
                    ],
                    "tomorrow_high_c": 24.6
                  },
                  "generated_at": "2026-09-14T02:27:12Z"
                }
              }
            }
          },
          "401": {
            "description": "`missing_api_key / invalid_api_key / key_revoked`: Bad or missing Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "missing_api_key"
                }
              }
            }
          },
          "402": {
            "description": "`no_active_api_plan`: Plan lapsed — renew at /developers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "no_active_api_plan"
                }
              }
            }
          },
          "403": {
            "description": "`ip_not_allowed`: Request IP isn't allowlisted. The detected IP is in `detail` — bind that IP. `key_has_no_bound_ip`: The key has no IP bound yet — bind one in the developer console. `plan_upgrade_required`: Endpoint needs API Pro (nowcast, multi-city).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "ip_not_allowed"
                }
              }
            }
          },
          "404": {
            "description": "`unknown_city / unknown_resource`: Check the path.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "unknown_city"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Per-minute or monthly cap hit (`scope`: per-minute | monthly) — see Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "rate_limited"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "`no_snapshot / city_unavailable`: Live data momentarily unavailable for that city — retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "no_snapshot"
                }
              }
            }
          }
        }
      }
    },
    "/weather/latest": {
      "get": {
        "operationId": "getAllLatest",
        "summary": "Every city's latest in one call.",
        "description": "Every city's latest in one call.\n\nRequires API Pro (or higher).",
        "tags": [
          "API Pro"
        ],
        "x-plan": "pro",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Limit-Month": {
                "$ref": "#/components/headers/X-RateLimit-Limit-Month"
              },
              "X-RateLimit-Remaining-Month": {
                "$ref": "#/components/headers/X-RateLimit-Remaining-Month"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "generated_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "cities": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "city": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "runway_temp_c": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "metar_temp_c": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "daily_high_c": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "daily_high_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          }
                        },
                        "description": "per city: runway_temp_c, metar_temp_c, daily_high_c, daily_high_at",
                        "required": [
                          "city",
                          "name",
                          "runway_temp_c",
                          "metar_temp_c",
                          "daily_high_c",
                          "daily_high_at"
                        ]
                      }
                    }
                  },
                  "required": [
                    "count",
                    "generated_at",
                    "cities"
                  ]
                },
                "example": {
                  "count": 49,
                  "generated_at": "2026-09-14T02:27:12Z",
                  "cities": [
                    {
                      "city": "RKSI",
                      "name": "Incheon",
                      "runway_temp_c": 23.5,
                      "metar_temp_c": 23,
                      "daily_high_c": 24,
                      "daily_high_at": "2026-09-14T01:30:00Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "`missing_api_key / invalid_api_key / key_revoked`: Bad or missing Authorization header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "missing_api_key"
                }
              }
            }
          },
          "402": {
            "description": "`no_active_api_plan`: Plan lapsed — renew at /developers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "no_active_api_plan"
                }
              }
            }
          },
          "403": {
            "description": "`ip_not_allowed`: Request IP isn't allowlisted. The detected IP is in `detail` — bind that IP. `key_has_no_bound_ip`: The key has no IP bound yet — bind one in the developer console. `plan_upgrade_required`: Endpoint needs API Pro (nowcast, multi-city).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "ip_not_allowed"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Per-minute or monthly cap hit (`scope`: per-minute | monthly) — see Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "rate_limited"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key (`pmw_live_…`) in `Authorization: Bearer …`. Each key only works from the IP(s) bound to it."
      }
    },
    "headers": {
      "X-RateLimit-Limit": {
        "description": "Requests allowed per minute on this plan.",
        "schema": {
          "type": "integer"
        }
      },
      "X-RateLimit-Remaining": {
        "description": "Requests left in the current minute.",
        "schema": {
          "type": "integer"
        }
      },
      "X-RateLimit-Limit-Month": {
        "description": "Requests allowed per month on this plan.",
        "schema": {
          "type": "integer"
        }
      },
      "X-RateLimit-Remaining-Month": {
        "description": "Requests left this month.",
        "schema": {
          "type": "integer"
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Machine-readable error code (see the response descriptions)."
          },
          "detail": {
            "type": "string",
            "description": "Extra context, e.g. the detected IP for ip_not_allowed."
          },
          "scope": {
            "type": "string",
            "enum": [
              "per-minute",
              "monthly"
            ],
            "description": "Which cap was hit (rate_limited only)."
          }
        }
      }
    }
  }
}