{
  "openapi": "3.1.0",
  "info": {
    "title": "Agoodeal Weather API",
    "version": "1.0.0",
    "description": "Read-only JSON combining Hong Kong Observatory open data. The current weather report and nine-day forecast are required; local forecast, warning summary and rainfall nowcast are optional and flagged in availability. Experimental public contract.",
    "termsOfService": "https://data.gov.hk/en/terms-and-conditions"
  },
  "servers": [
    {
      "url": "https://www.agoodeal.com"
    }
  ],
  "externalDocs": {
    "description": "Official source",
    "url": "https://data.gov.hk/en-data/dataset/hk-hko-rss-current-weather-report"
  },
  "paths": {
    "/api/weather.json": {
      "get": {
        "operationId": "get_weather",
        "summary": "Hong Kong Observatory current weather, forecasts, warnings and rainfall nowcast",
        "description": "No parameters, authentication or API key. Responses are cached publicly (s-maxage=600, stale-while-revalidate=1200); compare fetchedAt with HKO times. Successful and failed bodies follow the linked JSON Schema; check ok before reading data.",
        "responses": {
          "200": {
            "description": "ok: true. Official data with source, update and freshness fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://www.agoodeal.com/schemas/weather-v1.schema.json"
                }
              }
            }
          },
          "502": {
            "description": "ok: false, errorCode upstream_unavailable. A required official source could not be read; Cache-Control: no-store; no substitute data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://www.agoodeal.com/schemas/weather-v1.schema.json"
                }
              }
            }
          }
        }
      }
    }
  }
}
