{"openapi":"3.1.0","info":{"title":"SensorHub Public Read API","description":"Read-only access to explicitly approved personal sensor observations. Values marked unverified have not been independently quality assured. Clients must check reading timestamps, stale flags and exporter age. Rain counter is cumulative; it is not daily rainfall. agreed_temperature_c is the stored equal-weight median of two fresh outdoor temperature sensors; it is null when they disagree or either input is unavailable. temperature_c remains the original station reading. rain_last_hour_mm estimates the hour ending at its observed_at timestamp, and is null if counter history has insufficient coverage or a reset.","version":"1.0.0"},"paths":{"/api/v1/weather/current":{"get":{"summary":"Latest approved outdoor weather observations","operationId":"current_weather_api_v1_weather_current_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SensorResponse"}}}},"404":{"description":"No approved sensor found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Approved snapshot is unavailable or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/sensors":{"get":{"summary":"Catalog of explicitly published sensors and measurement units","operationId":"sensor_catalog_api_v1_sensors_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogResponse"}}}},"404":{"description":"No approved sensor found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Approved snapshot is unavailable or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/sensors/{sensor_id}/latest":{"get":{"summary":"Latest observations from one published sensor","operationId":"sensor_latest_api_v1_sensors__sensor_id__latest_get","parameters":[{"name":"sensor_id","in":"path","required":true,"schema":{"type":"string","title":"Sensor Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SensorResponse"}}}},"404":{"description":"No approved sensor found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Approved snapshot is unavailable or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"CatalogResponse":{"properties":{"schema_version":{"type":"string","title":"Schema Version"},"generated_at":{"type":"string","title":"Generated At"},"export_age_seconds":{"type":"integer","title":"Export Age Seconds"},"export_stale":{"type":"boolean","title":"Export Stale"},"sensors":{"items":{"$ref":"#/components/schemas/SensorInfo"},"type":"array","title":"Sensors"}},"additionalProperties":false,"type":"object","required":["schema_version","generated_at","export_age_seconds","export_stale","sensors"],"title":"CatalogResponse"},"ErrorInfo":{"properties":{"code":{"type":"string","title":"Code"},"message":{"type":"string","title":"Message"}},"additionalProperties":false,"type":"object","required":["code","message"],"title":"ErrorInfo"},"ErrorResponse":{"properties":{"error":{"$ref":"#/components/schemas/ErrorInfo"}},"additionalProperties":false,"type":"object","required":["error"],"title":"ErrorResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Measurement":{"properties":{"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"unit":{"type":"string","title":"Unit"},"observed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Observed At"},"quality":{"type":"string","enum":["unverified","missing","rejected"],"title":"Quality"},"age_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Age Seconds"},"stale":{"type":"boolean","title":"Stale"}},"additionalProperties":false,"type":"object","required":["value","unit","observed_at","quality","age_seconds","stale"],"title":"Measurement"},"MetricInfo":{"properties":{"name":{"type":"string","title":"Name"},"unit":{"type":"string","title":"Unit"}},"additionalProperties":false,"type":"object","required":["name","unit"],"title":"MetricInfo"},"Sensor":{"properties":{"sensor_id":{"type":"string","title":"Sensor Id"},"label":{"type":"string","title":"Label"},"kind":{"type":"string","title":"Kind"},"stale_after_seconds":{"type":"integer","title":"Stale After Seconds"},"measurements":{"additionalProperties":{"$ref":"#/components/schemas/Measurement"},"type":"object","title":"Measurements"},"stale":{"type":"boolean","title":"Stale"}},"additionalProperties":false,"type":"object","required":["sensor_id","label","kind","stale_after_seconds","measurements","stale"],"title":"Sensor"},"SensorInfo":{"properties":{"sensor_id":{"type":"string","title":"Sensor Id"},"label":{"type":"string","title":"Label"},"kind":{"type":"string","title":"Kind"},"metrics":{"items":{"$ref":"#/components/schemas/MetricInfo"},"type":"array","title":"Metrics"},"stale":{"type":"boolean","title":"Stale"}},"additionalProperties":false,"type":"object","required":["sensor_id","label","kind","metrics","stale"],"title":"SensorInfo"},"SensorResponse":{"properties":{"schema_version":{"type":"string","title":"Schema Version"},"generated_at":{"type":"string","title":"Generated At"},"export_age_seconds":{"type":"integer","title":"Export Age Seconds"},"export_stale":{"type":"boolean","title":"Export Stale"},"sensor":{"$ref":"#/components/schemas/Sensor"}},"additionalProperties":false,"type":"object","required":["schema_version","generated_at","export_age_seconds","export_stale","sensor"],"title":"SensorResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}