{
  "openapi": "3.1.0",
  "info": { "title": "EESQueue API", "version": "1.0.0", "description": "Live and typical EU Entry/Exit System (EES) queue times for Schengen airports. No auth required.", "termsOfService": "https://eesqueue.com/enterprise", "license": { "name": "Free for non-commercial use; commercial use requires an Enterprise licence", "url": "https://eesqueue.com/enterprise" } },
  "servers": [{ "url": "https://eesqueue.com/api/v1" }],
  "components": {
    "schemas": {
      "Estimate": {
        "type": "object",
        "properties": {
          "waitMinutes": { "type": ["integer", "null"] },
          "confidence": { "type": "string", "enum": ["official", "live", "typical", "unknown"] },
          "reportCount": { "type": "integer" },
          "lastUpdated": { "type": ["string", "null"] }
        }
      },
      "Airport": {
        "type": "object",
        "properties": {
          "iata": { "type": "string" }, "slug": { "type": "string" }, "name": { "type": "string" },
          "city": { "type": "string" }, "country": { "type": "string" }, "countryCode": { "type": "string" },
          "status": { "type": "string" },
          "entry": { "$ref": "#/components/schemas/Estimate" },
          "exit": { "$ref": "#/components/schemas/Estimate" },
          "curated": { "type": "object" },
          "lastVerified": { "type": "string" }
        }
      }
    }
  },
  "paths": {
    "/airports": {
      "get": {
        "summary": "All tracked airports with EES status and wait estimates",
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": {
          "updatedAt": { "type": "string" }, "liveDataCount": { "type": "integer" },
          "airports": { "type": "array", "items": { "$ref": "#/components/schemas/Airport" } } } } } } } }
      }
    },
    "/airports/{iata}": {
      "get": {
        "summary": "One airport",
        "parameters": [{ "name": "iata", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": {
          "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": {
            "updatedAt": { "type": "string" }, "airport": { "$ref": "#/components/schemas/Airport" } } } } } },
          "404": { "description": "Unknown airport" }
        }
      }
    },
    "/airports/{iata}/flight-volume": {
      "get": {
        "summary": "Hourly flight volume, delay stats and a flight-modelled queue estimate",
        "parameters": [{ "name": "iata", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": { "200": { "description": "OK" }, "404": { "description": "Unknown airport" } }
      }
    },
    "/reports": {
      "post": {
        "summary": "Submit a crowd-sourced EES wait report (shown once verified)",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["iata", "direction", "waitMinutes"], "properties": {
          "iata": { "type": "string" }, "direction": { "type": "string", "enum": ["entry", "exit"] }, "waitMinutes": { "type": "integer", "minimum": 0, "maximum": 240 } } } } } },
        "responses": { "201": { "description": "Accepted" }, "400": { "description": "Invalid input" } }
      }
    }
  }
}
