{"openapi":"3.1.0","info":{"title":"Henteplan API","version":"0.1.0","description":"Open API for Norwegian waste collection schedules. Supports 13 providers covering 200+ municipalities.","contact":{"name":"Henteplan","url":"https://henteplan.no"},"license":{"name":"MIT","url":"https://github.com/henrikkvamme/henteplan/blob/main/LICENSE"}},"servers":[{"url":"https://henteplan.no","description":"Production"}],"externalDocs":{"description":"Full documentation (LLM-optimized)","url":"https://henteplan.no/llms-full.txt"},"components":{"schemas":{"Provider":{"type":"object","properties":{"coverageAreas":{"type":"array","items":{"type":"string"}},"id":{"type":"string"},"name":{"type":"string"},"postalRanges":{"type":"array","items":{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":2}},"website":{"type":"string"}},"required":["coverageAreas","id","name","postalRanges","website"]},"AddressMatch":{"type":"object","properties":{"label":{"type":"string","example":"Kongens gate 1, 7011 Trondheim"},"locationId":{"type":"string","example":"12345"},"provider":{"type":"string","example":"trv"}},"required":["label","locationId","provider"]},"Pickup":{"type":"object","properties":{"category":{"type":"string","example":"paper"},"color":{"type":"string","example":"#3b82f6"},"date":{"type":"string","example":"2026-03-05"},"fraction":{"type":"string","example":"Papp og papir"},"fractionId":{"type":"string","example":"2"}},"required":["category","color","date","fraction","fractionId"]}},"parameters":{}},"paths":{"/api/v1/providers":{"get":{"tags":["Providers"],"summary":"List all supported waste collection providers","responses":{"200":{"description":"List of providers","content":{"application/json":{"schema":{"type":"object","properties":{"providers":{"type":"array","items":{"$ref":"#/components/schemas/Provider"}}},"required":["providers"]}}}}}}},"/api/v1/search":{"get":{"tags":["Search"],"summary":"Search for addresses","description":"Search for addresses across all providers, or a specific one","parameters":[{"schema":{"type":"string","minLength":2,"example":"Kongens gate 1"},"required":true,"name":"q","in":"query"},{"schema":{"type":"string","example":"trv"},"required":false,"name":"provider","in":"query"}],"responses":{"200":{"description":"Search results","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/AddressMatch"}}},"required":["results"]}}}},"400":{"description":"Invalid query"}}}},"/api/v1/schedule":{"get":{"tags":["Schedule"],"summary":"Get waste collection schedule","parameters":[{"schema":{"type":"string","example":"trv"},"required":true,"name":"provider","in":"query"},{"schema":{"type":"string","example":"12345"},"required":true,"name":"locationId","in":"query"}],"responses":{"200":{"description":"Pickup schedule","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string"},"pickups":{"type":"array","items":{"$ref":"#/components/schemas/Pickup"}}},"required":["provider","pickups"]}}}},"404":{"description":"Provider not found"},"502":{"description":"Upstream provider error"}}}},"/api/v1/schedule.ics":{"get":{"tags":["Schedule"],"summary":"Get waste collection schedule as iCal feed","parameters":[{"schema":{"type":"string","example":"trv"},"required":true,"name":"provider","in":"query"},{"schema":{"type":"string","example":"12345"},"required":true,"name":"locationId","in":"query"}],"responses":{"200":{"description":"iCal calendar feed","content":{"text/calendar":{"schema":{"type":"string"}}}},"404":{"description":"Provider not found"},"502":{"description":"Upstream provider error"}}}},"/api/v1/detect":{"get":{"tags":["Detection"],"summary":"Detect waste provider for a postal code or city","parameters":[{"schema":{"type":"string","example":"7013"},"required":false,"name":"postalCode","in":"query"},{"schema":{"type":"string","example":"Trondheim"},"required":false,"name":"city","in":"query"}],"responses":{"200":{"description":"Detected provider or null","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"allOf":[{"$ref":"#/components/schemas/Provider"},{"nullable":true}]}},"required":["provider"]}}}}}}},"/api/v1/status":{"get":{"tags":["Status"],"summary":"Get provider status and uptime","responses":{"200":{"description":"Provider status overview","content":{"application/json":{"schema":{"type":"object","properties":{"providers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["up","degraded","down","unknown"]},"lastChecked":{"type":"string","nullable":true},"uptime30d":{"type":"number","nullable":true},"history":{"type":"array","items":{"type":"object","properties":{"checkedAt":{"type":"string"},"status":{"type":"string"},"passed":{"type":"number"},"total":{"type":"number"}},"required":["checkedAt","status","passed","total"]}}},"required":["id","name","status","lastChecked","uptime30d","history"]}}},"required":["providers"]}}}}}}}}}