{"openapi": "3.0.3", "info": {"title": "Atmos Weather Predictor API", "version": "2.0.0", "description": "Predict the next 7 days of mean temperature from today's mean weather readings. \u00a9 Noura Maher Elamin."}, "paths": {"/api/predict/": {"get": {"summary": "Predict (query string)", "parameters": [{"name": "temperature", "in": "query", "required": true, "description": "Mean temperature (\u00b0C)", "schema": {"type": "number", "minimum": -10.0, "maximum": 55.0}}, {"name": "humidity", "in": "query", "required": true, "description": "Mean relative humidity (%)", "schema": {"type": "number", "minimum": 0.0, "maximum": 100.0}}, {"name": "wind_speed", "in": "query", "required": true, "description": "Mean wind speed (km/h)", "schema": {"type": "number", "minimum": 0.0, "maximum": 150.0}}, {"name": "pressure", "in": "query", "required": true, "description": "Mean surface pressure (hPa)", "schema": {"type": "number", "minimum": 900.0, "maximum": 1100.0}}, {"name": "date", "in": "query", "required": true, "description": "Date of the readings (YYYY-MM-DD)", "schema": {"type": "string", "format": "date"}}, {"name": "city", "in": "query", "required": false, "schema": {"type": "string", "enum": ["alexandria", "aswan", "cairo"], "default": "alexandria"}}, {"name": "model", "in": "query", "required": false, "description": "'best' = the most accurate model for day 1", "schema": {"type": "string", "enum": ["best", "ridge", "gbr", "rf"], "default": "best"}}], "responses": {"200": {"description": "Forecast", "content": {"application/json": {"schema": {"type": "object", "properties": {"city": {"type": "string"}, "model": {"type": "string"}, "start_date": {"type": "string"}, "prediction": {"type": "number", "description": "Tomorrow's mean temperature (\u00b0C)"}, "low": {"type": "number"}, "high": {"type": "number"}, "forecast": {"type": "array", "items": {"type": "object", "properties": {"day": {"type": "integer"}, "date": {"type": "string", "format": "date"}, "prediction": {"type": "number"}, "low": {"type": "number"}, "high": {"type": "number"}, "normal": {"type": "number"}}}, "description": "Days +1 \u2026 +7"}, "explain": {"type": "array", "items": {"type": "object", "properties": {"feature": {"type": "string"}, "effect": {"type": "number"}}}}, "outside_training_range": {"type": "array", "items": {"type": "string"}}}}}}}, "400": {"description": "Validation error", "content": {"application/json": {"schema": {"type": "object", "properties": {"errors": {"type": "object"}}}}}}, "429": {"description": "Rate limit exceeded (see Retry-After header)"}}}, "post": {"summary": "Predict (form fields)", "requestBody": {"content": {"application/x-www-form-urlencoded": {"schema": {"type": "object", "required": ["temperature", "humidity", "wind_speed", "pressure", "date"], "properties": {"temperature": {"type": "number", "minimum": -10.0, "maximum": 55.0}, "humidity": {"type": "number", "minimum": 0.0, "maximum": 100.0}, "wind_speed": {"type": "number", "minimum": 0.0, "maximum": 150.0}, "pressure": {"type": "number", "minimum": 900.0, "maximum": 1100.0}, "date": {"type": "string", "format": "date"}, "city": {"type": "string", "enum": ["alexandria", "aswan", "cairo"], "default": "alexandria"}, "model": {"type": "string", "enum": ["best", "ridge", "gbr", "rf"], "default": "best"}}}}}}, "responses": {"200": {"description": "Forecast", "content": {"application/json": {"schema": {"type": "object", "properties": {"city": {"type": "string"}, "model": {"type": "string"}, "start_date": {"type": "string"}, "prediction": {"type": "number", "description": "Tomorrow's mean temperature (\u00b0C)"}, "low": {"type": "number"}, "high": {"type": "number"}, "forecast": {"type": "array", "items": {"type": "object", "properties": {"day": {"type": "integer"}, "date": {"type": "string", "format": "date"}, "prediction": {"type": "number"}, "low": {"type": "number"}, "high": {"type": "number"}, "normal": {"type": "number"}}}, "description": "Days +1 \u2026 +7"}, "explain": {"type": "array", "items": {"type": "object", "properties": {"feature": {"type": "string"}, "effect": {"type": "number"}}}}, "outside_training_range": {"type": "array", "items": {"type": "string"}}}}}}}, "400": {"description": "Validation error", "content": {"application/json": {"schema": {"type": "object", "properties": {"errors": {"type": "object"}}}}}}, "429": {"description": "Rate limit exceeded (see Retry-After header)"}}}}, "/api/latest/": {"get": {"summary": "Latest REAL daily readings for a city (Open-Meteo)", "parameters": [{"name": "city", "in": "query", "required": false, "schema": {"type": "string", "enum": ["alexandria", "aswan", "cairo"], "default": "alexandria"}}], "responses": {"200": {"description": "Latest complete day + 30-day history"}, "502": {"description": "Weather provider unavailable"}, "429": {"description": "Rate limit exceeded (see Retry-After header)"}}}}, "/api/batch/": {"post": {"summary": "Batch prediction from a CSV file", "description": "CSV columns: date,temperature,humidity,wind_speed,pressure (optional: city,model). Max 1000 rows / 1 MB. Add ?format=csv to get a CSV back.", "requestBody": {"content": {"multipart/form-data": {"schema": {"type": "object", "properties": {"file": {"type": "string", "format": "binary"}}}}}}, "responses": {"200": {"description": "Per-row predictions"}, "400": {"description": "Validation error", "content": {"application/json": {"schema": {"type": "object", "properties": {"errors": {"type": "object"}}}}}}, "429": {"description": "Rate limit exceeded (see Retry-After header)"}}}}, "/api/models/": {"get": {"summary": "Available cities and models with their hold-out accuracy", "responses": {"200": {"description": "OK"}}}}, "/api/health/": {"get": {"summary": "Health check", "responses": {"200": {"description": "OK"}}}}}}