{
  "openapi": "3.1.0",
  "info": {
    "title": "Local Climate Trend API",
    "description": "Returns a smoothed trend for a climate metric at a location from observed station data. Pre-launch design; endpoints are not live yet.",
    "version": "0.1.0",
    "x-planned-pricing": {
      "model": "free tier for evaluation, paid tiers by volume",
      "status": "planned; nothing charged before launch"
    }
  },
  "servers": [
    {
      "url": "https://openapiregistry.com/api/v1/weather-climate-trend",
      "description": "Pre-launch: endpoints are not live yet and answer 503."
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/trend": {
      "get": {
        "summary": "Local climate trend",
        "description": "Returns a smoothed trend for a climate metric at a location from station observations.",
        "tags": [
          "climate/energy"
        ],
        "operationId": "weather-climate-trend-get-trend",
        "parameters": [
          {
            "name": "postcode",
            "in": "query",
            "required": true,
            "description": "Location postcode.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "metric",
            "in": "query",
            "required": true,
            "description": "Metric, e.g. tmax, rain.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Start year.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Trend returned.",
            "content": {
              "application/json": {
                "example": {
                  "deltaC": 0.6,
                  "direction": "warming",
                  "years": 24
                },
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "No station data for location."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Planned for launch: an API key issued on request. Free tier for evaluation, paid tiers by volume; nothing is charged before launch."
      }
    }
  }
}
