{
  "openapi": "3.1.0",
  "info": {
    "title": "mugilu: India's open sky",
    "version": "1.0.0",
    "description": "Give any point in India and get what the sky is doing right now: air, heat (with wet-bulb), rain, UV, dust, fire-smoke, and official NDMA warnings, plus a persona-weighted Ambient read. Informational only, not for medical, emergency, or safety-critical use. Freshness: readings recompute on a ~15-minute cycle (air and warnings change hourly, weather at most every 15 min). Each response carries refresh_after_seconds and a matching Cache-Control max-age; poll at most once every 15 minutes per place, faster returns identical data.",
    "license": {
      "name": "Sources keep their own licence; see /terms",
      "url": "https://mugilu.live/terms"
    },
    "contact": {
      "url": "https://mugilu.live"
    }
  },
  "servers": [
    {
      "url": "https://mugilu.live"
    }
  ],
  "paths": {
    "/c/{coord}.json": {
      "get": {
        "operationId": "conditionsAt",
        "summary": "Sky conditions at a coordinate, right now (mugilu/conditions v1).",
        "parameters": [
          {
            "name": "coord",
            "in": "path",
            "required": true,
            "description": "lat,lon (e.g. \"12.97,77.59\").",
            "schema": {
              "type": "string"
            },
            "example": "12.97,77.59"
          },
          {
            "name": "as",
            "in": "query",
            "required": false,
            "description": "Weight the Ambient read for a vulnerability.",
            "schema": {
              "type": "string",
              "enum": [
                "asthma",
                "elderly",
                "child",
                "outdoor",
                "heart"
              ]
            }
          },
          {
            "name": "ref",
            "in": "query",
            "required": false,
            "description": "Identify your app/site (aggregate attribution).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A versioned conditions object: air, heat, rain, uv, dust, wind, visibility, smoke, warnings, and an ambient read.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/near": {
      "get": {
        "operationId": "nearestStations",
        "summary": "Nearest measured air-quality stations to a point.",
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "lon",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "n",
            "in": "query",
            "required": false,
            "description": "How many (1-50, default 5).",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The nearest stations with distance and current AQI.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/suggest": {
      "get": {
        "operationId": "searchPlace",
        "summary": "Resolve an Indian place name to candidates (name, coordinate).",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Candidate places.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/index.json": {
      "get": {
        "operationId": "airLeaderboard",
        "summary": "National air leaderboard (all reporting stations).",
        "responses": {
          "200": {
            "description": "The current air snapshot.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/warnings.json": {
      "get": {
        "operationId": "activeWarnings",
        "summary": "Active official NDMA/IMD warnings across India.",
        "responses": {
          "200": {
            "description": "The current warnings snapshot.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  }
}