{"openapi":"3.1.0","info":{"title":"Geotome API","description":"Time-aware hierarchical geography and sourced country indicators.","license":{"name":""},"version":"0.3.0"},"paths":{"/health":{"get":{"tags":["routes"],"operationId":"health","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceStatus"}}}}}}},"/ready":{"get":{"tags":["routes"],"operationId":"readiness","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceStatus"}}}},"503":{"description":"Database is unavailable"}}}},"/v1/countries":{"get":{"tags":["routes"],"operationId":"countries","parameters":[{"name":"at","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimedCollection_CountrySummary"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/countries/{country}/levels":{"get":{"tags":["routes"],"operationId":"levels","parameters":[{"name":"country","in":"path","description":"ISO 3166-1 alpha-2 country code","required":true,"schema":{"type":"string"}},{"name":"at","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimedCollection_LevelSummary"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/geographies":{"get":{"tags":["routes"],"operationId":"geographies","parameters":[{"name":"country","in":"query","required":false,"schema":{"type":"string"}},{"name":"level","in":"query","required":false,"schema":{"type":"string"}},{"name":"parentId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"at","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimedCollection_GeographySummary"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/geographies/locate":{"get":{"tags":["routes"],"operationId":"locate","parameters":[{"name":"longitude","in":"query","required":true,"schema":{"type":"number","format":"double"}},{"name":"latitude","in":"query","required":true,"schema":{"type":"number","format":"double"}},{"name":"country","in":"query","required":false,"schema":{"type":"string"}},{"name":"at","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocationResult"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/geographies/{id}":{"get":{"tags":["routes"],"operationId":"geography","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"at","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeographySummary"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/geographies/{id}/children":{"get":{"tags":["routes"],"operationId":"children","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"at","in":"query","required":false,"schema":{"type":"string"}},{"name":"level","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimedCollection_GeographySummary"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/indicators":{"get":{"tags":["routes"],"operationId":"indicators","parameters":[{"name":"country","in":"query","required":false,"schema":{"type":"string"}},{"name":"level","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IndicatorCollection"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/indicators/{code}/observations":{"get":{"tags":["routes"],"operationId":"indicator_observations","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"}},{"name":"country","in":"query","required":false,"schema":{"type":"string"}},{"name":"level","in":"query","required":false,"schema":{"type":"string"}},{"name":"period","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObservationCollection"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/map":{"get":{"tags":["routes"],"operationId":"map","parameters":[{"name":"country","in":"query","required":false,"schema":{"type":"string"}},{"name":"level","in":"query","required":true,"schema":{"type":"string"}},{"name":"parentId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"at","in":"query","required":false,"schema":{"type":"string"}},{"name":"bbox","in":"query","required":false,"schema":{"type":"string"}},{"name":"simplify","in":"query","required":false,"schema":{"type":"number","format":"double"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"GeoJSON FeatureCollection"},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"Coordinates":{"type":"object","required":["longitude","latitude"],"properties":{"latitude":{"type":"number","format":"double"},"longitude":{"type":"number","format":"double"}}},"CountrySummary":{"type":"object","required":["code","name","localName","defaultLanguage","geographyCount"],"properties":{"bounds":{"type":["array","null"],"items":{"type":"number","format":"double"}},"code":{"type":"string"},"defaultLanguage":{"type":"string"},"geographyCount":{"type":"integer","format":"int64"},"localName":{"type":"string"},"name":{"type":"string"}}},"ErrorResponse":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},"GeographySummary":{"type":"object","required":["id","countryCode","level","rank","code","name","localName","validFrom","coordinates","source"],"properties":{"code":{"type":"string"},"coordinates":{"$ref":"#/components/schemas/Coordinates"},"countryCode":{"type":"string"},"id":{"type":"string","format":"uuid"},"level":{"type":"string"},"localName":{"type":"string"},"name":{"type":"string"},"parentId":{"type":["string","null"],"format":"uuid"},"rank":{"type":"integer","format":"int32"},"source":{"$ref":"#/components/schemas/SourceSummary"},"validFrom":{"type":"string"},"validTo":{"type":["string","null"]}}},"IndicatorCollection":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/IndicatorSummary"}}}},"IndicatorSummary":{"type":"object","required":["code","name","description","category","unit","unitSymbol","decimalPlaces","countryCode","level","periods","sourceVariableId","sourceSubjectId","source"],"properties":{"category":{"type":"string"},"code":{"type":"string"},"countryCode":{"type":"string"},"decimalPlaces":{"type":"integer","format":"int32"},"description":{"type":"string"},"level":{"type":"string"},"name":{"type":"string"},"periods":{"type":"array","items":{"type":"string"}},"source":{"$ref":"#/components/schemas/SourceSummary"},"sourceSubjectId":{"type":"string"},"sourceVariableId":{"type":"string"},"unit":{"type":"string"},"unitSymbol":{"type":"string"}}},"LevelSummary":{"type":"object","required":["code","name","localName","rank","geographyCount"],"properties":{"code":{"type":"string"},"geographyCount":{"type":"integer","format":"int64"},"localName":{"type":"string"},"name":{"type":"string"},"rank":{"type":"integer","format":"int32"}}},"LocationResult":{"type":"object","required":["at","coordinates","items"],"properties":{"at":{"type":"string"},"coordinates":{"$ref":"#/components/schemas/Coordinates"},"items":{"type":"array","items":{"$ref":"#/components/schemas/GeographySummary"}}}},"ObservationCollection":{"type":"object","required":["indicator","period","range","items"],"properties":{"indicator":{"$ref":"#/components/schemas/IndicatorSummary"},"items":{"type":"array","items":{"$ref":"#/components/schemas/ObservationItem"}},"period":{"$ref":"#/components/schemas/ObservationPeriod"},"range":{"$ref":"#/components/schemas/ValueRange"}}},"ObservationItem":{"type":"object","required":["geographyId","geographyCode","geographyName","value","sourceUnitId","sourceAttributeId"],"properties":{"geographyCode":{"type":"string"},"geographyId":{"type":"string","format":"uuid"},"geographyName":{"type":"string"},"sourceAttributeId":{"type":"string"},"sourceUnitId":{"type":"string"},"value":{"type":"number","format":"double"}}},"ObservationPeriod":{"type":"object","required":["label","start","end"],"properties":{"end":{"type":"string"},"label":{"type":"string"},"start":{"type":"string"}}},"ServiceStatus":{"type":"object","required":["service","status"],"properties":{"service":{"type":"string"},"status":{"type":"string"}}},"SourceSummary":{"type":"object","required":["code","name","url","license","attribution","revision","observedAt"],"properties":{"attribution":{"type":"string"},"code":{"type":"string"},"license":{"type":"string"},"name":{"type":"string"},"observedAt":{"type":"string"},"revision":{"type":"string"},"url":{"type":"string"}}},"TimedCollection_CountrySummary":{"type":"object","required":["at","items"],"properties":{"at":{"type":"string"},"items":{"type":"array","items":{"type":"object","required":["code","name","localName","defaultLanguage","geographyCount"],"properties":{"bounds":{"type":["array","null"],"items":{"type":"number","format":"double"}},"code":{"type":"string"},"defaultLanguage":{"type":"string"},"geographyCount":{"type":"integer","format":"int64"},"localName":{"type":"string"},"name":{"type":"string"}}}}}},"TimedCollection_GeographySummary":{"type":"object","required":["at","items"],"properties":{"at":{"type":"string"},"items":{"type":"array","items":{"type":"object","required":["id","countryCode","level","rank","code","name","localName","validFrom","coordinates","source"],"properties":{"code":{"type":"string"},"coordinates":{"$ref":"#/components/schemas/Coordinates"},"countryCode":{"type":"string"},"id":{"type":"string","format":"uuid"},"level":{"type":"string"},"localName":{"type":"string"},"name":{"type":"string"},"parentId":{"type":["string","null"],"format":"uuid"},"rank":{"type":"integer","format":"int32"},"source":{"$ref":"#/components/schemas/SourceSummary"},"validFrom":{"type":"string"},"validTo":{"type":["string","null"]}}}}}},"TimedCollection_LevelSummary":{"type":"object","required":["at","items"],"properties":{"at":{"type":"string"},"items":{"type":"array","items":{"type":"object","required":["code","name","localName","rank","geographyCount"],"properties":{"code":{"type":"string"},"geographyCount":{"type":"integer","format":"int64"},"localName":{"type":"string"},"name":{"type":"string"},"rank":{"type":"integer","format":"int32"}}}}}},"ValueRange":{"type":"object","required":["minimum","maximum"],"properties":{"maximum":{"type":"number","format":"double"},"minimum":{"type":"number","format":"double"}}}}},"tags":[{"name":"geography","description":"Temporal geographic data"},{"name":"indicators","description":"Sourced country observations"}]}