{"openapi":"3.1.0","info":{"title":"SabahKu API","description":"Open API for district-level economic indicators, diagnostics and projections for Sabah's 27 districts, with national (160-district) context. Every value carries its `source_id` and `period`; modelled values are marked `is_modelled`. Data: CC BY 4.0 where source licences allow. Code: MIT.","version":"1.0"},"paths":{"/v1/meta":{"get":{"summary":"Release, indicator catalogue and sources","operationId":"meta_v1_meta_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Meta V1 Meta Get"}}}}}}},"/v1/districts":{"get":{"summary":"All districts with headline indicators","operationId":"districts_v1_districts_get","parameters":[{"name":"scope","in":"query","required":false,"schema":{"enum":["sabah","national","all"],"type":"string","default":"sabah","title":"Scope"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Districts V1 Districts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/districts/{key}":{"get":{"summary":"Full district profile","operationId":"district_v1_districts__key__get","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response District V1 Districts  Key  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/indicators/{code}":{"get":{"summary":"One indicator for all districts (powers the choropleth)","operationId":"indicator_v1_indicators__code__get","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}},{"name":"period","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Period"}},{"name":"scope","in":"query","required":false,"schema":{"enum":["sabah","national","all"],"type":"string","default":"sabah","title":"Scope"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Indicator V1 Indicators  Code  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/compare":{"get":{"summary":"Aligned indicator series for up to 4 districts","operationId":"compare_v1_compare_get","parameters":[{"name":"ids","in":"query","required":true,"schema":{"type":"string","description":"Comma-separated ids or slugs","title":"Ids"},"description":"Comma-separated ids or slugs"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Compare V1 Compare Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/forecast/{key}":{"get":{"summary":"Fan-chart series with model version and backtest error","operationId":"forecast_v1_forecast__key__get","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"indicator","in":"query","required":false,"schema":{"type":"string","default":"income_median","title":"Indicator"}},{"name":"scenario","in":"query","required":false,"schema":{"type":"string","default":"baseline","title":"Scenario"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Forecast V1 Forecast  Key  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/analytics/{kind}":{"get":{"summary":"One analytics layer for every Sabah district","operationId":"analytics_all_v1_analytics__kind__get","parameters":[{"name":"kind","in":"path","required":true,"schema":{"enum":["forecast","scorecard","typology","shift_share","drivers"],"type":"string","title":"Kind"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Analytics All V1 Analytics  Kind  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/model-cards":{"get":{"summary":"Model cards for every analytics layer","operationId":"model_cards_v1_model_cards_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response Model Cards V1 Model Cards Get"}}}}}}},"/v1/export/{key}.csv":{"get":{"summary":"Tidy CSV of every observation for a district","operationId":"export_csv_v1_export__key__csv_get","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/data/releases":{"get":{"summary":"Versioned bulk downloads with checksums","operationId":"releases_v1_data_releases_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Releases V1 Data Releases Get"}}}}}}},"/v1/lights":{"get":{"summary":"Sabah at night: years with a picture, and its bounds","description":"Pictures of Sabah's night-time light (NASA Black Marble VNP46A4), one per year: gold\non transparent, cropped to Sabah's districts, on one fixed brightness scale. `bounds` is\n[west, south, east, north] in degrees (a plain lon/lat grid).","operationId":"lights_v1_lights_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Lights V1 Lights Get"}}}}}}},"/v1/lights/{year}.png":{"get":{"summary":"Sabah at night, one year (PNG)","operationId":"lights_png_v1_lights__year__png_get","parameters":[{"name":"year","in":"path","required":true,"schema":{"type":"integer","title":"Year"}}],"responses":{"200":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/analyst/status":{"get":{"summary":"Whether the Analyst is configured","operationId":"status_v1_analyst_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Status V1 Analyst Status Get"}}}}}}},"/v1/ask":{"post":{"summary":"Ask the AI Analyst (Server-Sent Events)","operationId":"ask_endpoint_v1_ask_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/briefs":{"get":{"summary":"District brief library (latest per district)","operationId":"brief_list_v1_briefs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response Brief List V1 Briefs Get"}}}}}}},"/v1/briefs/{key}":{"get":{"summary":"Latest brief for a district, with citations and validation","operationId":"brief_get_v1_briefs__key__get","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Brief Get V1 Briefs  Key  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/analyst/eval":{"get":{"summary":"Latest evaluation report for the Analyst","operationId":"eval_report_v1_analyst_eval_get","parameters":[{"name":"full","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Full"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Eval Report V1 Analyst Eval Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AskBody":{"properties":{"question":{"type":"string","maxLength":800,"minLength":3,"title":"Question"},"district":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"District"}},"type":"object","required":["question"],"title":"AskBody"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"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"}}}}